Networking Fundamentals

DNS Explained: How DNS Caching and TTL Actually Control Propagation Time

DNS TTL and caching explained: how resolution really works, why propagation is just cache expiry, and the exact TTL timing that keeps a migration downtime-free.

Long Nguyen Avatar

Long Nguyen

Fullstack Developer · AI Engineer · Researcher

• • 3 min read •

What DNS Caching and TTL Actually Control

“DNS propagation” is not a real mechanism — there is no global sync event that pushes your DNS change to every server on the internet. What actually happens is simpler and more mechanical: every resolver that has ever looked up your record cached the answer, and it will keep serving that cached answer until a countdown called the TTL (time to live) reaches zero. “Propagation time” is really just the slowest cache on the slowest resolver finishing its countdown.

That distinction matters operationally: you cannot speed up propagation once a change is live. You can only control it in advance, by shortening the TTL before you make the change. The rest of this guide covers DNS resolution and record types for context, then goes deep on the caching/TTL mechanics — including the one timing mistake that causes most failed cutovers.

How DNS Name Resolution Works, Step by Step

DNS is a distributed, hierarchical database. No single server holds every record; instead, a resolver (often run by your ISP, OS, or a public service like Cloudflare or Google) walks a chain of delegated servers until it reaches the one authoritative for your domain.

Step Who does it What happens
1 Client / stub resolver Your device asks its configured recursive resolver to look up www.example.com.
2 Recursive resolver Checks its own cache first. If empty, it queries a root server to find out who handles .com.
3 Root → TLD server The TLD server for .com returns the name servers delegated for example.com.
4 Authoritative server The domain's own name server returns the actual record (A, AAAA, CNAME, MX, etc.).
5 Recursive resolver Returns the answer to the client and caches it for the record's TTL — this cached copy is what everything below this guide is about.

A recursive query means the resolver takes on the work of chasing the full chain and returns one final answer; an iterative query is what happens between servers along that chain — each one either answers or refers to the next server closer to the source. This is the practical meaning of “recursive vs authoritative DNS”: recursive resolvers do the lookup and cache work; authoritative servers hold the source of truth.

DNS Record Types at a Glance

Each record type serves a different purpose in the zone. Getting the wrong type — or a stray record at the zone apex — is a common source of both outages and TTL confusion during migrations.

Record Purpose Notes
A Hostname → IPv4 address The most commonly changed record during a migration or IP change.
AAAA Hostname → IPv6 address Keep in sync with the A record if you serve dual-stack traffic.
CNAME Alias one hostname to another Cannot coexist with other records on the same name; avoid long CNAME chains, each hop adds a lookup.
MX Mail exchanger + priority Lower priority number is tried first. Never rely on the A-record mail fallback in production.
NS Which servers are authoritative for the zone Delegation lives here; a wrong NS record breaks resolution even if every other record is correct.
SOA Zone metadata: primary server, serial, timers Its MINIMUM field sets negative-caching TTL — see below, this is the record most guides skip.

DNS Caching and TTL Explained

Every DNS answer a resolver returns carries a TTL, expressed in seconds, set by the authoritative server. The resolver stores the answer and keeps handing it out — without re-querying — until that TTL hits zero. A 3600-second TTL means a resolver that cached your record at 9:00 will keep serving that exact answer until 10:00, even if you change the record at 9:05.

This is deliberate and useful: it's what keeps DNS fast and keeps the ~13 root server clusters from being hit on every single web request on Earth. The trade-off is direct: longer TTL = fewer authoritative queries and faster average lookups, but slower to reflect a change; shorter TTL = near-instant changes, but more query volume against your authoritative servers.

Why a TTL Change Doesn't Take Effect Immediately

This is the part most DNS explainers get vague on, and it's the single highest-leverage fact for anyone planning a cutover: a TTL change is itself subject to the old TTL.

If your A record currently has a 14400-second (4-hour) TTL and you edit it down to 300 seconds, that edit doesn't take effect everywhere instantly — resolvers that already cached the record at the old 4-hour TTL keep it for up to 4 more hours, TTL value and all. Only after that old cache entry expires and the resolver re-queries do they pick up the new, shorter TTL. Lowering TTL on the morning of a migration accomplishes almost nothing; the caches you need to shrink are still running out the old clock.

The fix is timing, not tooling: lower the TTL 24–48 hours before the actual record change, then wait out that window. By the time you make the real change, every resolver that matters is already operating on the short TTL, and the change itself propagates in minutes instead of hours. Cloudflare's own migration guidance follows this exact sequence — reduce TTLs first, wait out the old TTL window, then cut over.

DNS Negative Caching: Why a Fixed Record Can Take Even Longer to Appear

Positive answers (a record that exists) aren't the only thing resolvers cache. When a query returns NXDOMAIN (no such name) or NODATA (name exists, but not that record type), well-behaved resolvers cache that negative result too — this is negative caching, and it has its own TTL, separate from your record TTLs.

