DNS TTL & caching · Lesson 5 of 8 · 3 min read
Choosing TTLs
Trade-offs
| Short TTL (30–60 s) | Long TTL (hours–days) |
|---|---|
| Changes and failovers reach clients quickly | Fewer queries: lower authoritative load and DNS cost |
| More queries → slightly slower lookups (more cache misses), more cost | Faster lookups for users (cache hits) |
| More dependence on DNS availability (stale-serving helps) | More resilience if the DNS provider has issues |
| Changes take a long time to reach everyone |
Setting every TTL to 1 second: far more queries and latency, higher cost, and many resolvers will enforce their own minimum anyway — no real benefit.
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.
Sensible defaults
| Record | Typical TTL | Reason |
|---|---|---|
| Failover / DR records, blue-green cutover names | 60 s | Switch fast |
| Records you may migrate soon | 60–300 s | Flexibility |
| Normal A/CNAME for stable services | 300–3600 s | Balance |
| MX, TXT (SPF/DKIM/verification) | 3600–86400 s | Rarely change |
| NS in the zone | 86400–172800 s | Very stable |
| Alias to ELB/CloudFront | Fixed by AWS (60 s for ELB) | Follows target IP changes |
A good policy for a company zone: short TTLs for anything you might fail over or migrate, longer for stable records, and a review step before planned changes to pre-lower TTLs.
Cost on Route 53
Route 53 bills per million standard queries (and more for latency/geo/IP-based queries). Lower TTLs → more queries reach Route 53 → higher cost. Alias queries to AWS resources are free, which is one more reason to use aliases for ALBs, CloudFront and S3 websites.