Skip to content

What is DNS TTL?

Summary

How DNS TTL Works

DNS TTL (Time to Live) is the duration, expressed in seconds, for which a DNS resource record may normally be reused from cache before its source must be consulted again. It determines how long a cached answer remains fresh.

Caching allows DNS resolvers to reuse information obtained from authoritative DNS servers. This reduces repeated lookups, speeds up name resolution and lowers the query load on authoritative infrastructure. TTL provides a limit on that reuse so that cached information can be refreshed as records change.

The administrator of a DNS zone defines TTL values through the authoritative DNS configuration. A recursive DNS resolver receives the records, caches them and returns answers to clients using the remaining cache lifetime.

A zone may also define a default TTL that applies to records without an explicitly assigned value. This default is a configuration convenience: it does not require every record in the zone to use the same lifetime.

For example, the following address record has a TTL of 3,600 seconds:

app.example.com. 3600 IN A 192.0.2.10

This means the address can normally be reused from cache for one hour. After ten minutes, approximately 3,000 seconds remain. Answering another query from cache does not restart the countdown.

Once the TTL expires, a subsequent request normally requires refreshed information. Expiry does not delete the record from the authoritative server, and it does not cause all resolvers to refresh simultaneously. Different caches receive records at different times and therefore have different remaining lifetimes.

Cached records can pass through multiple DNS servers, such as a forwarding resolver and an upstream recursive resolver. Responses carry the remaining TTL, so each stage normally continues the existing countdown.

TTL values apply to resource record sets: records sharing the same name, class and type. Records within one set must have the same TTL, while separate sets can have different values. For example, a CNAME alias and its target’s IPv4 and IPv6 address records can have independent cache lifetimes.

What Is the Difference Between Short and Long DNS TTL?

A shorter TTL allows cached information to become eligible for refresh sooner. Short values are commonly associated with records used for frequently changing services or DNS-based traffic steering. More frequent refreshes increase query traffic and reliance on authoritative DNS availability.

A longer TTL allows greater reuse of cached information. This generally reduces lookup latency and authoritative query traffic, particularly when many clients repeatedly request the same information. Cached answers can also support continued resolution during a temporary authoritative DNS outage, while their cache lifetime remains valid.

There is no universal TTL value for every record. The choice depends on the required responsiveness to changes, the stability of the data and the role of caching in service performance and resilience.

How Does DNS TTL Affect DNS Propagation?

Changing a TTL affects subsequently retrieved answers. Copies already cached retain their existing countdown. Similarly, updating a record’s address does not immediately replace answers held by other resolvers. This difference between authoritative updates and cache expiry contributes to what is commonly called DNS propagation.

Operating systems and applications may also maintain their own caches. Their behavior can affect when an application performs another DNS lookup, so a record’s TTL alone does not describe the lifetime of every stored address or existing network connection.

How Does Negative DNS Caching Work?

DNS also caches negative answers, such as a response stating that a name does not exist. These answers have a separate cache lifetime derived from the zone’s Start of Authority (SOA) record. This is why creating a previously absent name does not immediately replace an earlier negative answer in a resolver’s cache.

FAQ

Talk to an expert