Glossary / DNS basics

TTL (time to live)

TTL, short for time to live, is the number of seconds a DNS resolver may keep a record in its cache before it must ask again. A TTL of 3600 means one hour. Short TTLs make changes spread faster, while long TTLs cut lookups and keep answers steady.

Copy the syntax

TTL in a zone file

www.example.com. 300 IN A 192.0.2.10

The second field, 300, is the TTL in seconds.

See the TTL a resolver is counting down

dig www.example.com A +noall +answer

Run it twice; the number drops as the cache ages.

Have a name in mind?

.com $24.99 first year, renews at $24.99/yr. Other endings: not on sale yet.

In plain English

TTL is how long other computers remember a DNS answer before they check for a new one.

What to do

  • Use about an hour for records that rarely change.
  • Lower it to five minutes a day before a planned change.
  • Raise it again once the change has settled.
How TTL controls cachingTTL lifecycle: a resolver caches an answer, counts the TTL down, then fetches the record again when it expires.1 · AnswerA 192.0.2.10, TTL 3600resolver caches it2 · Cachedcounts downsame answer reused3 · ExpiredTTL hits 0resolver asks again
Until the TTL runs out, the resolver keeps serving the old answer, even if you changed the record.
Defined in
RFC 1035, section 3.2.1Source: RFC 1035
Unit
Seconds, a 32-bit valueSource: RFC 2181
Negative caching
Set by the SOA record, RFC 2308Source: RFC 2308
Why do DNS changes take time?

Resolvers that already cached a record keep using it until its TTL runs out. Change an A record with a one-hour TTL and some visitors reach the old server for up to an hour.

Nothing you do at your DNS host can clear other people’s caches early.

What TTL should I use?

An hour (3600) is a sensible default for records that rarely change. Drop to 300 seconds a day before a planned move, make the change, then raise it again once things settle.

Common TTL values

Typical choices; any value in seconds is valid.
TTLEqualsGood for
3005 minutesRecords you are about to change
36001 hourMost records
864001 dayNS and records that never move

Questions about TTL (time to live)

Does a lower TTL slow my site down?

Barely. Resolvers look the name up more often, which adds a few milliseconds on some visits. The cost is small next to the benefit when you need a change to spread quickly.

Can I set TTL to zero?

RFC 1035 allows a TTL of zero, meaning do not cache, but many resolvers enforce a minimum anyway. Use a short value such as 60 or 300 instead.

Why did my change show up for some people and not others?

Each resolver cached the old record at a different moment, so each one expires at a different time. Within one TTL of your change, everyone sees the new answer.

Does flushing DNS reset the TTL?

Flushing clears your own computer’s cache only. Your ISP’s or a public resolver’s cache keeps counting down its own TTL.

Put it to work on your own domain

See the first-year and renewal price before you pay.

.com first year$24.99, renews $24.99Check a domain
↑