How TTL simultaneously controls latency, agility and resilience.
Imagine you keep a sticky note on your fridge with the address of your favourite shop. A short-lived note say one minute, is always fresh, but you keep going back to check. A long-lived note, a whole day, saves you endless checking, but if the shop moves, you will keep heading to the old address until the note expires. And if the phone line to the shop is down, your note still tells you where to go. That sticky note is the TTL.
|
Choice |
What you gain |
What it costs |
|
Short TTL (30–300 seconds) |
Fast failover and fine-grained steering |
Far more queries reach your authoritative servers, higher typical lookup delay for users, and greater exposure if those servers become unreachable |
|
Long TTL (1–24 hours) |
Higher cache hit ratio, lower user delay, and answers that survive an outage or attack on your servers |
Changes spread slowly and steering becomes coarse |
|
The real answer |
Different TTLs for different records |
Steering-critical names short; stable infrastructure names long; NS and MX long by default |
The gives three typical values: about 60 seconds for a steering-critical record, 1 hour for a typical application endpoint, and 24 hours for typical NS and MX records.
WHAT THE RESEARCH ACTUALLY FOUND.
- Caching benefit saturates quickly. Early measurement work found that most of the speed-up from caching arrives even with fairly short TTLs, because popular names are asked for all the time (Jung et al., 2002).
- But longer TTLs still help. Later work on real authoritative infrastructure found that longer TTLs reduce user-visible delay and, crucially, greatly improve resilience when servers are under attack, because resolvers can keep answering from memory (Moura et al., 2019).
Put together, the lesson is that TTL is not only a speed dial. It is a resilience dial as well, and the resilience argument is usually the one that justifies going longer.
KEY TAKEAWAY Most zones start with a single TTL for everything, which is the easiest win in this course to fix. Separate the names that truly need agility from the names that do not, and you keep flexibility where it matters while buying speed and resilience everywhere else.
