For DNS server caching, what is the ideal TTL?
Many factors affect how you decide to set time to live (TTL) for DNS servers. Learn more, plus how BlueCat Edge's TTL features can…
Read moreDNS TTL (Time to Live) is a configurable value in seconds that controls how long resolvers cache DNS responses before querying the authoritative server again, with the resolver returning the remaining seconds rather than the original value as the record ages in cache. TTL represents a fundamental trade-off between performance and agility: longer values reduce query load on authoritative servers and improve lookup speed at scale, while shorter values enable faster propagation of record changes but increase server load and dependency on authoritative availability. Common operational challenges include planning failures where changes are made without accounting for cached TTL duration, lowering TTL too late to take effect before migrations, and resolver-level overrides that cause behavior to diverge from published zone configuration.
Every DNS resource record carries a TTL value in seconds, set by the administrator of the authoritative zone. Resolvers use that value to decide how long a stored answer remains valid.
Caches at several layers, such as the operating system, browser and forwarding resolvers, each apply their own countdown, so a change can take longer than one TTL to be seen everywhere. Negative answers, such as nonexistent names, are also cached, with their lifetime governed by the SOA record as described in RFC 2308. Some resolvers apply minimum or maximum limits that override the published TTL.
A record is changed but some clients keep reaching the old address until cached copies expire. The cause is usually a long TTL left in place at the time of the change, and the delay can last as long as the old TTL.
An administrator shortens the TTL on the day of a migration and expects an immediate effect. Resolvers that cached the record under the old value still hold it for up to the old TTL, so the reduction must be made at least one old TTL period before the change.
Very low values such as a few seconds raise query volume to authoritative servers and add lookup latency. During an authoritative outage, resolvers have little cached data to fall back on, so the failure reaches users quickly.
Records in the same set, such as multiple A records for one name, are expected to share one TTL. Mismatched values can cause resolvers to behave unpredictably and make troubleshooting harder, because the answers diverge as caches expire at different times.
Some caching resolvers apply minimum or maximum TTL limits, so observed behavior differs from the zone configuration. Engineers see old data persisting beyond the published TTL, or a record refreshing earlier than expected, and must check resolver settings as well as the zone.