DNS TTL explained: how long DNS changes really take

TTL controls how long resolvers cache your DNS records. How it works, what value to pick, how to lower it before a migration, and why changes still seem slow.

· 6 min read · By the Spot Downtime team

You change an A record, reload the site, and still see the old server. Or half your users reach the new host while the rest are stuck on the old one. Nothing is broken. DNS is cached, and the setting that controls how long is the TTL.

What TTL is

TTL (time to live) is a number of seconds attached to each DNS record. When a resolver, such as your ISP's or 8.8.8.8, looks up your record, it keeps the answer for that many seconds before asking again. A TTL of 3600 means up to an hour of serving the cached value.

There's no way to push an update to every resolver. The old value simply expires everywhere, at different times, depending on when each resolver last cached it. That's why “propagation” looks uneven: it's really cache expiry.

See the TTL of a record

Ask your authoritative name server directly to see the TTL you configured:

dig +noall +answer example.com A @ns1.yourdns.com
example.com.   3600   IN   A   203.0.113.10

The second column is the TTL. Ask a public resolver instead and the number counts down each time you repeat the query:

dig +noall +answer example.com A @8.8.8.8

If that number is lower than your configured TTL, the resolver cached the answer earlier and the value will expire after the remaining seconds. The DNS lookup tool shows the same data without needing a terminal.

Choosing a TTL

  • 300 seconds (5 minutes): good for records you may need to move quickly, and for failover setups.
  • 3600 seconds (1 hour): a sensible default for most records.
  • 86400 seconds (24 hours): fine for records that almost never change, such as MX and TXT records for verification.

Lower TTLs mean changes spread faster but resolvers query your name servers more often, which adds a little latency for visitors on a cold cache and more load on your DNS provider. Very low values like 30 seconds rarely help, because some resolvers enforce their own minimum.

How to migrate with minimal downtime

The trick is that lowering the TTL is itself subject to the old TTL. If your record has a 24-hour TTL, resolvers may hold it for another 24 hours after you lower it. So prepare ahead:

  1. At least one old TTL before the change, lower the TTL on the records you'll change to 300.
  2. Wait until the old TTL has fully elapsed, so every resolver has picked up the short one.
  3. Make the change: point the A, AAAA or CNAME record at the new server.
  4. Check that the new server serves the site correctly. Keep the old one running until traffic has moved.
  5. Once everything is stable, raise the TTL back to 3600 or higher.

Keep the old server alive

Even with a short TTL, some visitors will hit the old address for a while. Leave the old server running, ideally serving the same content or redirecting, for at least as long as the old TTL.

Negative caching: why a new record may not appear

Resolvers also cache “this record does not exist”. If someone looked up www.example.com before you created it, that miss can be cached for the duration set in your zone's SOA record (the last field, the negative caching TTL). This is why a brand new hostname sometimes fails for a while on one network and works on another, and why DNS_PROBE_FINISHED_NXDOMAIN can linger after you fix the record.

Why changes still seem slow

Caches that ignore or extend TTL

Most large resolvers honor TTL, but some apply minimums, and software on your side may cache on its own. Common places:

  • Browsers and operating systems keep a short local cache. Restart the browser or flush the OS cache.
  • Long-running apps, such as some Java and Node.js services, may resolve a hostname once and reuse the address until restart.
  • Load balancers and proxies like nginx can resolve an upstream hostname once at startup unless configured otherwise.

Nameserver changes are different

Changing the name servers for a domain is not governed by your record TTLs. It depends on the NS record TTL at the registry, which is often 24 to 48 hours and not something you can shorten. Lower your record TTLs before moving DNS providers, but expect the switch itself to take longer.

Check whether a change has spread

Query several resolvers and compare. If most return the new value and a few return the old one, you're waiting on cache expiry and there's nothing to fix.

DNS propagation checkerSee what 12 public DNS resolvers return for a record, to tell whether a change has reached everyone.

After a migration, keep monitoring the site. A monitor that checks from several locations will catch the case where some regions still reach a broken old server while yours works.

Get new guides by email

Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.

Unsubscribe from any email with one click. See our privacy policy.

Keep reading