Sticky Banner Visual Mobile 3

Don't miss the Spring Deal: Save up to 78% before April 21.

Don't miss the Spring Deal: Save up to 78% before April 21. Claim now!

Claim Now!

Expressvpn Glossary

DNS TTL

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.

  1. 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.
  2. 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.
  3. Expiration: When the DNS TTL timer hits zero, the cached record’s validity ends and should be discarded.
  4. 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

Trade-offs between low and high TTL settings.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

FAQ

What is DNS TTL used for?

Domain Name System time to live (DNS TTL) is used to define how long a DNS record may be cached before the source should be consulted again. It tells DNS resolvers how long to cache information before expiring and discarding it, helping prevent outdated data from being kept too long.

What should the TTL for DNS be?

There’s no single correct Domain Name System time to live (DNS TTL) value, as it’s a trade-off between responsiveness to change and performance. Shorter TTLs are good for rapid updates and longer ones for stable records.

Can I set DNS TTL to 0?

Yes, a Domain Name System time to live (DNS TTL) of 0 means the record shouldn’t be cached beyond the current transaction. However, configuring TTL to zero is generally discouraged because it can significantly affect DNS server performance.

How do I check TTL on a DNS server?

Domain Name System (DNS) tools and management consoles display time to live (TTL) alongside each record. For example, DNS query outputs include a TTL column, and DNS service dashboards list the TTL value directly in the record details.
Get Started