How to Migrate Your DNS to a New Provider Without Downtime
Migrating your DNS provider without downtime requires careful planning, reduced Time-To-Live (TTL) values, complete record synchronization, and a planned cutover. By preparing your new nameservers well in advance and keeping your old provider active until global caches expire, you ensure a seamless transition for your users and email services.
Understanding the DNS Migration Lifecycle
DNS migration is the process of moving your zone files—A, AAAA, CNAME, MX, TXT, and SRV records—from one Domain Name System hosting provider to another. The primary challenge during this transition is the distributed nature of the global DNS cache. When recursive resolvers cache your domain's records, they continue to query your old nameservers until the TTL expires.
To prevent visitors from hitting dead ends on your old infrastructure, you must bridge the gap by duplicating your zone data precisely, reducing query lifespans beforehand, and updating your domain registrar's nameservers at the exact right moment. For a quick diagnostic check of your current records before starting, you can use the NS Lookup tool to query specific nameservers and verify what data resolvers currently see.
Phase 1: Preparation and TTL Reduction
Before touching your new DNS host, you must modify the TTL values on your current (old) provider. The TTL dictates how long recursive resolvers cache your DNS records.
Step 1: Identify and Lower TTLs
Log in to your current DNS provider and locate your zone file. Change the TTL of all critical records (such as A, AAAA, CNAME, and MX) from standard defaults (often 86400 seconds or 24 hours) down to 300 seconds (5 minutes).
; Old Zone File Example
example.com. 300 IN A 192.0.2.1
www.example.com. 300 IN A 192.0.2.1
mail.example.com. 300 IN MX 10 mail.example.com.
Step 2: Wait Out the Old TTL
You must wait for the duration of your previous long TTL before proceeding. If your old TTL was 24 hours, you must wait a full 24 hours after lowering it to ensure that global resolvers have dropped the old cached entries and fetched the new 5-minute TTL.
Phase 2: Building and Verifying the New Zone
While you wait out the TTL expiration, set up your account with the new DNS provider.
Step 1: Export or Import Zone Data
Many providers allow you to export your zone file in standard BIND format and import it directly into the new platform. If you must enter records manually, cross-reference every entry carefully.
Step 2: Configure Every Record Type
Ensure you include all critical infrastructure records:
- Apex Records: A and AAAA records pointing to your web server (e.g.,
192.0.2.1or2001:db8::1). - Subdomains: CNAME records for services like
wwwor client portals. - Mail Exchange: MX records directing mail to your mail server.
- Domain Verification: TXT records for SPF, DKIM, DMARC, Google Workspace, Microsoft 365, or SSL certificate validations.
| Record Type | Host / Name | Target / Value | Priority | Purpose |
|---|---|---|---|---|
| A | @ |
192.0.2.1 |
N/A | Root web traffic |
| CNAME | www |
example.com |
N/A | Subdomain alias |
| MX | @ |
mail.example.com |
10 | Email routing |
| TXT | @ |
v=spf1 include:_spf.example.com ~all |
N/A | Email security |
Step 3: Test the New Nameservers Directly
Most DNS providers assign specific nameservers to your zone (e.g., ns1.newprovider.com). Query the new nameservers directly using command-line utilities to confirm they reply accurately.
dig @ns1.newprovider.com example.com A
In PowerShell, you can query specific servers using the Resolve-DnsName cmdlet:
Resolve-DnsName -Name example.com -Server ns1.newprovider.com
Phase 3: The Cutover Process
Once your new zone is fully populated and verified, you are ready to update your registrar settings.
Step 1: Log Into Your Registrar
Log in to the domain registrar where you purchased example.com (this may be different from your DNS provider). Navigate to your domain management dashboard, open the DNS or Nameserver management section, and look for custom nameservers.
Step 2: Replace Nameservers
Delete the old nameservers and input the exact nameservers provided by your new DNS host. Save the changes.
Old Nameservers:
ns1.oldprovider.com
ns2.oldprovider.com
New Nameservers:
ns1.newprovider.com
ns2.newprovider.com
Step 3: Monitor Propagation
Because you lowered your TTLs to 5 minutes in Phase 1, global resolvers will quickly abandon your old provider and begin querying your new nameservers. Use command-line tools to check which nameservers are currently responding for your domain globally.
dig +trace example.com SOA
Common Migration Mistakes and How to Fix Them
Even experienced engineers occasionally trip over edge cases during a migration. Avoiding these common pitfalls guarantees zero downtime.
- Forgetting TXT and Validation Records: Failing to copy SPF, DKIM, or SSL validation TXT records can break email delivery or automated certificate renewals. Double-check hidden TXT records.
- Truncated TTL Wait Times: Changing the TTL and immediately updating nameservers means resolvers will cache the old long TTL on the new nameserver delegation, locking in stale records for hours or days.
- Typos in Nameserver Entries: A single character typo in a custom nameserver string causes NXDOMAIN errors. Always copy and paste nameserver values directly.
- Shutting Down the Old Zone Too Early: Do not delete your zone from the old provider the moment you update your registrar. Keep the old zone active for at least 48 hours to serve stray queries from slow-updating recursive resolvers.
Pre-Migration Checklist
- Inventory all current DNS records, including hidden TXT and SRV entries.
- Reduce all record TTLs to 300 seconds.
- Wait out the duration of the old TTL.
- Build and fully verify the zone on the new DNS provider.
- Test queries directly against the new nameservers.
- Update nameservers at your domain registrar.
- Keep the old DNS provider active for 48 hours post-cutover.
- Restore normal TTL values once propagation finishes.