You’ve just migrated your website to a new hosting provider. You updated your DNS records. You waited. And waited. And waited.
Eight hours later, half your users see the new site. The other half are still staring at an old “Under Maintenance” page on the old server.
Welcome to the invisible handbrake of the internet: DNS Time-to-Live (TTL) .
Most website owners set their TTL once—usually to whatever default their DNS provider gave them—and never think about it again. That’s a costly mistake.
Understanding TTL is the difference between a seamless 15-minute migration and a 48-hour SEO nightmare of split traffic, downtime penalties, and frustrated users.
Let’s demystify DNS TTL: what it is, how it works, and exactly when you need to manipulate it.
Part 1: What Is DNS TTL? (The Analogy)
Think of DNS like a phonebook for the internet. When someone types yourdomain.com, their computer asks, “Where do I find this?” The DNS responds with an IP address: 192.0.2.1.
But asking the phonebook for every single click would be slow. So computers are lazy—in a good way. They cache (remember) that address.
TTL is the expiration date on that memory.
Formally: Time-to-Live is a numerical value in seconds that tells recursive resolvers (like Google DNS or your ISP) how long to cache a DNS record before asking for a fresh copy.
- TTL = 3600 seconds (1 hour): Your users’ computers will remember your IP address for one hour.
- TTL = 300 seconds (5 minutes): They’ll forget and re-query every 5 minutes.
The trade-off is brutal but simple:
- Long TTL = Faster performance (fewer lookups) but slower changes (migrations take forever).
- Short TTL = Slower performance (more lookups) but instant updates (changes propagate quickly).
Part 2: Anatomy of a DNS Record (Technical Deep Dive)
Not all DNS records are created equal. Different record types serve different purposes, and their TTL values should reflect that.
| Record Type | Purpose | Recommended TTL Range |
|---|---|---|
| A / AAAA | Points domain to IP address | 300–3600 seconds (migration-ready) |
| CNAME | Alias to another domain | 3600–86400 seconds (stable) |
| MX | Email routing | 3600–86400 seconds (critical stability) |
| TXT | Verification (SPF, DKIM, DMARC) | 3600 seconds (balanced) |
| NS | Nameserver delegation | 86400+ seconds (rarely change) |
Pro Tip: Your authoritative nameservers (the ones hosting your DNS zone) also have their own TTL—called the SOA Minimum TTL or Negative Caching TTL. This controls how long resolvers remember that your domain doesn’t exist. Set this too high during a nameserver change, and you’ll lock yourself out.
Part 3: The Three Situations Where You MUST Change TTL
Most of the time, your default TTL (often 3600 or 86400 seconds) is fine. But in three specific scenarios, leaving it unchanged is actively harmful.
Situation 1: Website Migration (The Big One)
The Scenario: You’re moving from Hostinger to AWS, from a shared server to a VPS, or from HTTP to HTTPS.
The Problem: If your TTL is 86,400 seconds (24 hours), when you flip the switch, 50% of your users may still be hitting the old server 12 hours later. You’ll have split-brain traffic, lost form submissions, and confused analytics.
The Solution (The “TTL Taper” Strategy):
- 48 hours before migration: Lower TTL to 300 seconds (5 minutes).
- Wait 48 hours. This ensures 99% of recursive resolvers have fetched the new low TTL value. (Yes, you must wait the original TTL period for the change to propagate.)
- Perform migration. Flip your A record to the new IP.
- 24 hours after migration: Raise TTL back to 3600–86400 seconds.
Critical Warning: If you skip the 48-hour waiting window and change TTL and IP simultaneously, you’ve accomplished nothing. Resolvers still hold the old (long) TTL in cache.
Situation 2: Email Infrastructure Change
The Scenario: You’re switching from Google Workspace to Microsoft 365, or adding a new email security gateway.
The Problem: Email is unforgiving. If MX records change unevenly across the globe, you’ll get:
- Bounced emails (hard failures)
- Delayed delivery (soft failures)
- Spam filtering issues (SPF/DKIM mismatches)
The Solution: Lower TTL on your MX and TXT records to 300 seconds 72 hours prior to the cutover. Run both old and new email systems in parallel for 24 hours. Raise TTL only after all tests pass.
Situation 3: DDoS Mitigation & Traffic Shifting
The Scenario: You’re under attack and need to reroute traffic through a scrubbing center (Cloudflare, Akamai, Fastly).
The Problem: During an active attack, every second counts. A 3600-second TTL means users continue hitting your origin server for an hour, even after you’ve moved DNS.
The Solution: Run your production TTL at 300 seconds permanently if you’re in a high-risk industry (gaming, finance, political activism). The performance penalty is minimal with modern DNS providers.
Part 4: The Risks of Ultra-Low TTL (Don’t Go Crazy)
If short TTL is so good for migrations, why not run everything at 30 seconds?
Three hard technical reasons:
- Resolver Throttling: Some recursive resolvers (especially older ISP DNS servers) treat ultra-low TTLs as abuse and ignore your value, capping you at 300–600 seconds anyway.
- DNS Query Costs: Many managed DNS providers (AWS Route 53, Azure DNS, NS1) charge per million queries. Cutting TTL from 3600s to 60s increases query volume by 60x. Your bill will explode.
- Negative Caching Interactions: If your authoritative server goes down, resolvers with a 30-second TTL will re-query constantly, hammering your struggling server and making recovery harder.
The Industry Consensus: 300 seconds (5 minutes) is the lowest responsible TTL for production. 60 seconds is for emergencies only. 30 seconds is for load balancers and active-active failover systems.
Part 5: Step-by-Step TTL Change Workflow
Here’s exactly how to execute a TTL change without breaking your site.
Phase 1: Pre-Change Audit
bash
# Check current TTL from outside your network dig yourdomain.com +ttlid # Check propagation across global resolvers nslookup yourdomain.com 8.8.8.8 # Google nslookup yourdomain.com 1.1.1.1 # Cloudflare nslookup yourdomain.com 208.67.222.222 # OpenDNS
Phase 2: Lower TTL (48+ Hours Before Migration)
- Log into your DNS provider (Cloudflare, AWS Route 53, GoDaddy, etc.).
- Locate the TTL field for each record you plan to change.
- Set to
300(seconds). Not60. Not30. 300. - Document the original TTL so you can restore it later.
- Wait the full original TTL period. If old TTL was 86,400s, wait 24 hours. Do not skip this.
Phase 3: Execute Migration
- Change the target DNS record (e.g., A record IP address).
- Verify the change locally:bashdig yourdomain.com @your-nameserver.com
- Monitor DNS propagation tools (WhatsMyDNS.net, DNSChecker.org).
Phase 4: Restore TTL
- After 24–48 hours of stable operation, raise TTL to
3600(1 hour) or86400(24 hours). - Do not raise TTL immediately after migration. You may need to roll back. Low TTL is your safety harness.
Part 6: Advanced: TTL for CDNs and Global Load Balancing
If you use a CDN (Cloudflare, Fastly, Akamai), your DNS TTL interacts with edge caching. This is where senior engineers earn their salary.
The Pattern:
- DNS TTL: 300 seconds (users find the nearest edge node quickly).
- Edge Cache TTL: 86400 seconds (static assets stay cached at the edge).
Why? Because you want users to discover edge nodes frequently (low DNS TTL) but once connected, you want those nodes to remember assets for a long time (high cache TTL).
Special Case: Traffic Manager / Route 53 Latency-Based Routing
If you’re routing users to different geographical servers based on latency, keep your TTL at 60–300 seconds. Internet routing tables change constantly. Stale DNS = users hitting the wrong region.
The Senior’s Summary Table
| Scenario | TTL Before | TTL During | TTL After |
|---|---|---|---|
| Normal operation | 3600–86400s | N/A | 3600–86400s |
| Website migration | 300s (48h prior) | 300s | 3600s |
| Email provider change | 300s (72h prior) | 300s | 86400s |
| DDoS high-risk | 300s (permanent) | 300s | 300s |
| Global load balancing | 60–300s | 60–300s | 60–300s |
Final Verdict
TTL is invisible when it works correctly and catastrophic when it doesn’t. Most website owners discover their TTL settings only during a crisis—when they’re watching half their traffic hit an old server and they can’t do anything about it for 24 hours.
Don’t be that person.
Audit your DNS TTL today. Document your current values. And the next time you plan a migration, start lowering TTL 48 hours before you touch a single file.
Your future self—the one not getting paged at 2 AM for split-brain traffic—will thank you.
Have a DNS horror story? Or a clever TTL strategy for multi-cloud failover? Drop it in the comments.







