What Is TTL (Time to Live)? DNS, CDN and Cache TTL Explained

<span id="hs_cos_wrapper_name" class="hs_cos_wrapper hs_cos_wrapper_meta_field hs_cos_wrapper_type_text" style="" data-hs-cos-general-type="meta_field" data-hs-cos-type="text" >What Is TTL (Time to Live)? DNS, CDN and Cache TTL Explained</span>

Time to live (TTL) is a limit attached to data that sets how long, or how far, it may be cached or forwarded before it must be discarded or refreshed. DNS records and HTTP caches count TTL in seconds. IP packets count it in router hops, capped at 255 by an 8-bit header field.

This guide answers what is TTL for DNS, CDN caches, IP and databases. It then gives recommended values, a cutover timeline with the arithmetic, and a failure-mode checklist.

As of 2026, under RFC 1035 a DNS TTL is a 32-bit count of seconds. A record published with TTL 300 may be cached by recursive resolvers for at most five minutes before they must query the authoritative server again. That cache lifetime, not a propagation process, sets how fast a DNS change reaches users.

How time to live works in IP, DNS and caches

Every TTL has three properties to pin down before you tune it: the unit (hops or seconds), who sets the starting value, and who enforces expiry. Most production confusion comes from assuming that whoever publishes a TTL also controls when the data disappears. It rarely does.

IP TTL and IPv6 Hop Limit: a hop counter, not a clock

In IPv4, every router that forwards a packet decrements TTL by at least one. At zero, the router discards the packet and usually returns ICMP Time Exceeded (type 11). IPv6 renamed the field Hop Limit and kept the same semantics. The mechanism exists to kill routing loops. Traceroute exploits it by sending probes with TTL 1, 2, 3 and so on, then recording which router answers each one.

Initial values reveal operating-system defaults. Linux and macOS start at 64, Windows at 128, and many routers and appliances at 255. A ping reply showing TTL 52 most likely came from a Linux host 12 hops away. Tunnels complicate the picture: GRE and MPLS can copy or reset the inner TTL, so some paths look shorter in traceroute than they really are.

DNS TTL: how resolvers count down a cached answer

DNS TTL is the number of seconds a recursive resolver may cache a record after fetching it from the authoritative server. The resolver counts down from the published value and returns the remaining seconds to clients. Two users querying the same resolver a minute apart therefore see TTLs 60 seconds apart. At zero, the next query triggers a fresh lookup.

TTL applies per record set: RFC 2181 requires every record in an RRset to share one TTL. Negative answers are cached too. Under RFC 2308, an NXDOMAIN is cached for the lesser of the SOA record's TTL and its MINIMUM field.

Resolver policy then bends the published value:

  • Unbound caps cached TTLs at one day by default, and BIND caps them at one week.
  • Some resolvers enforce minimum floors.
  • Prefetching refreshes popular records before they expire.
  • Serve-stale (RFC 8767) returns expired answers with a 30-second TTL when the authoritative servers are unreachable.

Below the resolver, clients add their own layers. Operating-system stub caches and the JVM address cache (30 seconds by default in current releases) both sit there. So do HTTP connection pools, which keep sockets open to an old IP regardless of any DNS TTL.

CDN and HTTP cache TTL: freshness lifetime

For HTTP, TTL is the freshness lifetime defined in RFC 9111. A shared cache takes it from s-maxage first, then max-age, then Expires. If none of these is present, caches may apply heuristic freshness, commonly 10% of the time since Last-Modified.

The Age header records how long an object has already sat in upstream caches, and downstream caches subtract it. A browser that receives max-age=3600 with Age: 3000 treats the object as fresh for only 600 more seconds.

CDNs split this into an edge TTL (how long the CDN keeps the object) and a browser TTL (what it forwards in Cache-Control), and most let you override origin headers. The stale-while-revalidate and stale-if-error directives (RFC 5861) extend serving past expiry. They deliberately trade freshness for origin protection.

Long edge TTLs are only safe when you can evict on demand. On BlazingCDN, purge, cache warm-up through the API and origin shield are included on every plan, and custom cache rules are set up together with an engineer. A long edge TTL therefore does not trap a bad deploy.

