How to Migrate DNS Without Downtime
Move a domain to a new DNS provider safely by copying every record, handling DNSSEC and running both services in parallel.
Key takeaways
- A DNS migration is safe when old and new providers return identical answers until every cache has moved on.
- Your zone's records must be inventoried carefully, because automatic import tools often miss some.
- If DNSSEC is enabled, deal with the DS record at the registrar before switching, unless both providers support a signed handover.
- Test the new name servers by querying them directly before any real user is sent to them.
You can move DNS to a new provider with no visible interruption if both providers give the same correct answers for the whole transition. Build a complete copy of your zone at the new provider, test it directly, then change the name servers at your registrar and leave the old zone running for several days.
Almost every outage during a DNS move comes from breaking that rule: a record that didn't get copied, an old zone deleted too early, or DNSSEC keys that no longer match. The steps below close each of those gaps.
Know what you're moving
Three services are often bundled together, and it helps to separate them. The registrar is where you pay for the domain and set which name servers it uses. The DNS host runs those name servers and stores your records. The web or mail host is where the records point.
A DNS migration changes only the DNS host. Your website and mail can stay exactly where they are. Zone files and name servers explains what a zone contains, and how domain registration works shows where the registrar fits.
One warning before you start: if your DNS is currently provided free by your registrar or web host, check what happens to it when you change name servers or cancel. Some providers remove the zone immediately. Keep that account active until the move is finished.
Inventory every record
Get a full list of what exists today. If the old provider offers a zone file export, use it. It's the most reliable source.
Without an export, copy records from the control panel and then verify with queries. You can't reliably list all names from outside, since zone transfers are normally restricted. Think through everything that uses the domain:
- Website records: A, AAAA and CNAME for the bare domain,
wwwand every other subdomain. - Mail: MX records, the SPF TXT record, DKIM keys under
_domainkeynames and the DMARC record at_dmarc. - Verification TXT records used by outside services.
- SRV records for chat, calendar or phone systems.
- CAA records that limit certificate issuance.
- NS records delegating a subdomain somewhere else.
- Wildcard records, which answer for names you never listed.
# macOS or Linux: ask the current authoritative server
dig @ns1.example.com example.com A +noall +answer
dig @ns1.example.com example.com MX +noall +answer
dig @ns1.example.com example.com TXT +noall +answer
dig @ns1.example.com _dmarc.example.com TXT +noall +answer Many providers import records by guessing common names. Treat the result as a draft and compare it line by line with your own list.
Watch for provider-specific features
Not everything is a standard record. Some DNS hosts offer an "alias" or "flattened" record at the bare domain, URL forwarding, geographic or weighted answers, health-checked failover, or a built-in proxy in front of your site.
These don't transfer through a zone file. For each one, find the equivalent at the new provider or replace it with ordinary records. URL forwarding in particular is easy to miss, because it's really a small web service run by the old host. If the new one lacks it, set up redirects on your own web server before switching. CNAME records and the apex domain problem explains why the bare domain needs special handling.
Handle DNSSEC before anything else
If your domain uses DNSSEC, the registry holds a DS record that matches a key at your current DNS host. Switch name servers without addressing it, and validating resolvers will reject the new provider's answers with SERVFAIL. Your domain appears dead to many users.
Check for it first.
dig example.com DS +short No output means there's nothing to do. If you see a DS record, you have two options.
The simple path is to turn DNSSEC off temporarily: remove the DS record at the registrar, wait longer than the DS record's TTL, then disable signing at the old host and continue the move. Once the new provider is serving the zone, enable signing there and publish its new DS record.
The advanced path keeps the domain signed throughout by publishing both providers' keys during the overlap. It requires both hosts to support it, so confirm with their documentation before relying on it. DNSSEC explained covers the keys involved.
Lower TTLs early
At the old provider, reduce TTLs on records you might need to correct, to something like 300 seconds. Do this at least as long before the move as the previous TTL.
This helps you fix mistakes quickly. It doesn't shorten the delegation change itself, because the NS records in the parent zone carry the registry's TTL, often a day or two. Lowering TTL before a cutover explains the timing.
Build and test the new zone
Create the zone at the new provider and add every record. Then query the new name servers directly. They'll answer even though the public doesn't use them yet.
dig @ns1.newdns.example.net www.example.com A +noall +answer
dig @ns1.newdns.example.net example.com MX +noall +answer Compare results from old and new for every name on your list. A short script that loops over names and types and prints both answers side by side makes differences obvious. Expect differences in SOA and NS records. Anything else should be intentional.
Pay attention to trailing dots. In some interfaces, a target entered as mail.example.com without the final dot gets your domain appended to it. The query output reveals this immediately.
Switch the name servers
When both zones match, sign in at the registrar and replace the old name server names with the new ones. Replace the whole set. Mixing servers from two providers permanently leads to inconsistent answers as soon as one zone changes.
Also update the NS records inside the new zone so they list the new provider's servers. Most hosts do this for you.
Run both in parallel
For the next few days, some resolvers will ask the old servers and some the new. Both must be right. If you need to change a record during this window, change it in both places. Better still, freeze all non-urgent edits.
You can watch the move from the parent zone's point of view with a trace.
dig example.com NS +trace If the old provider shows query statistics, watch them fall. Check your website, send mail to and from the domain, and confirm that any service relying on verification records still reports success.
Finish cleanly
After several days with no meaningful traffic to the old servers, raise your TTLs back to normal values. Re-enable DNSSEC at the new provider and add the DS record at the registrar, then verify with a validating resolver. Only then delete the old zone and close the old account if you no longer need it.
Save a copy of the final zone somewhere you control. It's your starting point if you ever move again, or need to recover from an accidental deletion.
Moving other things at the same time
It's tempting to change DNS host, web host and mail provider in one weekend. Resist it. When three things change together and something fails, you can't tell which change caused it, and rolling back one may break another.
Do the DNS move first, with every record still pointing where it did before. Let it settle. Then move the website or mail by editing records at the new DNS provider, where changes follow the ordinary TTL rules and are quick to reverse. Mail moves need their own care, since new provider records for SPF and DKIM have to be in place before you send from the new service.
The same applies to a registrar transfer. Moving the domain's registration is a separate process from moving its DNS, and doing both together adds risk if the old registrar stops serving the zone when the transfer completes. Move DNS to an independent or new provider first, confirm it works, and only then transfer the registration.
A comparison script idea
For zones with more than a handful of records, make the check repeatable. Keep a text file with one name and type per line, then ask both name servers about each.
# macOS or Linux; records.txt holds lines like: www.example.com A
while read name type; do
old=$(dig @ns1.example.com "$name" "$type" +short | sort)
new=$(dig @ns1.newdns.example.net "$name" "$type" +short | sort)
[ "$old" = "$new" ] || echo "DIFFERS: $name $type"
done < records.txt Sorting matters because servers may return multiple records in any order. This comparison covers values only, so check TTLs separately if they matter to you. Run it again just before the switch, in case someone edited the old zone after you copied it.
If something goes wrong
Your rollback is to set the old name servers again at the registrar, which works only if the old zone still exists and is correct. Rolling back is subject to the same caching delay, so fixing the new zone is often faster: a record correction takes effect after the record's TTL, which you've already lowered.
If mail stops, compare MX, SPF and DKIM records first. If the whole domain returns errors for some people, check for a leftover DS record. If one subdomain is missing, it was probably not on the inventory. Common DNS mistakes lists more of the usual suspects.