The rule that drives everything

Resolvers keep an answer for the TTL it had when they fetched it. So the longest anyone can see the old answer after a change is the TTL that was published before the change. Lower the TTL first, wait out the old TTL, and the change itself then reaches everyone within minutes. Keep the old target working until the old answers have expired.

Before you start: inventory and dependencies

Most broken changes break something nobody listed. Before touching a record, write down what it is for and what else relies on it.

  1. Export the zone from the provider, or save the output of the commands below, so you have the exact current values to roll back to.
  2. List the records you will change with their current value and TTL, and the new value.
  3. List what depends on them. The table below covers the usual suspects.
  4. Name an owner and a time. Someone who can roll back should be available for at least the old TTL after the change.
If you changeAlso check
A or AAAA for a websiteCNAMEs that point at it, the TLS certificate on the new server, firewall allowlists and health checks that use the old address, and CAA if the new host will request certificates
MXSPF (the new provider's include), DKIM selectors, DMARC reporting, and any inbound gateway or connector
A TXT recordWhether a service still needs it to stay verified. Many verification records must stay in place for as long as you use the service.
A CNAME to a third-party serviceThat the target exists and belongs to you, so the name cannot be taken over
NS or DS recordsEvery record in the zone, DNSSEC keys, and the parent's TTLs, which you cannot lower. These are the hardest changes to roll back.

Review the change

Have a second person read the change before it goes in: the exact names (including the trailing dot or the host field your provider expects), types, values and TTLs, the order of the steps, and the rollback value. A change written as a diff of the zone file or of code (Terraform, DNSControl, octoDNS) is easier to review than a list of dashboard clicks.

Changing a record (website move, new mail provider)

  1. Note the current TTL. Run the DNS Propagation Checker for the record and read the TTL on the authoritative answer. Say it is 3600 seconds (an hour).
  2. Lower the TTL on that record to 300 seconds (five minutes), keeping the value the same.
  3. Wait at least the old TTL: an hour here, longer to be safe. Check again: every row should now show a TTL of five minutes or less.
  4. Make the change and confirm the authoritative nameservers all show the new value with the same SOA serial.
  5. Watch propagation. Check every few minutes; anything still different should catch up within the new short TTL.
  6. Keep the old target running (the old server, IP address or mail provider) for at least the old TTL again, for clients and resolvers that ignore TTLs.
  7. Raise the TTL back once you are sure you won’t roll back. An hour or a day is typical for stable records.

Moving DNS to a new provider

Changing nameservers is slower, because the delegation lives in the parent zone (for example .com), and TLD servers publish NS records with TTLs of a day or two that you can’t lower.

  1. Copy the whole zone to the new provider and check it matches, record by record. A zone export plus the Zone Analyzer helps.
  2. Ask the new provider’s nameservers directly for a few key records before switching. In PowerShell or a shell, use the commands below.
  3. Turn off DNSSEC signing at the registrar first (remove the DS record) if the zone is signed and the new provider can’t take over the keys, and wait for the DS TTL to pass. A DS record pointing at keys the new provider doesn’t hold makes validating resolvers return SERVFAIL.
  4. Change the nameservers at the registrar.
  5. Keep the old provider serving the same zone for at least two days. Resolvers that still have the old delegation will keep asking it.
  6. Watch NS records with the DNS Propagation Checker (choose NS) until every row shows the new nameservers, then re-enable DNSSEC with the new provider.
CommandWhat it confirms
dig +norecurse @ns1.new-provider.example www.example.com AThe new provider serves the record
Resolve-DnsName www.example.com -Server ns1.new-provider.example -DnsOnlyThe same from Windows PowerShell
dig +norecurse @a.gtld-servers.net example.com NSWhat the .com servers now delegate to

New names and records

A brand-new name has nothing cached, so it works everywhere at once, with one catch: if anyone looked it up before it existed, their resolver cached “does not exist” for the zone’s negative TTL, the last number in the SOA record (capped by the SOA’s own TTL, RFC 2308). Avoid testing a name before you create it, or lower the SOA minimum beforehand.

Verifying the change

Check from the source outwards: first the authoritative servers, which show what you published, then recursive resolvers, which show what users get.

CommandWhat it confirms
dig +nssearch example.comEvery authoritative nameserver has the same, new SOA serial
dig +norecurse @ns1.example.com www.example.com AOne authoritative server gives the new value, with the aa flag. Repeat for each nameserver.
dig @1.1.1.1 www.example.com A and dig @8.8.8.8 www.example.com APublic resolvers, and the TTL they have left on any old answer
Resolve-DnsName www.example.com -Server 8.8.8.8 -DnsOnlyThe same check from Windows PowerShell
curl -sI --resolve www.example.com:443:192.0.2.20 https://www.example.com/The service answers on the new target (here 192.0.2.20) with a valid certificate for the name, whatever your own resolver still has cached

Then check the service, not just the record: load the site, send a test email, or sign in to the verified service.

Watching and rolling back

For at least the old TTL after the change, watch error rates, mail delivery and the old target's traffic, which should fall to near zero. Roll back if the service fails on the new target and you cannot fix it quickly.

  • Record changes roll back with one edit, back to the saved value. With a short TTL in place, users return to the old target within minutes.
  • Nameserver changes roll back slowly, because the parent's NS TTL applies again. That is why the old provider must keep serving the same zone.
  • DNSSEC changes can make the domain fail for validating resolvers. Never remove keys that a published DS record still points to; see DNSSEC key rollovers.

Once the change is stable, raise the TTL again and remove records that are no longer needed, such as old verification TXT records or CNAMEs to services you have left.

A reusable change checklist

Copy this into your change ticket.

Before

  • Current records and TTLs saved, or the zone exported.
  • Dependencies listed: certificates, SPF and DKIM, verification records, allowlists, CNAMEs that point at the record.
  • The change reviewed by a second person, with the rollback value written down.
  • The TTL was lowered at least one old TTL ago.

During

  • Every authoritative nameserver shows the new value and the same SOA serial.
  • A propagation check is mostly green, and the remaining rows have short TTLs.
  • The service works on the new target: page loads, test email delivered.

After

  • The old target is still up until the old TTL has passed again.
  • Errors and traffic were watched for at least that long.
  • For mail: MX, SPF and DKIM were all checked, for example with Email Validation.
  • The TTL is raised again and records that are no longer needed are removed.
  • The intended records in your source of truth (zone file, code or documentation) match what is live.

FAQ

How low should I set the TTL before a change?

300 seconds is a common choice. Some resolvers raise very low TTLs to a minimum of their own, so going below 60 seconds rarely helps.

Do I need to lower the TTL for a new record?

No. Nothing has cached it yet. Just avoid looking it up before it exists, which would cache a negative answer.

Why do nameserver changes take so long?

The NS records that point to your provider are published by the TLD, often with a 48 hour TTL, and you can’t lower them. Keep the old provider serving the same records until that has passed.

Sources and further reading