Database and cache-store TTL

Key-value stores and databases attach a TTL to an item when it is written. Redis expires keys lazily on access and through an active sampling sweep, so memory is reclaimed gradually.

DynamoDB removes expired items in a background process that vendor documentation says can take days. Until then, expired items still appear in reads, so queries must filter on the expiry attribute. Cassandra turns expired cells into tombstones that persist for gc_grace_seconds (ten days by default) and can slow reads.

TTL suits sessions, rate-limit counters, temporary tokens and presence data. It fits poorly where deletion must follow audited legal or contractual procedures.

TTL meaning by layer: what is TTL compared side by side

LayerUnitSet byEnforced byAt expiry
IPv4 TTL, IPv6 Hop LimitRouter hops, max 255Sending host OSEach routerPacket discarded, ICMP Time Exceeded
DNSSecondsAuthoritative zoneRecursive resolvers, stub cachesRe-query, or serve stale if allowed
HTTP and CDNSecondsOrigin headers or CDN rulesEdge, shield, browserRevalidate or refetch
Database and key-value storeSeconds or timestampApplication at write timeStorage engineHidden, physically deleted later

In every layer, the party that sets the TTL is not the party that enforces it, so the effective TTL must be measured rather than read from config.

TTL vs. Hop Limit: these are the same field under two names. IPv4 calls it TTL and IPv6 calls it Hop Limit, and both count hops, not time.

DNS TTL vs. propagation: DNS has no push mechanism. "Propagation" is simply the time it takes cached copies to expire, bounded by the old TTL plus any resolver overrides.

Cache TTL vs. max-age: max-age is one header that sets a TTL. A CDN may override it with s-maxage, an edge rule or a forced minimum.

Recommended TTL values for DNS records and CDN caches

The values below are this blog's suggested starting points, not universal rules. Tune them against your own change frequency and query budget.

Record or objectSteady stateChange windowReason
A and AAAA for apex and www3,600 s60 to 300 sBalances resolver load and agility
Health-checked failover records30 to 60 s30 sFailover speed is bounded by TTL
CNAME to a CDN hostname3,600 s300 sThe CDN's own records handle steering
MX and TXT (SPF, DKIM)3,600 to 86,400 s300 sRarely changes; mail retries tolerate delay
NS and delegation86,400 sPlan days aheadThe parent zone's TTL (172,800 s in .com) governs cached delegation
SOA MINIMUM (negative caching)300 to 3,600 s60 sAvoids hours of NXDOMAIN for new names
Fingerprinted static assets, VOD segmentsmax-age=31536000, immutableNot neededThe URL changes when the content does
HTML documentss-maxage 60 to 300, max-age 0Purge on deployFreshness with origin protection
Live HLS or DASH playlistsAbout half the segment durationNot neededA stale playlist stalls players
API responses0 to 60 s plus stale-while-revalidatePer endpointCorrectness varies by route

Short TTLs belong only on names and objects that change without notice; anything addressable by a versioned name should carry the longest TTL its layer allows.

What a short DNS TTL costs in query load

A resolver holding a popular record refreshes it about 86,400 ÷ TTL times a day. At TTL 3,600 that is 24 upstream queries per resolver per day. At TTL 60 it is 1,440, a 60x increase.

With 50,000 distinct resolvers asking for one hostname, authoritative load rises from 1.2 million to 72 million queries a day, which matters on DNS providers that bill per million queries. Users pay too: every expiry forces one uncached lookup, typically 20 to 100 ms, sometimes more.

How to lower DNS TTL before a cutover

Lowering a TTL only affects copies fetched after the change. Records already cached under the old, longer value stay cached until that value runs out. This worked timeline assumes a current TTL of 86,400 seconds:

  1. T minus 48 hours: lower the TTL to 300. The window must exceed the old TTL, because a resolver that fetched the record just before the change can hold it for a full day.
  2. T minus 1 hour: query the authoritative server and several large public resolvers. Every remaining TTL should be at or below 300.
  3. T: change the record. The expected worst-case lag is 300 seconds, plus any resolver floors and serve-stale windows.
  4. T to T plus 48 hours: keep the old target serving and logging, and drain long-lived connections explicitly.
  5. T plus 24 to 48 hours: raise the TTL back to 3,600.

