Skip to content

GlossaryDNS

TTL (time to live)

Definition

The TTL, or time to live, is the number of seconds a resolver is allowed to keep an answer in memory before asking again. It alone decides how long a DNS change takes to be visible everywhere.

Long in normal times, short before a switch

A long TTL takes load off the servers and speeds up browsing, since the answer is already in memory. A short TTL makes changes almost immediate but multiplies queries. So you live with a long TTL, drop to a short one for the duration of a migration, and put it back afterwards.

The trap is in the timing. Lowering the TTL on the day of the change does nothing: the value a resolver applies is the one it received on its last query. If that was twenty-four hours, it will serve the old answer for twenty-four hours, whatever new value you published in the meantime.

The same line at three moments

An address migration, seen from the zone file.

example.com. 86400 IN A 203.0.113.10 ; normal: 24 hours example.com. 300 IN A 203.0.113.10 ; 48 h before: down to 5 minutes example.com. 300 IN A 203.0.113.42 ; the day itself: the new address

Between the second line and the third, you have to let at least the old TTL elapse — twenty-four hours here — so that every resolver has had a chance to pick up the short value. That wait is the one you cannot compress; the next one you can.

The usual mistake

Publishing the new address, then reloading the page over and over, wondering why a colleague sees the new site and you do not. The original TTL has not elapsed everywhere yet, and no amount of extra fiddling makes it go faster.

How to avoid it: Drop the TTL forty-eight hours ahead, make the switch, verify, then put the TTL back. While you wait, query one of the domain's own name servers directly: that one always answers with the current value, with no cache in between.

Where the sources disagree: No standard recommends a duration: they define the mechanism, not the values. Common practice ranges from a few minutes to several days depending on what the record carries, and a host imposing a floor is within its rights.

Source: The TTL is part of every record's definition in RFC 1035; RFC 2181 clarifies how the largest values should be interpreted.

Related terms

Where to go next

Knowing the words is half the job

The other half is knowing which of your domains is about to become a problem. DomainVigil watches expiry, DNS, certificates and reputation, and tells you before your client does.

Start for free

Five domains free, forever. No card required.

Back to the glossary