Skip to content
DnsCloud

Guide · DNS migration

How to migrate DNS without downtime

Moving a domain to a new DNS provider is routine when it is planned. The work is in the preparation: a complete copy of the zone, lowered TTLs, verified answers and a careful approach to DNSSEC.

How a DNS migration works

Your registrar publishes, in the parent zone (for example .com), which nameservers are authoritative for your domain. A migration copies your zone to new nameservers and then changes that delegation.

Resolvers cache both your records and the delegation for as long as their TTLs allow. Downtime happens when, during that window, a resolver reaches a nameserver that gives a wrong or incomplete answer, or when DNSSEC signatures no longer match. If the old and new providers serve the same data and DNSSEC is handled in the right order, users do not notice the switch.

In the examples, example.com is your domain, and ns1.old-provider.example and ns1.new-provider.example stand for the current and new providers’ nameservers.

  1. Step 01

    Inventory and export the current zone

    Export the full zone from your current provider, as a zone file or through its API. If the provider allows zone transfers, AXFR gives you an exact copy. Then compare the export with live DNS, record by record.

    Look out for records that are easy to miss:

    • TXT verification records for email, search and SaaS services
    • DKIM selectors under _domainkey (each sending service uses its own selector)
    • SRV records for voice, chat and autodiscovery services
    • CAA records that restrict certificate issuance
    • Subdomain delegations (NS records for child zones) and any glue records
    • Wildcard records, and apex records such as MX and SPF
    Example commands · 01
    $ dig @ns1.old-provider.example example.com AXFR$ dig +noall +answer example.com MX$ dig +noall +answer example.com TXT$ dig +noall +answer _dmarc.example.com TXT$ dig +noall +answer selector1._domainkey.example.com TXT$ dig +noall +answer _sip._tls.example.com SRV$ dig +noall +answer example.com CAA$ dig +noall +answer shop.example.com NS
  2. Step 02

    Lower TTLs 24–48 hours ahead

    Lower the TTL of every record you may need to change, typically to 300 seconds, at least one full old TTL before the switch. A record with a TTL of 86400 seconds (one day) can be cached for a day after you change it, which is why this step comes 24–48 hours ahead.

    The TTL of the NS delegation in the parent zone is set by the registry, not by you. Check it, so you know how long the nameserver switch can take to complete.

    Example commands · 02
    $ dig @ns1.old-provider.example +noall +answer www.example.com Awww.example.com.  86400  IN  A  203.0.113.10$ dig +short com. NS$ dig +norecurse +noall +authority @<tld-server> example.com NSexample.com.  172800  IN  NS  ns1.old-provider.example.
  3. Step 03

    Recreate the zone at the new provider

    Import the zone file or create the records at the new provider, with the same values and, for now, the same low TTLs. Do not copy the old provider’s apex NS records and SOA as they are: the new provider publishes its own.

    Check that the apex NS records at the new provider list the new nameservers, and recreate any subdomain delegations exactly.

    Example commands · 03
    $ dig @ns1.new-provider.example example.com NS +norecurse +shortns1.new-provider.example.ns2.new-provider.example.
  4. Step 04

    Verify answers against the new nameservers

    Before anything changes at the registrar, query the new nameservers directly with dig @ns and +norecurse. Compare every record in your inventory with the answers from the old provider. A diff per record type catches most mistakes.

    Example commands · 04
    $ dig @ns1.new-provider.example example.com SOA +norecurse$ dig @ns1.new-provider.example www.example.com A +norecurse +short203.0.113.10$ diff <(dig @ns1.old-provider.example example.com TXT +short | sort) \       <(dig @ns1.new-provider.example example.com TXT +short | sort)
  5. Step 05

    Plan DNSSEC: remove the DS record first

    If the domain is signed, the DS record in the parent zone points at the old provider’s keys. If you switch nameservers while that DS record is still published, validating resolvers reject the new provider’s answers and the domain stops resolving for their users.

    The safe path: remove the DS record at your registrar, then wait at least the DS record’s TTL before changing nameservers. The domain is briefly unsigned, but it keeps resolving everywhere. After the move, the new provider signs the zone and you publish its new DS record (step 8).

    Advanced alternative: a multi-signer setup (RFC 8901) keeps the domain signed throughout, by publishing both providers’ keys in both copies of the zone and DS records for both. It needs support from both providers and careful coordination.

    Example commands · 05
    $ dig +noall +answer example.com DSexample.com.  3600  IN  DS  12345 13 2 ( … )$ dig +short example.com DS
  6. Step 06

    Change the nameservers at the registrar

    Replace the old nameservers with the new ones in your registrar’s control panel. Then confirm with dig +trace that the parent zone now delegates to the new provider.

    Resolvers that cached the old delegation keep asking the old nameservers until that TTL expires, which is why the old provider must stay online.

    Example commands · 06
    $ dig +trace +nodnssec example.com NS$ dig +short example.com NSns1.new-provider.example.ns2.new-provider.example.
  7. Step 07

    Keep the old provider serving, and monitor

    Leave the zone active at the old provider until the old NS records have expired from caches, often up to 48 hours. During that window, make any record change at both providers, or freeze changes.

    Monitor resolution from several networks, and compare SOA serials and key records on the old and new nameservers. Cancel the old service only once traffic has moved.

    Example commands · 07
    $ dig @ns1.old-provider.example example.com SOA +short$ dig @ns1.new-provider.example example.com SOA +short$ dig @ns1.old-provider.example example.com MX +short$ dig @ns1.new-provider.example example.com MX +short
  8. Step 08

    Restore normal TTLs and re-enable DNSSEC

    Once everything resolves from the new provider, raise the TTLs of stable records back to their normal values.

    If the domain was signed before, enable DNSSEC signing at the new provider, publish the new DS record at your registrar, and confirm that validating resolvers set the AD flag on answers.

    Example commands · 08
    $ dig @ns1.new-provider.example example.com DNSKEY +dnssec +norecurse$ dig example.com SOA +dnssec;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2

