What TTL is
Time To Live (TTL) is a limit that tells systems how long to keep a piece of data before treating it as stale. The term appears in two main networking contexts: DNS caching and IP packet routing. In both, TTL prevents data from lingering forever.
TTL in DNS
Every DNS record carries a TTL, expressed in seconds, that tells resolvers how long they may cache the answer:
- A TTL of
3600lets a resolver reuse the answer for one hour. - A short TTL like
300means resolvers recheck every five minutes.
Lowering the TTL before a planned change makes the update propagate faster, because caches expire sooner. Raising it reduces lookup load when records are stable.
TTL in IP packets
In an IP packet, TTL is a counter that each router decrements by one as the packet is forwarded. When it reaches zero, the packet is dropped and an error is returned. This stops packets from looping endlessly through misconfigured routes, and tools like traceroute exploit it to map the path to a destination.
Why it matters
TTL balances freshness against efficiency. Too long, and stale answers persist after a change; too short, and systems do extra work. You can observe DNS TTL values with the WhatIP dns-lookup tool.