Guides · DNS · Updated

What is DNS TTL, and what value should you use?

TTL (time to live) is a number of seconds attached to every DNS record. It tells resolvers how long they may keep the answer before asking again. Use 3600 for most records, 300 while you are about to change something, and 86400 for records that rarely move.

See the TTL of a record

Look up a domain's addresses together with their TTL:

With dig, the number after the name is the TTL. Query the same name twice and it counts down, because it shows what is left in the resolver's cache:

$ dig example.com A +noall +answer
example.com.    3600    IN    A    203.0.113.10

What TTL controls

When a resolver fetches a record from the authoritative server, it stores it and counts down from the TTL. Until it reaches zero, the resolver answers from memory and never asks the authoritative server. So the TTL is the longest time any resolver can keep serving an old value after you change it. That's the wait described in how long DNS propagation takes.

Which value to use

TTLSecondsGood for
1 minute to 5 minutes60 to 300Just before and after a migration, failover records, anything that must move quickly
1 hour3600Everyday records. A sensible default
1 day86400Records that almost never change: MX, NS, long-lived TXT records

The trade-off

  • Low TTL: changes spread fast, but resolvers ask your DNS host more often, so each visitor has a slightly higher chance of waiting for a fresh lookup. It can also raise the bill on DNS hosts that charge per query.
  • High TTL: fewer queries and faster repeat lookups, but a mistake or an outage lives on in caches for as long as the TTL says.

A safe way to change a record

  1. Note the current TTL (say 3600).
  2. Lower it to 300 and wait at least the old TTL (one hour here) so every cache holds the short version.
  3. Change the record. Within about five minutes nearly everyone sees the new value.
  4. Check with the DNS propagation checker.
  5. Once it works, raise the TTL back to a normal value.

Things to know

  • Each record set has its own TTL, so the A record and the MX record of a domain can differ.
  • Resolvers also cache "this name doesn't exist" answers. That time comes from the SOA record's last field, the negative-caching TTL, and decides how long a brand-new record stays invisible after an earlier failed lookup. See the SOA record page.
  • Some resolvers and devices apply their own floor or ceiling, so treat the TTL as an upper bound, not an exact timer.
  • Nameserver (NS) delegation at the registry has its own long TTL that you can't change from your DNS host.

Related: DNS record types explained.

Frequently asked questions

What does TTL stand for in DNS?

Time to live. It is the number of seconds a resolver may keep a DNS answer before asking again.

What is a good TTL for a DNS record?

3600 seconds (one hour) suits most records. Use 300 seconds while you are preparing a change, and 86400 (one day) for records that almost never move.

Does a lower TTL make my site slower?

Only slightly. Resolvers ask the authoritative server more often, which adds one extra lookup each time a cached answer expires. For a busy site this is rarely noticeable; for DNS providers that bill per query it can add cost.

Does the TTL I set apply everywhere?

Mostly. A few resolvers and devices enforce their own minimum or maximum, and browsers and operating systems keep short caches of their own. Treat the TTL as an upper bound you can rely on, not an exact timer.

How do I see a record's TTL?

Run the Domain to IP lookup, which shows the TTL of each address. With dig, the second column of the answer is the TTL left in that resolver's cache.