How to keep email working after moving your DNS to Cloudflare
A very common problem: you moved your domain to Cloudflare and the website works, but email stopped arriving or sending. This guide shows how to keep email working after moving your DNS to Cloudflare, whether your email is on EgWeb hosting (cPanel), Google Workspace or Zoho Mail.
Why email breaks
- Missing records: Cloudflare's import does not always copy every MX, TXT (SPF, DKIM, DMARC) or mail-related record.
- Proxied mail hostname: the Cloudflare proxy (orange cloud) only handles web traffic. If
mail.yourdomain.comis proxied, it resolves to Cloudflare, and email programs and other mail servers cannot connect to it. - SPF using
a: if your SPF relies onaand the root record is proxied, it now points to Cloudflare IPs, not your server.
Step 1: Compare your records
- In cPanel, open Zone Editor and list all records for the domain (cPanel keeps the old zone even after the move).
- In Cloudflare, open DNS > Records.
- Make sure every MX, every TXT (SPF, DKIM like
default._domainkey, DMARC_dmarc) and any CNAME or SRV records used by your email provider exist in Cloudflare with the exact same values.
Step 2: Email on EgWeb hosting (cPanel)
- Create or check an A record
mailpointing to your hosting IP, set to DNS only (grey cloud). - The MX record for the root domain should point to
mail.yourdomain.com(priority 0 or 10). MX records are never proxied. - Set
webmail,cpanel,autodiscoverandautoconfigrecords to DNS only as well. - Fix the SPF so it lists the server IP directly, for example:
Replacev=spf1 +mx ip4:YOUR_SERVER_IP ~allYOUR_SERVER_IPwith your hosting IP. Keep only one SPF record. - In your email program, use
mail.yourdomain.comas incoming and outgoing server. See email client settings.
Step 3: Email on Google Workspace or Zoho Mail
- Copy the MX records exactly as your provider gives them (for Google, usually
smtp.google.com; for Zoho, themx.zoho...records shown in your Zoho admin). - Copy the SPF (for example
include:_spf.google.comor Zoho's include), the DKIM TXT record and DMARC. - Any CNAME records your provider asks for (verification or custom links) should be DNS only.
Step 4: Test
- Wait a few minutes after saving (Cloudflare applies changes quickly, but caches elsewhere may need time).
- Send a message from an outside address to your mailbox, then reply.
- Check that SPF and DKIM pass by viewing the message headers ("Show original" in Gmail). See SPF, DKIM and DMARC.
Common problems
- Bounces like "no MX record" or "host not found": the MX record is missing or points to a proxied name. See common email errors.
- Outlook or phone cannot connect: the program uses
yourdomain.comor a proxied name as server. Usemail.yourdomain.com(DNS only). - Emails go to spam since the move: SPF or DKIM is missing or wrong in Cloudflare.
Frequently asked questions
Does Cloudflare protect my email?
No. On the free setup, email does not pass through Cloudflare. It only hosts your DNS records for mail.
Does a DNS-only mail record reveal my server IP?
Yes, for cPanel email the mail hostname has to show the server IP. That is normal for shared hosting.
Do I still edit DNS in cPanel?
No. After the move, all DNS changes are made in Cloudflare. See how to add your website to Cloudflare.
Need help? Open a support ticket or message us on WhatsApp +20 127 113 3655.