DevOps

DNS, Cloudflare and email migration: move a site without breaking MX records.

A domain migration can make the website faster and still break email if DNS responsibilities are not separated carefully.

1. Separate web traffic from mail traffic

A domain can point web traffic to a VPS while email continues to live in the existing hosting provider. The key is understanding that A, CNAME and MX records solve different problems.

Changing the root domain to a new IP should not automatically mean changing the mail server.

  • Map current A, CNAME, MX, TXT and mail-related records before changes.
  • Keep MX records pointing to the provider that receives email.
  • Avoid proxying mail hostnames through Cloudflare.
  • Use DNS only mode for mail, smtp, imap, pop and similar hostnames.
  • Document the rollback path before lowering or changing records.

2. SPF, DKIM and DMARC protect deliverability

After a DNS migration, email can still connect but deliver poorly if authentication records are missing or inconsistent. SPF, DKIM and DMARC help receiving servers trust that messages are legitimate.

These records should be copied and verified before asking users to test Outlook or mobile email clients.

  • Preserve SPF TXT records from the mail provider.
  • Copy DKIM records exactly as provided.
  • Keep DMARC policy aligned with current operational maturity.
  • Check if the SMTP sender domain matches authenticated records.
  • Validate sending and receiving after DNS propagation.

3. Validate before and after propagation

DNS changes can appear successful in one network and still be cached elsewhere. A migration checklist should test website routes, mail login, SMTP send, form notifications and DNS lookup from more than one resolver.

The safest process is incremental: prepare records, change web routing, verify email and keep old hosting untouched until confidence is high.

  • Check domain, www and mail host resolution separately.
  • Send a test email from the mailbox and from the website form.
  • Confirm that Outlook or other clients still authenticate.
  • Review Cloudflare proxy status for each record.
  • Keep a dated note with the final DNS table.

How to use this article

Treat this page as a decision aid. Use it with the related hub, checklist or service route when the topic affects production, customer experience, deployment, security or business continuity.

Related routes

Continue with connected content.

Related route

DevOps hub

Continue with DNS, VPS and deploy topics.

Open route
Related route

Cloudflare, Nginx and Docker

Understand where DNS ends and VPS routing begins.

Open route
Related route

Post-deploy checklist

Validate routes, forms and infrastructure after migration.

Open route
FAQ

Questions readers usually ask.

Does moving DNS to Cloudflare move email hosting?

No. Cloudflare manages DNS records. Email keeps working through the provider listed in the MX and related mail records.

Should the mail record be proxied in Cloudflare?

Usually no. Mail-related records should normally stay in DNS only mode so email protocols reach the mail server directly.

WhatsApp(12) 98855-9188