Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

It Is Caching, Not Spreading

When you edit a record, your authoritative nameservers serve the new value within seconds or minutes. What lags behind are the recursive resolvers: the DNS servers of internet providers, public resolvers, and the cache on each computer. Each of them stored the old answer the last time someone asked and keeps it until its time to live (TTL) expires. Until then they answer from cache without asking your nameservers. The lookup chain is explained in what is DNS.

That is why one person sees the new site and another the old one: their resolvers cached the record at different times.

How Long Does It Take?

ChangeUsual wait
New name, never looked upMinutes
Edited A, CNAME, or MX recordUp to the old TTL
New nameservers at the registrarUp to 48 hours

The old TTL is what counts: a resolver that cached a record with a TTL of 86400 seconds may keep it for a full day, whatever TTL you set now.

Lower the TTL Before a Change

  1. At least one old TTL period before the move, lower the record's TTL, for example to 300 seconds.
  2. Wait until the old TTL has passed, so every cache holds the short one.
  3. Change the record. Caches now pick up the new value within about five minutes.
  4. Once everything works, raise the TTL again, for example to 3600 seconds.

Keep the old server running for a while after the change. Some resolvers apply a minimum or maximum TTL of their own instead of yours, so a few visitors arrive late either way.

Why Nameserver Changes Take Longer

When you switch to new nameservers, the registry changes the delegation in the parent zone, such as .com. The NS records in a parent zone often carry a long TTL, up to a day or two, and resolvers that cached the old delegation keep asking the old nameservers until it expires. Copy every record to the new DNS host before you switch, and keep the old zone identical and online for at least two days.

Check the Authoritative Answer

Asking the nameservers that hold the zone bypasses every cache. Find them first:

dig NS example.com +short

Then query one of them directly by its address. Its answer is the current truth:

dig example.com A @203.0.113.53

The flags line includes aa, authoritative answer, when the reply comes from a server that holds the zone. +trace follows the chain from the root servers down without a resolver's cache and shows which nameservers the parent zone hands out:

dig example.com +trace

The dig command guide explains the rest of the output.

Check What Resolvers See

Query a recursive resolver to see what its users get:

dig example.com A @resolver_ip +noall +answer
example.com.    2715    IN    A    203.0.113.10

The number after the name is the TTL left in that cache, which tells you how long the old value can stay. Without @, dig asks the resolver configured on the machine you run it on. Web-based propagation checkers send the same query from many locations at once; a mix of old and new answers there is normal until the TTL runs out.

Negative Caching

If someone looked up a name before you created it, resolvers cached the "does not exist" answer, NXDOMAIN. The zone's SOA record sets how long: the lower of the SOA record's own TTL and its last field, the minimum. Check it with dig SOA example.com, and avoid testing a new name before its record exists. The browser error for a missing name is covered in DNS_PROBE_FINISHED_NXDOMAIN.

Flush Your Own Cache

You cannot clear other people's resolvers, but you can clear your own: the cache on your computer, your browser, and the server's local resolver. See how to flush the DNS cache in Linux. To test a new server before the change is visible, point the name at its address in your own hosts file for a while, as shown in how to edit the hosts file, and remove the line afterward.

Was this answer helpful?
Loading...