Sub topic 13
Changing records and the propagation myth
This chapter assumes you know how recursive resolvers cache answers, what a TTL is, and how zones are delegated to authoritative servers. You should also be comfortable running dig.
Nothing is pushed
People say a DNS change "propagates" across the internet. That wording suggests your new record is sent out to servers around the world. DNS does not work that way.
When you edit a record, only the authoritative server changes. Resolvers elsewhere do not hear about it. They keep the old answer in their cache until its TTL runs out, then ask again and get the new one. What looks like propagation is many independent caches expiring at different moments.
The worst case is the old TTL
A resolver that cached the record one second before your change keeps it for a full TTL. So the longest wait is the TTL that was on the record before you changed it. The new TTL does not help, because no resolver has seen it yet.
You can watch this with dig. The number before the record class is the remaining TTL.
dig @8.8.8.8 example.com A +noall +answer
dig @ns1.example.com example.com A +noall +answerThe first command asks a public resolver and may show the old value with a counting-down TTL. The second asks the authoritative server directly and shows the true current value with the full TTL.
Planning a change
Lower the TTL ahead of time. The steps are:
- Lower the TTL on the record, for example from 86400 to 300 seconds.
- Wait at least the old TTL (here, 24 hours) so every cache has picked up the short one.
- Make the change.
- Confirm it on the authoritative servers, then on a public resolver.
- Raise the TTL again once you are confident.
The following table shows what each choice costs.
| TTL | Effect on changes | Effect on load |
|---|---|---|
| 60 to 300 s | Changes take effect in minutes | More queries reach your servers |
| 3600 s | Changes take up to an hour | Moderate |
| 86400 s | Changes take up to a day | Fewer queries, faster repeat lookups |
Other delays that are not TTL
Some waits do not come from the record's TTL.
- Negative caching. If a resolver cached "name does not exist" before you created the record, it can keep that failure for the SOA's negative caching value. In the example zone that is 300 seconds.
- NS changes at the parent. Changing nameservers means updating the delegation at the registrar. The TLD servers hold their NS records with their own TTLs, often 24 to 48 hours. The old servers should keep answering until that expires.
- Secondary servers. If you run secondaries, they copy the zone from the primary. An unincremented SOA serial means they never load your edit.
- Local caches. Browsers, operating systems and applications may cache separately. Some ignore the TTL.
Exercise
A record has a TTL of 86400 seconds. You change its address at 10:00 and lower the TTL to 300 at the same time. What is the latest time a resolver might still return the old address, and what should you have done differently?
Show answer
A resolver that cached the old record just before 10:00 can serve it until 10:00 the next day, because the old 86400-second TTL applies to the cached copy. You should have lowered the TTL to 300 at least 24 hours before the change, waited for the old TTL to expire everywhere, and only then changed the address.