Expressvpn Glossary
DNS TTL
What is DNS TTL?
Domain Name System time to live (DNS TTL) is a field in a DNS resource record that specifies how long the record is cached. It defines the time interval that the record can be stored before it must be refreshed. The DNS TTL value is set as a numeric value in seconds and can be defined per record or as a default within a DNS zone.
How does a DNS TTL work?
Recursive DNS resolvers follow a defined caching process based on the TTL value attached to each record.
- Timer starts: When the resolver receives a DNS resource record, it reads the TTL value (e.g., 300 seconds) and starts the countdown. Some resolvers set a maximum TTL for caching positive answers or shorten it for operational or policy reasons.
- Countdown: If a matching query is received while the DNS TTL is greater than zero and hasn’t expired, the resolver can serve the cached record.
- Expiration: When the DNS TTL timer hits zero, the cached record’s validity ends and should be discarded.
- Renewal: After the DNS TTL interval passes, the next query causes the resolver to consult the authoritative server (source of the information) to obtain a fresh copy of the data.
Low vs. high DNS TTL values
Lower TTL values cause cached entries to expire sooner, so resolvers must query more frequently and notice updates more quickly. Higher TTL values allow resolvers to answer queries from cache more often, which reduces the number of calls made to the authoritative DNS infrastructure and lowers overall DNS traffic.
Why DNS TTL matters
TTL settings directly influence how DNS changes behave, how infrastructure performs, and how quickly issues can be corrected.
- Controls rollout timing: DNS TTLs help coordinate the timing of new updates to the DNS infrastructure. Longer TTLs offer more stable caching, while shorter TTLs allow faster propagation.
- Balances freshness and load: Shorter TTLs ensure records are always updated, while longer TTLs reduce the load on DNS servers.
- Reduces stale record risk: TTL ensures DNS servers don’t keep outdated information indefinitely.
Further reading
- DNS TTL: A detailed guide
- DNS cache: What it is, and how to clear it
- DNS record types explained: A complete guide for privacy