Glossary

What is TTL?

TTL (time to live) is the number of seconds a DNS record may be cached by a resolver before it must be looked up again.

Every DNS record carries a TTL set by the zone owner. Resolvers and operating systems keep the answer for that long and do not ask again, which makes lookups fast and spares your name servers. The cost is delay: after you change a record, resolvers that cached the old value keep serving it until its TTL runs out. Typical values run from 60 seconds to 86,400 (one day).

A common practice before a planned move, such as changing a server’s IP address, is to lower the TTL a day ahead so the cutover takes minutes, then raise it again afterwards. The word also appears in IP packets, where it limits the number of hops, but that is a different counter.

Example

$ dig +noall +answer example.com A
example.com.   247  IN  A  203.0.113.10

(the TTL was set to 300; the resolver's copy has 247 seconds left)