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
| TTL | Seconds | Good for |
|---|---|---|
| 1 minute to 5 minutes | 60 to 300 | Just before and after a migration, failover records, anything that must move quickly |
| 1 hour | 3600 | Everyday records. A sensible default |
| 1 day | 86400 | Records 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
- Note the current TTL (say 3600).
- Lower it to 300 and wait at least the old TTL (one hour here) so every cache holds the short version.
- Change the record. Within about five minutes nearly everyone sees the new value.
- Check with the DNS propagation checker.
- 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.