Migration checklist

Copy this list into your change ticket and tick off each item.

  1. Full zone exported and compared with live DNS
  2. TXT verifications, DKIM selectors, SRV, CAA and delegations included
  3. TTLs lowered at least 24–48 hours before the switch
  4. Zone recreated at the new provider
  5. Every record verified with dig against the new nameservers
  6. DS record removed and its TTL expired (signed domains only)
  7. Nameservers changed at the registrar and confirmed with dig +trace
  8. Old provider kept serving until the old NS TTL has expired
  9. Normal TTLs restored
  10. DNSSEC re-enabled and the new DS record published

Frequently asked questions

Is there really no downtime?

When both providers serve the same data during the transition and DNSSEC is handled in the right order, resolvers get a correct answer whichever provider they ask. Most problems come from a missing record or a stale DS record.

How long does DNS propagation take?

DNS changes do not really propagate; cached answers expire. A record change can take up to the old TTL to be seen everywhere. A nameserver change can take up to the TTL of the delegation in the parent zone, often up to 48 hours.

Can DNSSEC stay on during the move?

Only with a multi-signer setup, where both providers publish each other’s keys. Otherwise, remove the DS record first, wait for its TTL to expire, migrate, then sign at the new provider and publish the new DS record.

Will email be affected?

Not if the MX, SPF, DKIM and DMARC records are copied exactly. DKIM selectors are the records most often missed, because they sit under names you do not see in everyday use.

Do I need to change registrar?

No. DNS hosting and domain registration are separate. You only update the nameservers at your current registrar.

What if something goes wrong?

Because the old provider is still serving the zone, you can switch the nameservers back at the registrar. That is why it should keep running until the transition is complete.

Contact us

Planning a DNS migration?

Run a free check on your domain first to see its current setup. When you are ready, we can plan and carry out the migration with you.