Steps only.

How to Point a Domain to a New Site Without Breaking Email

current Google Search Console, Bing Webmaster Tools, and major hosts · Last checked · Suggest an edit

The website is moving to a new host but email stays where it is. Two sets of DNS records live in the same zone, and only one set should change.

Know which records do what

Website records: A (IPv4 address) and AAAA (IPv6 address) for the root @, and usually a CNAME for www.

Mail records: MX, plus TXT records for SPF (at the root), DKIM (at a selector._domainkey name), and DMARC (at _dmarc). Leave all of these alone.

Open the DNS zone where the nameservers point

dig NS yourdomain.com

If the answer names your registrar, edit DNS in the registrar's control panel. If it names Cloudflare or another DNS host, edit it there. Editing a zone at the registrar while the nameservers point elsewhere changes nothing.

Change the website records only

Get the new host's values, usually an IP address for the root and a hostname for www. Then:

  • Edit the A record for @ to the new IP. Update or delete AAAA to match.
  • Edit the CNAME for www to the new host's target, or use an A record if the host gives an IP.

Do not touch any MX or TXT record, and do not clean up records you do not recognize. DKIM records often look like random text.

Copy the zone before any nameserver change

If the new host says to change nameservers, the whole zone moves to the new host and the new zone starts empty. Before switching, copy every existing record from the current zone, especially MX, SPF, DKIM, and DMARC. Recreate them in the new host's DNS panel first, then change the nameservers at the registrar.

Verify both sets of records

dig MX yourdomain.com
dig A yourdomain.com
dig TXT yourdomain.com

On Windows:

nslookup -type=MX yourdomain.com

MX should still show your mail provider. A should show the new host's IP. Then send a test message from an outside account, such as a personal Gmail address, and confirm it arrives.

If the zone is on Cloudflare. Hostnames used for mail, such as mail.yourdomain.com, must have the proxy (orange cloud) turned off. Proxied records point at Cloudflare's servers, which do not carry mail traffic.

If mail stops anyway. Compare the current zone against the copy you made and restore any MX or TXT record that is missing. Changes take effect within the record's TTL, usually under an hour.