Knowledgebase

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.com is proxied, it resolves to Cloudflare, and email programs and other mail servers cannot connect to it.
  • SPF using a: if your SPF relies on a and the root record is proxied, it now points to Cloudflare IPs, not your server.

Step 1: Compare your records

  1. In cPanel, open Zone Editor and list all records for the domain (cPanel keeps the old zone even after the move).
  2. In Cloudflare, open DNS > Records.
  3. 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)

  1. Create or check an A record mail pointing to your hosting IP, set to DNS only (grey cloud).
  2. The MX record for the root domain should point to mail.yourdomain.com (priority 0 or 10). MX records are never proxied.
  3. Set webmail, cpanel, autodiscover and autoconfig records to DNS only as well.
  4. Fix the SPF so it lists the server IP directly, for example:
    v=spf1 +mx ip4:YOUR_SERVER_IP ~all
    Replace YOUR_SERVER_IP with your hosting IP. Keep only one SPF record.
  5. In your email program, use mail.yourdomain.com as incoming and outgoing server. See email client settings.
Tip: Cloudflare shows a warning next to a proxied record that exposes your server IP, and another warning when an MX target is proxied. Fix those warnings first.

Step 3: Email on Google Workspace or Zoho Mail

  1. Copy the MX records exactly as your provider gives them (for Google, usually smtp.google.com; for Zoho, the mx.zoho... records shown in your Zoho admin).
  2. Copy the SPF (for example include:_spf.google.com or Zoho's include), the DKIM TXT record and DMARC.
  3. Any CNAME records your provider asks for (verification or custom links) should be DNS only.

Step 4: Test

  1. Wait a few minutes after saving (Cloudflare applies changes quickly, but caches elsewhere may need time).
  2. Send a message from an outside address to your mailbox, then reply.
  3. 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.com or a proxied name as server. Use mail.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.

  • cloudflare, email, mx record, dns only, grey cloud, spf, email stopped

Was this answer helpful?

0 Users Found This Useful