A useful rule of thumb: full cutover time equals the new TTL, plus the longest resolver override, plus the longest client connection lifetime. The last term is usually the largest, and DNS cannot shorten it.

TTL failure modes: what breaks and how to confirm it

Traffic still reaches the old origin hours after a DNS change

The cause is usually a TTL lowered too late, or clients that ignore DNS entirely, such as pooled HTTP/2 connections or long-running JVM processes. To confirm, check connection age and client IPs in the old origin's logs. If requests arrive on connections older than the cutover, DNS is not the problem.

A new hostname returns NXDOMAIN for hours

Someone queried the name before it existed, and resolvers cached the negative answer under a large SOA MINIMUM. To confirm, read the SOA record. A MINIMUM of 86,400 explains a day of failures.

The CDN serves content older than max-age allows

TTLs stack when an edge or shield resets the Age header instead of passing it through, so each tier restarts the clock. Stacking also happens when stale-if-error is quietly masking an origin outage. To confirm, compare Age and the cache-status header across repeated requests, and check origin error rates during the same window.

Packets die mid-path or traceroute shows repeating hops

A routing loop exhausts the TTL, or a tunnel resets it. To confirm, look for ICMP type 11 in a packet capture and for the same hop pair repeating in traceroute output.

Expired database items reappear

Physical deletion lags logical expiry. To confirm, add an expiry-timestamp filter to the query and see whether the phantom rows vanish.

Verify on your own stack by running dig against a public resolver twice, a minute apart, and confirming the TTL column dropped by about 60. Then dump edge response headers and read Cache-Control, Age and the cache-status header together.

FAQ: TTL meaning, DNS TTL and time to live

What does TTL mean in networking?

TTL means time to live, a limit on how long or how far data may persist before it is discarded or refreshed. In IP packets it counts router hops, up to 255. In DNS records and HTTP caches it counts seconds. The unit and the enforcing system differ by layer, so always identify which layer a TTL value belongs to.

What is a good DNS TTL for an A record?

For most production A and AAAA records, 3,600 seconds is a sound default. Use 30 to 60 seconds only on health-checked failover records, and drop to 60 to 300 seconds temporarily before a planned migration. Very short TTLs multiply authoritative query volume (TTL 60 means 60 times the refreshes of TTL 3,600) and add uncached lookups for users.

Does lowering DNS TTL make propagation faster?

Lowering DNS TTL speeds up future changes, not the current one. Resolvers that cached a record under the old TTL keep it until that value expires, so the reduction must happen at least one full old TTL before the change. Resolver minimum floors, serve-stale policies and long-lived client connections can still extend the transition.

Why does ping show TTL 64 or 128?

Those numbers are the remaining IP TTL in the reply packet, which reflects the sender's initial value minus the hops travelled. Linux and macOS start at 64, Windows at 128 and many network devices at 255. A reply showing TTL 116 most likely came from a Windows host about 12 router hops away.

Is CDN cache TTL the same as DNS TTL?

No. CDN cache TTL controls how long an edge keeps an object, using Cache-Control headers or CDN rules. DNS TTL controls how long resolvers cache the address of the CDN hostname. The two are independent, so a fast DNS failover does nothing for stale cached content, and a purge does nothing for a stale DNS answer.

Audit your TTLs before the next cutover

This week, export every record in your zones and flag any TTL above 3,600 on names that might change, along with any SOA MINIMUM above 3,600. Then sample 20 high-traffic URLs at the edge and record Cache-Control, Age and cache status for each. Mismatches between intended and observed TTLs are your failure modes in waiting, and fixing them costs nothing.

If the audit shows your heavy static traffic needs long edge TTLs with reliable purge, the BlazingCDN Anycast CDN page describes pull caching with origin shield, request coalescing and API purge included on every plan.

Heavy traffic.
Light bill.

The CDN for video and large traffic