TTL(Time To Live)

Website and technology

Website and technology

TTL (Time To Live) determines how long data remains valid. For DNS and caches it concerns time; for IP packets it limits how far a packet can travel.

TTL stands for Time To Live. Its meaning depends on the application. In DNS, the TTL specifies in seconds how long a resolver may cache a record before it needs to request it again. A TTL of 3600 means one hour.

In a cache, TTL determines how long stored data is considered fresh. After that period, the application needs to refresh or revalidate it. The exact behaviour depends on the cache. An expired TTL does not always mean the data is deleted immediately.

In IPv4, TTL is a packet field that routers decrease when forwarding a packet. When it reaches zero, the packet is discarded. Despite the name, in practice it acts as a limit on the number of router hops. IPv6 calls the corresponding field Hop Limit.

A lower DNS TTL can help changes become visible sooner, but does not guarantee an immediate switch. A record already cached with a higher TTL may remain until that previous caching period ends.

Tip

First check whether the setting concerns DNS, an application cache or network packets. Lower a DNS TTL ahead of a change; existing cached records do not receive the new value retroactively.

← All terms