Change Nameservers Without Downtime: When to Delete the Old DNS Zone

Change nameservers without downtime: at a just-thrown switch a train takes the new branch, while a train already on the old branch rolls into its lit station
To change nameservers without downtime, keep the old provider's zone unchanged and answering for at least the registry's delegation TTL after the switch, then a margin; we would add a day. Deleting the zone as soon as the registrar saves the change is the common mistake. In a lab with a 60-second delegation TTL, that gave BIND users SERVFAIL for about 40 www lookups in 40 seconds. Unbound users saw no errors when the old server answered REFUSED, and, in most runs, timeouts until 30 to 50 seconds after the change when it was stopped or silent.

Use this order as your DNS migration checklist:

  1. Copy every record to the new provider, for example Hostry Free DNS, except the apex NS and SOA.
  2. Check the new zone’s apex NS; it must list only the new provider’s servers.
  3. Compare both providers with dns-parity.sh until a complete names list passes.
  4. Read the delegation TTL, then change the nameservers at the registrar.
  5. Wait at least that TTL plus a margin, a day in our view; deleting sooner broke lookups for BIND users in the lab.
  6. Verify through the resolvers your visitors use, since a propagation checker may show only the registry’s side.
  7. Delete the old zone once a resolver’s NS answer names only the new provider.

This order covers unsigned zones only. A signed domain also has a DS record at the registry with a step of its own, and the lab zones were unsigned.

How the lab was set up

The timings here were reproduced with Unbound 1.19.2, BIND 9.18.39 and BIND 9.20.24 in network namespaces on Ubuntu 24.04.5 (fake root, fake TLD, two NSD 4.8.0 providers, loopback, no real latency). Delegation TTLs of 20, 60 and 300 seconds are lab parameters chosen so a run ends in minutes. Each run had one process per resolver; public resolvers and farms of cache nodes were not simulated. Each resolver’s client asked for www every second and for a never-seen name every 5 seconds, plus NS every 10 seconds where stated. A repeat run means a second, independent reproduction of the same setup (Unbound 1.19.2 and BIND 9.18.39 only) whose client asked mainly for www.

shop.example moves from ns1/ns2.dnsold.example (198.51.100.31 and .32) to ns1/ns2.dnsnew.example (.41 and .42); substitute your own. As a test marker only, www is .80 at the old provider and .81 at the new, so the lab can tell who answered.

Change nameservers without downtime: what the registrar actually changes

The registrar replaces one record set, your domain’s NS records in the TLD registry’s zone, called the delegation. Each provider’s copy of your zone carries its own NS records at the apex, and the registrar never touches those. A resolver caches the delegation for the TTL the registry set and sends its questions to the servers it names. In the lab the two sets carried 60 and 600 seconds:

$ dig +norec @198.51.100.20 www.shop.example A          (the TLD: a referral)
shop.example.		60	IN	NS	ns1.dnsold.example.
shop.example.		60	IN	NS	ns2.dnsold.example.
ns1.dnsold.example.	86400	IN	A	198.51.100.31
$ dig +norec @198.51.100.31 www.shop.example A          (the old provider)
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
www.shop.example.	20	IN	A	198.51.100.80
shop.example.		600	IN	NS	ns1.dnsold.example.
shop.example.		600	IN	NS	ns2.dnsold.example.

After the switch, every resolver still holding the old delegation keeps asking the old servers until that copy expires, and they answer from the old zone.

Diagram of a nameserver change: a resolver asks the TLD registry for the domain's NS records, caches them for the delegation TTL, then queries the DNS provider the registry named, old or new

Copy every record except the old provider’s NS set

Copy every record to the new provider except the apex NS set, which should name the new provider’s servers only, and the SOA, which the new provider writes for its own copy of the zone. If Hostry Free DNS is the receiving provider, it takes a domain from any registrar, and neither records nor queries are limited in number; add the records there, then compare both copies before you switch.

Before the switch, ask the new provider for its apex NS set. The answer must list only the new servers, here ns1/ns2.dnsnew.example. The parity script below cannot catch this, because names.txt leaves the apex NS out by design.

dig +norec @198.51.100.41 shop.example NS +noall +answer

An imported zone can keep the old NS lines. In the lab, BIND returned to the old provider after the registrar change only when a client also queried NS records, every 10 seconds here. Without NS queries, an NS set in the zone that differed from the delegation changed nothing, and all three resolvers moved when the delegation expired.

