What is DNS TTL? Time To Live Explained
TTL (Time To Live) is a field in every DNS record that tells resolvers how long they can cache the record before fetching a fresh copy from the authoritative nameserver. TTL directly controls how fast DNS changes propagate across the internet.
How TTL Works
When a resolver first looks up a DNS record, it caches the result for the number of seconds specified by the TTL. During this time, any query for the same record is served from cache — no DNS query to your nameserver occurs.
example.com. 3600 IN A 203.0.113.1
^^^^
TTL = 3600 seconds = 1 hourAfter 3600 seconds, the resolver discards its cached copy and queries the authoritative nameserver again for a fresh record.
TTL Values and Their Impact
| TTL | Duration | Use Case |
|---|---|---|
60 | 1 minute | During active migration or failover testing |
300 | 5 minutes | Records that change occasionally (good for planning migrations) |
3600 | 1 hour | Common default — balance of freshness and performance |
86400 | 24 hours | Stable records like NS and MX that rarely change |
604800 | 7 days | SOA records and other very stable data |
TTL Before a DNS Migration
The classic technique when planning a DNS change (e.g., moving to a new server):
- 48+ hours before: Lower your TTL to 300 seconds
- Wait for the old high TTL to expire everywhere
- Make the DNS change (e.g., update the A record IP)
- Wait 5 minutes for the new TTL to propagate
- After confirming everything works, raise TTL back to 3600+
This minimizes downtime because caches refresh quickly after the change.
SOA Minimum TTL
The SOA (Start of Authority) record contains a minimum TTL value that applies to negative responses (cache of "this record does not exist"). If you query for a record that doesn't exist, the resolver caches the "not found" result for this duration.
TTL Trade-offs
| Low TTL | High TTL |
|---|---|
| Changes propagate quickly | Changes take longer to propagate |
| More DNS queries to your server | Fewer DNS queries (better performance) |
| Faster failover / recovery | Harder to change records quickly |
| Slightly higher DNS latency for users | Better caching — faster for users |
Recommended TTL Values by Record Type
| Record Type | Recommended TTL | Reason |
|---|---|---|
| A / AAAA | 3600 (1h) | May change during server migrations |
| CNAME | 3600 (1h) | Stable, but may change with CDN switches |
| MX | 3600–86400 | Mail servers rarely change |
| TXT (SPF/DMARC) | 3600 | Policy may need updates occasionally |
| NS | 86400 (24h) | Very stable — only changes when switching DNS providers |
| SOA | 86400 | Rarely changes |
Check Your Current TTL Values
See the theory in practice — run a DNS Lookup for your own domain.