The negative-cache TTL is taken from the MINIMUM field of the zone's SOA record. Per RFC 2308, the specification governing this behavior, an authoritative server includes the SOA record in a negative response specifically so resolvers know how long they're allowed to remember “that record doesn't exist.” In practice this means: if you create a subdomain that a resolver already cached as non-existent, it can stay invisible to that resolver until the SOA MINIMUM expires — independent of whatever TTL you just set on the new record itself. Most zones default their SOA MINIMUM to a value between 300 and 3600 seconds; if you're pre-launching a new subdomain, lowering that field in advance (alongside your usual record TTLs) closes this gap.

DNS TTL Checklist Before a Migration or Cutover

  1. T-48h: inventory every record that will change — A, AAAA, MX, and any TXT records for SPF/DKIM/DMARC — and note their current TTL with dig +noall +answer +ttl.
  2. T-48h: lower TTL on each of those records to 300s. Do not touch NS records unless you're also changing name servers.
  3. T-24h: re-query from at least two public resolvers to confirm the short TTL has actually propagated before you rely on it.
  4. T-0: make the real record change (new IP, new mail host, etc.).
  5. T-0 to T+30min: verify from multiple resolvers and networks that the new value is live everywhere you can check.
  6. After stabilization: raise TTL back to your normal operating value (see table above) to reduce query load.
  7. If DNSSEC is enabled: handle the DS record at the registrar first — delete or update it, then wait out the parent zone's DS TTL (often up to 1.5× that TTL) before changing name servers, or resolvers can end up validating against a key that no longer matches.

This checklist matters just as much for a store or site platform migration as it does for a plain hosting move — a dropped MX record or a TTL nobody lowered is exactly the kind of thing Netalith's ecommerce and store migration work is built to catch before it costs a sale.

Troubleshooting DNS Propagation and Caching Issues

When a change “isn't showing up,” the fix is almost never on your own machine — it's whichever resolver a given visitor happens to be using.

dig +noall +answer +ttl A example.com\ndig +noall +answer +ttl A example.com @1.1.1.1\ndig +noall +answer +ttl A example.com @8.8.8.8\ndig +noall +answer +ttl NS example.com
  • Check multiple public resolvers (1.1.1.1, 8.8.8.8, 9.9.9.9) — if some show the new answer and others don't, you're simply waiting out different cache ages, not looking at a broken change.
  • Flushing your own OS/browser DNS cache does not affect anyone else's resolver. It only fixes the case where your specific machine cached a stale answer earlier; it has zero effect on “propagation” everywhere else.
  • Query the authoritative server directly (dig example.com A @ns1.yourprovider.com) to confirm the zone itself is correct, bypassing every cache in between.
  • Missing NS delegation or glue records can look identical to a caching delay but are a configuration bug, not a timing issue — verify delegation with dig +noall +answer example.com NS before assuming it's “just propagation.”

DNS Best Practices for Production

  • Redundant authoritative servers across separate networks, so one outage doesn't take your zone offline.
  • Automate DNS changes (infrastructure-as-code) to cut manual-edit mistakes and speed rollback.
  • Monitor query failures and latency from more than one region.
  • Set TTL deliberately per record based on how often it changes and how much downtime a slow update would cost — not a single blanket value for the whole zone.
  • Restrict zone transfers and use DNSSEC where your registrar and DNS provider both support it, remembering the DS-record TTL timing above when you enable or change it.

DNS TTL and Caching: Key Takeaways

“DNS propagation” is cache expiry, not a global sync. TTL is the only lever you control, and it only helps if you pull it 24–48 hours before the change, not the day of. Negative caching (governed by the SOA MINIMUM field) can hide a brand-new record just as long as a stale one lingers. Plan your TTL the same way you plan the change itself, and cutovers stop being a source of anxiety.

If you're about to move a domain, a store, or a mail platform and want someone to catch the TTL, MX, and delegation details before they turn into downtime, Netalith's $20 Audit + Roadmap is a fast way to get a second set of eyes on the zone before you flip anything.

FAQ

Frequently asked questions

How long does DNS propagation really take?

It depends entirely on the TTL of the record you're changing, plus how long the old TTL was cached before you lowered it. A record with a 300-second TTL that was lowered 48 hours in advance can be fully updated everywhere within about 5 minutes of the real change. A record still running its old 24-hour TTL can take up to 24 hours, no matter how urgent the change is.

Does clearing my browser or OS DNS cache fix propagation delays?

Only for your own device. Flushing your local cache removes your machine's stale answer, but every other resolver on the internet — your ISP's, your coworkers', your visitors' — still has its own cached copy running out its own TTL independently.

Why do I see the old site on my phone but the new one on my laptop?

They're very likely using different resolvers — your phone on cellular data, your laptop on Wi-Fi with a different DNS provider, for example. Each resolver caches independently, so it's normal for different devices and networks to show different answers until every cache has expired.

What TTL should I use for a CDN or load-balanced record?

Short — typically 60 to 300 seconds. Failover and load-balancing setups need clients to stop resolving to an unhealthy endpoint quickly, and the query-volume cost of a short TTL is usually worth that responsiveness.

Is DNS propagation the same thing as DNS caching?

They're two names for the same underlying mechanism viewed from different angles. Caching is the resolver's behavior of storing an answer for its TTL; propagation is what that caching looks like from the outside — different resolvers showing the new value at different times as their individual caches expire.

Stay updated with Netalith

Get coding resources, product updates, and special offers directly in your inbox.