Cloudflare, cPanel and MX records/e-mail

Hi, I am quite new with cloudflare, I have an issue with making my e-mail routing work and would like some help.

Specifically, (I imagine this should come up quite a bit), I’m not sure how to set my MX records in order to make my e-mail work with cPanel. I already contacted cPanel for this, they gave me instructions on how to set the records, but I’m not sure how to get it working as apparently either I am doing something wrong, or it simply doesn’t work.

So if anyone could guide me on how to set the correct DNS records to allow my e-mail to work, that would be awesome. Feel free to ask me for any details that are necessary, I will be using “example.com” as example domain name. I have several domains connected to my cloudflare account, so I assume that if someone gives me the correct instructions with “example.com” I can replicate it on all of my domains and get the e-mail working, hopefully.

Awaiting a response. Kind regards.

Btw please don’t send me the support article for setting MX records, I don’t understand jack from it, just tell me straight away what to do. Thanks!

Hi @eid.ot.evil,

Did they give you the content of the MX record to add?

The #Tutorials section here focuses on making information as accessible as possible, I would hope that Adding DNS Records can help.

As you can see, your domain name is using Cloudflare, which is a proxy server. According to the public DNS check, there is no MX record for your domain name. This will causes your domain not able to receive any emails, as the emails do not know where to deliver the email.

In order to correct this, you will need to add the following MX record for your domain name on Cloudflare’s DNS zone.

NAME: mail.example.com
Type: A
TTL: 14400
Destination: 000.000.000.000

OK, sounds from this like you will need 2 records.

This example, taken from step 3 of Troubleshooting Email Delivery Issues when using Cloudflare uses yoursite.com, but should help.

yoursite.com will need to be your domain name and 192.0.2.1 the IP of your server.

1 Like

Hurray, super awesome, that worked perfectly! It looked a bit more complicated than it was :))) Thanks a lot!

2 Likes

No problem! Glad you got it sorted and I could help :slight_smile:

Last question, instead of “mail” can I put for example “webmail” or any other “subdomain” as record to send mail to and then assign the MX record to it? Or does it only work with “mail”?

In that case, you would change mail to webmail (or anything else) in both the A and MX records. That would work as long as you change both.

Ok, thanks a lot again for the help. Hope you have a good one!

1 Like

Uhm, I actually came up with another question, lol. If I want to send mail to an e-mail address that is used on a subdomain, do I need to make new A and MX records for that as well, as in, “mail.example.example.com” and then route the MX to there? Does that work? Or would e-mails for subdomains work automatically since I already created the “mail” A record for the main domain?

You can just set the MX record for the subdomain to point to mail.example.com, you don’t need a new A record.

Ok, I tested that as well, and it works, I really appreciate the help :))) That’s awesome!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.