How to enable Email on Cloudflare
I have a React/NodeJS app running on Railway using a custom domain. Cloudflare DNS records have been added (CNAME) and deleted (root A record) to enable Cloudflare to proxy traffic to my site on Railway. This is working great but I now have no email.
The MX record on Cloudflare points to the domain wuther.au but because I removed the A record, this doesn't seem to work any more.
This must be a common issue but I can't find any solutions.
Does anyone here know how I might get my email working in this context?
Thanks.
25 Replies
Project ID:
06d0b2d6-0840-4e62-be7a-b060932f11e4
06d0b2d6-0840-4e62-be7a-b060932f11e4
i dont know what email servers you use, but i use zoho and my mx records point to mx.zoho.com
you would want to point your mx records to the mx values your email provider uses
Hi @Brody. Mine do but I think because I removed the A record that points to the same domain, email routing no longer works. Does that make sense?
who's your email provider?
Hostgator
Cpanel account.
do you host your own email on a hostgator server?
Yes
https://www.hostgator.com/help/article/mail-exchange-record-what-to-put-for-your-mx-record#scenario2
i assume you would just set the mail.wuther.au record to the ip of your cpanel host
Thanks, I'll check it out...
Quick question... Do I make these changes at my domain registrar (i.e. where the nameservers point to Cloudflare)?
no youd make them in cloudflare
I am not able to complete step 1 - add an A record. I get this message: "A CNAME record with that host already exists. "
so then update the already existing record
Do you mean the CNAME that points to Railway? Sorry, I'm not very knowledgeable on this stuff.
^
Oh, I understand now. I''l try that, thanks.
I get an error message: "Change the content of your MX record to be a hostname (and not an IP address)."
https://developers.cloudflare.com/dns/manage-dns-records/how-to/email-records/#add-mx-records
Set up email records · Cloudflare DNS docs
There are two reasons to set up email records for your domain: to make sure email reaches your mail server and to prevent other email senders from …
yes so set mail.wuther.au to an a record, then set your mx record to mail.wuther.au
I can't seem to create an A record when the CNAME already exists on that domain. If I remove the CNAME, create the A Record it will work for email but then my app on Railway will not display.
i am not saying to set an A record on the root domain, i am saying to set an A record for the mail subdomain
@Brody, you're a genius. Saved me a lot of time, thanks! I'm receiving email in my hostgator email account. Now I'll figure out how to connect via an email client as it's referencing mail.wuther.au. Cheers!
awesome!
hostgator had tutorials for that stuff too btw, don't currently have the links on hand though
I'll find it, thanks!
you're supposed to use that to mark the answer 🤣
OOPS!