With a 60-second delegation TTL and an NS TTL of 600 s in the zones, BIND 9.18.39 and 9.20.24 adopted the new zone’s NS set and swung between the providers: www came from the old provider until 178 s, from the new one for 18 seconds, then from the old one until the run ended at 200 s. A repeat run still queried the old provider at 213 s. Unbound 1.19.2 kept the registry’s set and left at 57 s. With the old zone also deleted, BIND answered SERVFAIL to 123 of its 183 www lookups from 17 s on, with new answers only for one www TTL (20 s) after each delegation re-fetch.

Listing both providers’ nameservers in both zones, as one guide advises, kept the old servers busy too: with the same NS queries (60-second delegation TTL), BIND 9.20.24 sent 11 to 14 of its 16 or 17 queries a minute to them from the second to the sixth minute after the change. A deliberate two-provider setup lists both in the delegation as well, a design explained in how a secondary DNS provider helps through an outage.

Compare DNS records before switching with a dig loop

Ask both providers the same questions and diff the answers to catch records the copy missed; no AXFR is needed. dns-parity.sh needs bash and dig (bind9-dnsutils on Ubuntu 24.04). Build names.txt from the old provider’s export or panel, without the apex NS and SOA, which differ by design.

From a BIND-style export, the awk line in the stale DNS record audit cuts each record down to name, type and value. Keep the first two columns, shorten each name to the part before your domain (@ for the apex), and put all of a name’s types on one line:

# name          types to compare
@               A MX TXT CAA
www             A AAAA
mail            A
_dmarc          TXT
_sip._tcp       SRV
s1._domainkey   TXT
shopadmin       CNAME A

Save the script as dns-parity.sh and make it executable with chmod +x dns-parity.sh, or run it as bash dns-parity.sh.

