Emails can't send or receive after copying DNS records to Cloudflare from cPanel

What is the name of the domain?

What is the issue you’re encountering

I moved to a new WordPress website (not on cPanel) this week, so I pointed the A Record domainname.com to the new site’s server IP + created a www A record to do the same. I also updated name servers in my domain registrar to Cloudflare instead of the cPanel servers. Website was throwing error messages and redirected to the old site until I changed proxy to DNS only. But we realised email is no longer working. Client is using Gmail as email client. What am I doing wrong?

What steps have you taken to resolve the issue?

I have to make a note the following records were not copied from cPanel:

  • SOA was not copied across because CF doesn’t have an option to add SOA records
  • two name servers found in the client’s cPanel matching the original name servers I removed from domain registrar. The non-CF NS records were removed because the domain name was being redirected to the old website and/or throwing errors. Removing the non CF NS records made the website work. I also assumed the non-CF NS records are not needed now that we’re using CF name servers.

What feature, service or problem is this related to?

DNS records

Screenshot of the error

Currently, your MX record is pointing to a proxied CNAME record. That is bad for 2 reasons:

  1. The target of an MX record must be an A record, not a CNAME.
  2. The target of an MX record must not be proxied.

So you need to replace the mail CNAME with an A record tot he 170.xxx IP address to be able to receive email.

As for sending, could you test your email with https://www.mail-tester.com/ and share a link to the result here?

Edit:

It would be helpful if you could tell us what the error messages were.

2 Likes

Blockquote So you need to replace the mail CNAME with an A record tot he 170.xxx IP address to be able to receive email.

The emails are not hosted on 170.xx IP though. Can I instead replace the mail CNAME with A record to 199.xxx IP?

It would be helpful if you could tell us what the error messages were.

It was err_QUIC_PROTOCOL_ERROR and website was intermittently redirected to the old WordPress site hosted on 199.xxx IP. I’m hoping that is because of the initial DNS propagation issue when I pointed A Record domainname.com to the new website host 170.xxx IP

Sure. I just assumed your old records were correct. Your MX record pointed to the mail CNAME, and that in turn pointed to your 170.xxx A record (if you copied the records correctly from cPanel).

That could well be, but switching it to DNS-Only again shouldn’t have made any difference in that regard. Could you turn the proxy on again for a moment?

Noted. I am so grateful for your advice thus far. I will report back if it’s fixed because they need their website to be up and running until end of day tomorrow (Event purpose) so I don’t want to interfere with current setup right now.

I just realised that you said in your opening post that you copied all the records from cpanel, except for the one that’s now 170.xxx. So if your A record pointed to the correct IP before, that explains why it worked and doesn’t now.

Make sure that you use the Full (strict) SSL setting in Cloudflare before you make your next test.

I just realised that you said in your opening post that you copied all the records from cpanel, except for the one that’s now 170.xxx. So if your A record pointed to the correct IP before, that explains why it worked and doesn’t now.

The WordPress site is hosted on another server 170.xxx IP. But email will still be on cPanel 199.xxx IP. I didn’t think I need to update DNS in cPanel zone editor anymore because I’m using CF name servers :slight_smile: Perhaps I am mistaken.

I will try the following and report back:

  • change CNAME mail to A pointing to cPanel 199.xxx where the email is hosted and set it to DNS only.
  • change MX value to add mail. in front of domain name so they correspond to each other.

I’ve also sent my records to cPanel support to cross-check if there is anything I’ve missed!

You only need to delete the mail CNAME and create a new mail A record with the 199.xxx IP.

And that is correct.

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