This tutorial is deprecated in favour of Troubleshooting email issues · Cloudflare DNS docs
This tutorial covers the steps you should take if, when you change your domain to point to Cloudflare, you no longer receive emails to your domain. If you follow this tutorial and still need further help, please let us know what you have tried and share your domain name and, if possible, a redacted screenshot of your DNS records in Cloudflare.
1. Do you have the correct MX records set for your domain?
You will need to have MX records set in the DNS app in your Cloudflare dashboard for you to receive emails. There is a tutorial on Deprecated - Adding DNS Records if you need help with this. Your MX record should point to the server that manages your mail. Examples of what this should look like are:
yoursite.com is your domain name,
server.mailhost.com is the server name required by your mail host. The one pointing to
mail.yoursite.com is often used when you are on shared hosting and your email is hosted on the same server as your website. You should also ensure that they point to the correct provider by checking that your records match the ones specified in their documentation.
2. Is the name field of your MX record set to @?
If not, it covers a subdomain for mail, not the mail domain. Make sure the name is set to @ or
yoursite.com on the MX record. Where it says
yoursite.com in the examples above, make sure this shows your domain name here or the MX record will not work as expected.
3. Do your MX records point to
mail.yourdomain.com (or similar)?
If so, make sure you have an A record set for mail pointing to the IP address of the server that handles your mail (given by your email provider or web host). (make sure this is set to ).
If you have an MX record like this example
where the mail is handled by a subdomain of your own domain, you will need another DNS record. If you use
mail.yoursite.com, it needs to have the name
192.0.2.1in the example below:
4. Do you have an A record (normally mail) pointing to the IP of the server where your mail is hosted?
If you have created an A record, as shown in step 3, make sure this has a next to it. If it is , click the cloud to turn it . This might flag that entry with a because it exposes the IP address of your server. This is normal and unavoidable if email is hosted on the same server as a proxied website.
When you connect to the server to retrieve mail, you must connect through a host that is set to , i.e. if your mail program is set up to connect through
example.com which has an A record set to then it will not work. You should probably create another hostname like
smtp.example.com that is set to so it does not affect your website config on Cloudflare. Once you have another entry like
mail.example.com set to , you should modify the hostname that yous program connects over to
mail.example.com rather than
In practical terms: I will use Outlook as an example, it is similar to other email programs/apps. When you configure an email account on Outlook, it will ask for a server name. This is often provided by your webhost as something like
mail.yoursite.com, in this case, you must have an A record for
5. Do you have a spam module (or similar) on your server that expects to see your origin IP?
Some web hosts automatically install a spam module on your server, this is especially common for cPanel. For example, ‘Spam Experts Routing’, which expects mail through the domain name. When you have Cloudflare enabled, it can cause issues with this as the IP address seen is not that of your server. The solution here is to update the module with your server hostname (or in some cases, IP) instead of your domain name. You should contact your web host if you are unsure or need assistance with this.
Tutorial Reference: CT-19
Other great resources on this community include the Community Tips . These address best practiceswhen configuring Cloudflare, how to fix issues you may see, and tools to troubleshoot. Also you can view Expert Tips, great posts on the community from people in the know that may help you with your issue.
We encourage users to check out these great resources and the Cloudflare Support Centre before posting