#!/usr/bin/env bash
# dns-parity.sh: ask the old and the new DNS provider the same questions and compare the answers.
# Works without zone transfers (AXFR): you supply the names and types to check.
# Usage: dns-parity.sh <zone> <old-nameserver> <new-nameserver> <names-file>
# names-file: one line per name, "<name|@> <TYPE> [TYPE...]", e.g.  "@ A MX TXT CAA", "www A AAAA", "_dmarc TXT"
# Exit code: 0 = no differences, 1 = differences found, 2 = usage error.
set -u
[[ $# -eq 4 ]] || { echo "usage: $0 <zone> <old-ns> <new-ns> <names-file>" >&2; exit 2; }
zone=${1%.}; old=$2; new=$3; list=$4
[[ -r $list ]] || { echo "cannot read $list" >&2; exit 2; }

# ask <server> <name> <type>: prints "STATUS" then "TTL TYPE RDATA" lines, sorted (TXT chunks joined)
ask() {
  dig +norec +time=3 +tries=2 @"$1" "$2" "$3" +noall +comments +answer 2>&1 | awk '
    /status:/ { match($0, /status: [A-Z]+/); st = substr($0, RSTART + 8, RLENGTH - 8) }
    /^[^;]/ && NF >= 5 { ttl = $2; $1 = $2 = $3 = ""; sub(/^ +/, ""); gsub(/" "/, ""); print ttl, $0 | "sort" }
    /connection timed out|no servers could be reached|communications error/ { st = "TIMEOUT" }
    END { close("sort"); print (st == "" ? "NOANSWER" : st) > "/dev/stderr" }' 2>&1
}

diffs=0; checked=0
probe="parity-probe-$RANDOM$RANDOM"          # a name nobody created: catches a wildcard on one side only
while read -r name types; do
  [[ -z $name || $name == \#* ]] && continue
  [[ $name == @ ]] && fq=$zone || fq=$name.$zone
  for t in $types; do
    a=$(ask "$old" "$fq" "$t"); b=$(ask "$new" "$fq" "$t"); checked=$((checked + 1))
    sa=$(tail -n1 <<<"$a"); sb=$(tail -n1 <<<"$b")
    da=$(sed '$d' <<<"$a" | cut -d' ' -f2- | sort); db=$(sed '$d' <<<"$b" | cut -d' ' -f2- | sort)
    ta=$(sed '$d' <<<"$a" | cut -d' ' -f1 | sort -u | tr '\n' ' '); tb=$(sed '$d' <<<"$b" | cut -d' ' -f1 | sort -u | tr '\n' ' ')
    if [[ $sa != NOERROR && $sa != NXDOMAIN ]] || [[ $sb != NOERROR && $sb != NXDOMAIN ]]; then
      printf 'ERROR    %-34s %-5s old: %s | new: %s\n' "$fq" "$t" "$sa" "$sb"; diffs=$((diffs + 1))
    elif [[ -n $da && -z $db ]]; then
      printf 'MISSING  %-34s %-5s old has: %s   (new: %s)\n' "$fq" "$t" "$(tr '\n' ';' <<<"$da")" "$sb"; diffs=$((diffs + 1))
    elif [[ -z $da && -n $db ]]; then
      printf 'EXTRA    %-34s %-5s only new has: %s\n' "$fq" "$t" "$(tr '\n' ';' <<<"$db")"; diffs=$((diffs + 1))
    elif [[ $da != "$db" ]]; then
      printf 'DIFF     %-34s %-5s old: %s | new: %s\n' "$fq" "$t" "$(tr '\n' ';' <<<"$da")" "$(tr '\n' ';' <<<"$db")"; diffs=$((diffs + 1))
    elif [[ $ta != "$tb" ]]; then
      printf 'TTL      %-34s %-5s same data, TTL old: %s| new: %s\n' "$fq" "$t" "$ta" "$tb"; diffs=$((diffs + 1))
    else
      printf 'ok       %-34s %-5s %s\n' "$fq" "$t" "${da:-($sa, empty)}" | head -n1
    fi
  done
done < "$list"
a=$(ask "$old" "$probe.$zone" A | tail -n1); b=$(ask "$new" "$probe.$zone" A | tail -n1)
if [[ $a != "$b" ]]; then
  printf 'WILDCARD %-34s A     old: %s | new: %s  (a wildcard exists on one side only)\n' "$probe.$zone" "$a" "$b"; diffs=$((diffs + 1))
fi
echo "checked $checked name/type pairs, $diffs difference(s). Names that are not in $list were NOT checked."
[[ $diffs -eq 0 ]]

Run against two test copies of the zone with differences planted between them, it printed:

$ ./dns-parity.sh shop.example 198.51.100.131 198.51.100.141 names.txt
ok       shop.example                       A     A 198.51.100.80
[...]
TTL      www.shop.example                   A     same data, TTL old: 300 | new: 3600 
[...]
MISSING  _dmarc.shop.example                TXT   old has: TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@shop.example";   (new: NXDOMAIN)
DIFF     _sip._tcp.shop.example             SRV   old: SRV 10 5 5060 mail.shop.example.; | new: SRV 10 5 5061 mail.shop.example.;
ok       s1._domainkey.shop.example         TXT   TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwLabKeyPart1AAAA[...]
ok       shopadmin.shop.example             CNAME CNAME www.shop.example.
TTL      shopadmin.shop.example             A     same data, TTL old: 300 | new: 300 3600 
WILDCARD parity-probe-3132516597.shop.example A     old: NOERROR | new: NXDOMAIN  (a wildcard exists on one side only)
checked 12 name/type pairs, 5 difference(s). Names that are not in names.txt were NOT checked.

It flagged the missing _dmarc TXT and the SRV port moved from 5060 to 5061. It also caught the www TTL raised from 300 to 3600 (shown again on shopadmin, a CNAME to www) and a one-sided wildcard found by the random probe name. A timeout on the probe trips that WILDCARD line too, so rerun before trusting it. The DKIM key, split into strings differently by each copy, passed because the script joins TXT strings; a plain diff of two dig +short outputs flagged it as changed.

A name left out of the file goes unseen. Here legacy.shop.example existed only at the old provider, and AXFR, which would have listed it, was refused by the lab’s NSD. names2.txt is names.txt with a legacy A line added:

--- blind spot: legacy.shop.example is not in names.txt
$ dig +norec @198.51.100.131 legacy.shop.example A +noall +comments +answer
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40325
legacy.shop.example.	300	IN	A	198.51.100.86
$ dig +norec @198.51.100.141 legacy.shop.example A +noall +comments +answer
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 65219
--- zone transfer from the old provider (no provide-xfr configured, NSD default)
$ dig @198.51.100.131 shop.example AXFR
; (1 server found)
;; global options: +cmd
; Transfer failed.
[...]
--- with legacy added to the list
MISSING  legacy.shop.example                A     old has: A 198.51.100.86;   (new: NXDOMAIN)
checked 13 name/type pairs, 6 difference(s). Names that are not in names2.txt were NOT checked.

The script exits 0 on a clean pass and 1 on any difference. Check that names.txt covers the full inventory before treating a 0 as a clean result.

Parent vs child NS TTL: the registry’s value decides

The registry’s delegation TTL, the parent side, decided when each resolver in the lab moved. A longer NS TTL inside your zone, the child side, never held one back, and a shorter one helped only when the resolver fetched NS as an answer.

First www answer from the new provider, in seconds after the change, with the lab client asking for NS every 10 seconds:

Delegation TTL (lab)NS TTL in the zoneUnbound 1.19.2BIND 9.18.39
20 s20, 600 or 86400 s18.134.1
60 s600 or 86400 s60.0-60.170.0-70.1
300 s600 or 86400 s312.1304.1
60 s20 s18.134.1
300 s20 s18.0 (39.1 in a second lab run)34.0

BIND 9.20.24 matched 9.18.39 on every row where it ran. Eight seconds after a fetch (60-second delegation TTL), both caches kept the registry’s remaining 52 seconds on the provider’s NS answer when the zone said 600 or 86400, and the zone’s 12 when it said 20:

m-P60-C600   unbound: ;rrset 52 2 0 8 0   shop.example. 52 IN NS ns1.dnsold.example.
m-P60-C600   BIND   : ; authanswer        shop.example. 52 NS ns1.dnsold.example.
m-P60-C86400 unbound: shop.example. 52 IN NS ...      BIND: ; authanswer shop.example. 52 NS ...
m-P60-C20    unbound: ;rrset 12 2 0 8 0   shop.example. 12 IN NS ns1.dnsold.example.
m-P60-C20    BIND   : ; authanswer        shop.example. 12 NS ns1.dnsold.example.

With no NS queries, the 20-second child TTL did nothing: www moved at 60.1 s (Unbound) and 70.1 s (BIND) under the 60-second delegation. NS records that NSD attaches to ordinary answers (unless minimal-responses: yes is set) did not count. Unbound with harden-referral-path: yes fetches NS on its own and switched at 18.1 s without any client NS queries.

RFC 9199, section 3.6.1, cites a 2019 study of resolvers on the internet by Moura et al., which found that roughly 90% of them follow the child’s view of the TTL; a single-process lab cannot reproduce that population. ISC’s own documents lean toward the parent. Its parent-centric resolver draft calls child-centric resolution the historical approach, and an ISC bind-users post of April 8, 2026 says child NS records in BIND 9.22 “will no longer overwrite the delegation data for the domain.” BIND 9.21 and 9.22 were not run.

What lowering TTLs before a nameserver change does

Lowering record TTLs before a nameserver change shortens how long resolvers serve answers they cached from the old provider. When queries to the old provider stop is still up to the delegation TTL. With a 60-second delegation TTL and www at TTL 300:

[u11]  TLD queries: [-3.0, 62.0, ...]  last query to OLD 57.0 s | www last OLD answer 297.0 s | first NEW 298.0 s
[b21]  TLD queries: [-3.0, 57.0, ...]  last query to OLD 52.0 s | www last OLD answer 295.0 s | first NEW 296.0 s
[b23]  same as b21

With the lab client’s never-seen names in the mix, queries to the old provider ended at 52-57 s; in the repeat run, whose clients asked only for cached names, it got none after the change. Cached old www answers lasted until 295-298 s in both. With identical copies that is harmless; short TTLs matter if you change records during the move, since a fix then reaches each resolver within one record TTL of it leaving the old provider.

If you plan such changes, lower those record TTLs, for example to 300 s, at least one old TTL before the switch; the decommission order for a retired VPS explains why one old TTL is the lead time.

The switch, measured: Unbound and BIND side by side

Each resolver sent its last query to the old provider within one delegation TTL of its last fetch of the delegation, and none after that. With a 60-second delegation TTL, the change made 3 seconds after the fetch and the lab client’s mix (www every second, a never-seen name every 5 seconds), five runs gave the same result to 0.1 s:

Seconds after the change (www TTL 20 s, zone NS TTL 86400 s)Unbound 1.19.2BIND 9.18.39 and 9.20.24
Old delegation fetched-2.9-2.9
Last query to the old provider57.152.1
New delegation fetched60.157.1
Last www answer from the old provider59.169.1
First www answer from the new provider60.170.1
Queries to the old provider after that00
Client errorsnonenone

The last-query row depends on what clients ask. In the repeat run, with a www-only client and the same 60-second delegation TTL, Unbound’s last query to the old provider came at 39.1 s and BIND’s at 51.1 s; the www rows matched.

Both resolvers re-fetched the expired delegation when a lookup needed it: Unbound at 60.1 s, BIND at 57.1 s with the lab’s mix and at 69.1 s in the repeat run, when its www prefetch needed it. BIND’s www stayed old 10 seconds longer because its default prefetch 2 9 refreshed www from the old provider 2 seconds before each expiry, the last time at 51 s. Set to prefetch 0;, BIND switched at 57.1 s.

Settings on resolvers you run moved the switch both ways under a 60-second delegation TTL. Unbound with prefetch: yes or serve-expired: yes reached the new provider at 16-19 s, because every background refresh of www re-fetched the delegation. A cache-min-ttl: 300 floor applied to the delegation as well and held Unbound on the old provider until 298 s. Serve-stale on BIND 9.20 changed nothing while the old servers answered.

A change later in the life of the cached delegation moved everything earlier by the same amount. By age of the delegation at the change, last old query and first new www answer (60-second delegation TTL):

pre=10  unbound 50.1 / 53.1   BIND 9.18 45.1 / 63.1   BIND 9.20 45.1 / 63.1
pre=20  unbound 40.1 / 43.1   BIND 9.18 35.1 / 53.1   BIND 9.20 35.1 / 53.1
pre=30  unbound 30.1 / 33.1   BIND 9.18 25.1 / 43.1
pre=40  unbound 20.1 / 23.1   BIND 9.18 15.1 / 33.1
pre=50  unbound 10.1 / 13.1   BIND 9.18  5.1 / 23.1

Over many resolvers fetching at random moments, the old provider’s traffic should drain roughly linearly over one delegation TTL, and cached old answers one record TTL later; that is an extrapolation from single-process runs.

Timeline of a nameserver change in a lab with a 60-second delegation TTL: last query to the old provider at 52 to 57 seconds, Unbound answers from the new provider at 60 seconds, BIND at 70 seconds, and the old zone kept answering well beyond that

Negative caching: NXDOMAIN after adding a record

A name that exists only at the new provider stays NXDOMAIN after the switch for the old zone’s negative TTL, if a resolver asked for it beforehand. That TTL is the lower of the SOA record’s TTL and its MINIMUM field, per RFC 2308, section 5. In a lab with a 60-second delegation TTL and MINIMUM 300, a client asked for crm.shop.example, present only in the new zone, from 3 seconds before the change:

[u11] www first NEW 60.1 s | crm: first answer with data 298.1 s | NXDOMAIN 301, NOERROR 32
[b21] www first NEW 70.1 s | crm: first answer with data 297.1 s
[b23] www first NEW 70.1 s | crm: first answer with data 297.1 s

www moved at 60-70 s, and crm answered only at 297-298 s. By default Unbound 1.19.2 caps negative answers at 3600 s (cache-max-negative-ttl) and BIND 9.18 and 9.20 at 10800 s (max-ncache-ttl); NODATA was cached like NXDOMAIN. Create new names before the switch and test them against the new provider directly, as in dig +norec @198.51.100.41 crm.shop.example A, which keeps them out of resolver caches.

Why a propagation checker shows new nameservers while the site is still old

A checker that asks the registry, or follows referrals down from the root as dig +trace does, sees the new nameservers as soon as the registry publishes the change. A caching resolver keeps the old ones until its delegation expires. Three checks tell the two views apart; put a resolver your visitors use in place of 192.0.2.53:

  • The registry delegation, from dig +norec @198.51.100.20 shop.example NS against a TLD server, shows what the registry publishes, which is all a checker of this kind sees.
  • A resolver’s NS answer, from dig @192.0.2.53 shop.example NS, shows which provider that resolver is using now.
  • A resolver’s www answer, from dig @192.0.2.53 www.shop.example A, shows what its users get, up to one record TTL behind its NS answer.

Polled every 2 seconds with a 300-second delegation TTL, with dig +trace as a fourth column:

t(s)    registry_NS  resolver_NS(ttl)  resolver_wwwA(ttl)  trace_wwwA(server)
 -3.0   old          old(86400)        old(20)             old(from 198.51.100.31)
  1.3   new          old(296)          old(16)             new(from 198.51.100.42)
299.0   new          new(86400)        old(12)             new(from 198.51.100.41)
314.0   new          new(285)          new(18)             new(from 198.51.100.41)

The registry view and dig +trace flipped at 1.3 s; the resolver’s NS answer flipped at 299 s and its www answer at 314 s. The TTL in that NS answer misleads, since Unbound’s first NS answer after a fetch showed the zone’s 86400 while it kept the set for 300 seconds. Real checker sites were not called from the lab.

What deleting the old zone too early does

Deleting the old zone before the delegation TTL had passed caused lookup failures in the BIND runs below. The lab removed the zone at the moment of the change in four ways, with a 60-second delegation TTL: the server answered REFUSED, answered SERVFAIL, dropped packets, or was stopped. Each time, BIND 9.18.39 and 9.20.24 failed every uncached name until about when the delegation expired, up to about 10 s past it in the dropped-packet runs. For www that meant about 40 SERVFAILs in 40 seconds:

run d-refused; change at 1794820305.381; events: start=-3.0, change=+0.0, action-refused=+0.0

[u11] src 203.0.113.11
  TLD queries for shop.example (s after change): [-2.9, 2.1, 60.1]
  [...]
  client www : last OLD answer    17.1 s | first NEW answer    18.1 s | old after new: 0 | errors {} span None | [...]

[b21] src 203.0.113.21
  TLD queries for shop.example (s after change): [-2.9, 57.1]
  [...]
  client www : last OLD answer    16.1 s | first NEW answer    58.1 s | old after new: 0 | errors {'SERVFAIL': 41} span (17.1, 57.1) | [...]
[...]

Unbound 1.19.2 asked the TLD again at the first REFUSED or SERVFAIL, at 2.1 s, and its client saw no errors. With the server stopped, its client saw timeouts for half a minute or more: until 32 s in the lab run (3-second client timeout) and until 51 s in the repeat run (12-second timeout). With dropped packets, in two lab runs of four, one lookup kept retrying the old servers with exponential back-off for about 3 minutes, to 199 s, although from 31-33 s Unbound was sending other names to the new provider:

20.1 > 198.51.100.31 A? www.shop.example.     23.5 > .31     30.4 > .31     44.3 > .32
65.1 > 198.51.100.20 A? shop.example.  (TLD, new delegation)
68.3 > .31 www     96.0 > .32 www     144.1 > .31 www     199.4 > .32 www

In the run shown, that lookup was www, unanswerable until the run ended at 263 s. In the other three lab runs www recovered at 32-41 s, and in the repeat run by 47-52 s. If your registry’s delegation TTL is measured in hours, so is the SERVFAIL window for users of BIND-based resolvers.

How long to keep the old DNS zone after changing nameservers

Keep the old zone, unchanged and answering, for at least the registry’s delegation TTL after the switch, then a margin; we would add a day. Resolver farms and TTL floors can hold the old delegation longer, and in a lab with a 60-second delegation TTL, Unbound’s cache-min-ttl: 300 kept it on the old provider until 298 s.

The record TTL and the old zone’s negative TTL decide when every visitor sees the new data and how long a rollback stays clean. They do not make deletion safer, because resolvers serve cached answers whether or not the old zone exists. The old zone’s NS TTL is not part of the wait either; a longer one never extended anything in the lab.

1. Read the delegation TTL before the change

Ask one of your TLD’s servers without recursion before you change anything at the registrar; example.net stands in for your domain:

d=example.net                          # your domain
tld=net                                # its TLD
srv=$(dig +short NS "$tld." | head -n1)
dig +norecurse +noall +authority NS "$d" @"$srv"

Run it for your own domain and read the TTL column: the second column of each NS line is the delegation TTL in seconds. Keep +noall +authority, because the TLD answers with a referral and dig +short printed nothing for one in the lab.

2. Add up the wait, then delete

As arithmetic only: if that command shows 43200, keep the old zone for 43200 seconds plus a day, 129600 seconds or 36 hours after the change. With a longest record TTL of 14400, every visitor has the new data by 57600 seconds, 16 hours, plus the old zone’s negative TTL for names created only at the new provider. Then delete the old zone once a resolver’s NS answer names only the new provider.