What is TTL in DNS?

Time to live controls how long a DNS answer is cached. What values mean, sensible defaults, and how to use TTL to plan changes.

ExplainerIntermediate2 min readUpdated

TTL — time to live — is a number of seconds attached to every DNS record. It tells resolvers how long they may cache the answer before asking again.

Common values

TTLDurationTypical use
3005 minutesJust before and during a planned change
36001 hourRecords that change occasionally
144004 hoursA common hosting default
8640024 hoursRecords that almost never change

The trade-off

  • Low TTL: changes are seen quickly, but resolvers ask more often.
  • High TTL: fewer lookups and slightly faster repeat visits, but mistakes take longer to undo.

For a small site, the difference in load or speed is negligible. What matters is how fast you’ll need changes to take effect.

Using TTL to plan a change

TTL affects the next change, not the current one: a resolver that already cached a record for 24 hours keeps it for 24 hours.

  1. A day or more before a move, lower the TTL of the records you’ll change to 300.
  2. Wait for the old TTL to pass.
  3. Make the change. It’s seen within about five minutes.
  4. Once everything’s confirmed, raise the TTL again.

Nameserver changes are different

TTLs for the nameserver records themselves are set by the domain’s registry, not by you, which is why nameserver switches can take longer than record edits. Why DNS changes take time (DNS propagation)

Popular

Tip: press / to search from any pageSee all results