How a lookup works, and why changes take time
Resolvers, caching and TTLs, and what people call DNS propagation.
The journey of a lookup
- Your device asks its recursive resolver (your router, your provider or a public one such as 8.8.8.8) for
www.example.com. - If the resolver does not have it cached, it asks a root server, which points to the
comservers. - A TLD server replies with the domain's authoritative nameservers.
- The resolver asks an authoritative nameserver, gets the answer and caches it.
- It returns the answer to your device, which may cache it as well.
TTL: how long to remember
Every record carries a TTL. Resolvers keep an answer for that many seconds before asking again. A TTL of 300 means five minutes, and 86400 means one day. Low TTLs make changes appear faster but increase queries. High TTLs reduce load.
Why "propagation" is really cache expiry
When you change a record, nothing is pushed to the world. The new answer is available immediately at the authoritative servers, but resolvers that cached the old one keep serving it until the TTL expires. Different resolvers cached at different moments, so people see different answers for a while.
Changing nameservers is slower
Moving a domain to another DNS provider changes its NS delegation at the TLD. Those records usually have long TTLs, commonly up to 48 hours for .com. During that time some resolvers still ask the old provider and some ask the new one. The safe procedure:
- Recreate every record at the new provider first, including email records.
- Only then change the nameservers at the registrar.
- Both providers serve identical answers during the transition, so nothing breaks.
- Remove the old zone after the old caches have expired.
Planned changes
A day or two before a move, lower the TTL of the affected records (for example to 300), make the change, then raise it again. Resolvers refresh quickly because they already hold short TTLs.
NoteA "negative" answer, such as a name that does not exist, is cached too, for a time set in the zone's SOA record.
Test yourself
Answer all the questions, then check them. Finish with every answer right to mark the lesson as done.