Why nameserver changes scare people
Everyone who has done one has a story. The flip went in, mail stopped for a day, and nobody could say whether the cause was the new host, a missed record, or caches somewhere catching up. The cause is almost always the same: two changes went in at once, new nameservers and a different set of records. When something breaks, there is no way to tell which change did it.
The fix is one rule. The new zone must answer every question exactly the way the old one did, and you prove that before the flip. Then the flip changes nothing anyone can see. Every real change comes afterward, one at a time, in a zone you control.
The method
1. Get the whole zone, not the part you can guess
If the old provider exports a zone file, take it. Many registrars do
not, and most refuse zone transfers, so you are left with two sources:
the provider's DNS panel, which is the authoritative list, and
dig, which only answers questions you already know to
ask.
My own domain had ten record sets at the old
registrar: the apex address, www, mail exchangers, the SPF and
verification TXT records, autodiscover, and a handful of Microsoft 365
service records. The panel showed all ten and a dig sweep
confirmed them. Easy.
An older zone I prepared later for a local business
made the point. The registrar refused transfers, so I swept sixty
likely names with dig and found 22 record sets. Weeks
later, with the owner's permission to read their panel, the panel
showed 31. The nine I had missed were unguessable: a control panel's
autoconfig and localhost entries, a Google verification CNAME at a
random eleven-character name, three _acme-challenge
TXT records, a certificate test record, and an autodiscover SRV. Only
the Google record had any live value. The rest were dead residue from
a hosting panel nobody had used in years. I copied them anyway, for a
reason that comes next.
The rule: a dig sweep is reconnaissance, not an export.
Get into the panel or get the file.
2. Copy everything, including what is broken
Verbatim means verbatim: the same names, types and values. The SPF
record on my own domain was wrong at the time. It authorized the old
registrar's mail servers while Microsoft 365 did the sending. I copied
it wrong. The older zone had a dead mail CNAME and six
control-panel hostnames pointing at a server that no longer served
anything. Copied, all of them.
Why copy broken records? Because the point of the flip is to prove that the flip changed nothing. If the new zone differs from the old in any way, a problem after the flip has two candidate causes. If the zones are identical, it has one, and that one is "resolvers are still catching up," which fixes itself.
I gave the opposite advice first. In an early plan for the older zone I wrote "fix SPF before the flip," and a week later I withdrew it. Fixing SPF in the same window as a nameserver change is exactly the two-variables mistake this method exists to prevent. Fix it the day after, as its own reversible change.
3. Prove the copy
Ask the old and new authoritative servers the same questions and diff the answers, for every name and type in the inventory. Skip NS and SOA, which differ by design, and strip the TTL column, which you will change on purpose in the next step. For ten records this takes a minute. For thirty-one it still takes a minute.
OLD=ns1.old-provider.example
NEW=ns-81.awsdns-10.com # one of the four new servers for the zone
while read -r name type; do
diff <(dig +noall +answer "$name" "$type" @"$OLD" | awk '{$2=""; print}' | sort) \
<(dig +noall +answer "$name" "$type" @"$NEW" | awk '{$2=""; print}' | sort) \
>/dev/null && echo "ok $name $type" || echo "DIFF $name $type"
done < records.txt
My own tooling imports the zone into Route 53 from a YAML file, exports it back to the same format, and diffs the two. For a small zone the console's import and a text diff do the same job. The method is what matters, not the tool.
4. Lower the TTLs, then wait for them to drain
Before the flip, lower record TTLs on both sides so that changes made after the flip take minutes instead of hours. My old registrar's floor was 1800 seconds; the new zone got 300. Then wait at least one full old TTL, and check rather than assume: ask several public resolvers for the records and watch the remaining TTL count down to the new value before you touch the nameservers.
for r in 1.1.1.1 8.8.8.8 9.9.9.9 208.67.222.222; do
dig +noall +answer MX example.com @"$r"
done
What TTLs do not control. The delegation itself, the
NS records held in the .com zone, carries a two-day TTL
that you cannot change. For up to 48 hours after the flip, some
resolvers will still ask the old servers. With a verbatim copy that is
harmless, because the old servers give the same answers. It is also
why you leave the old zone alive and untouched for two days after the
flip rather than deleting it the same afternoon. That overlap is the
safety net, not a loose end.
5. Flip, then verify from the outside in
Change the nameservers at the registrar, and read the result from three places:
dig +short NS example.com @a.gtld-servers.net # what the registry now says
dig +short MX example.com @ns-81.awsdns-10.com # what the new servers say
dig +short MX example.com @1.1.1.1 # what a public resolver says
Then the test that matters. Send a message in from an outside mailbox and one out to it, and confirm both arrive. On my domain mail round-tripped both ways within the hour, and nothing else changed, because nothing else was supposed to.
6. Now make the changes, one at a time
The next day, with the zone proven stable: SPF corrected to a single
include: for Microsoft 365. Then a DMARC record. Then
DKIM, which had its own surprise. The Microsoft selector targets end
in .w-v1.dkim.mail.microsoft, not the
.onmicrosoft.com pattern most guides show, and building
them from the guide would have produced records that never validate.
The way through was to enable signing, read the failure message,
publish exactly what it said, and enable again. Each change was one
record, verified, and reversible. Then the TTLs went back up. The
whole sequence for the mail records is in
its own post.
For the older zone, the site move afterward is a single record change in a zone I control, with the old host still answering for anyone whose resolver has not caught up. That flip waits on the owner's schedule. The copy sits ready and verified, and it will still be verified on the day, because nothing in it depends on timing.
The checklist
- Inventory from the panel or the zone file. A
digsweep only cross-checks. - Copy verbatim, broken records included. Exclude only NS and SOA.
- Diff old against new authoritative answers for every name and type, TTL stripped.
- Lower TTLs on both sides. Wait a full old TTL. Confirm on public resolvers.
- Flip. Read the registry, the new servers, and a resolver. Round-trip mail.
- Leave the old zone alive for 48 hours.
- Changes start tomorrow, one at a time, each verified before the next.
What it cost
Route 53 charges fifty cents a month per zone and pennies for queries. The time was one afternoon for a ten-record zone, most of it spent waiting on TTLs. The older zone took longer only because of the nine names I could not guess, which is the one part of this that a tool cannot do for you.