SEAKSES · 30+ Global DNS Resolvers, SSL/PKI Suite & Open REST APISpotted a bug or have an idea?
Account

Lowered TTL Before Migration but Traffic Still Hits Old Server? Wait Out the Old TTL

Candra Octavian RamadhaniBy Candra Octavian Ramadhani·2026-12-04T00:42:12+08:00·6 min read
Key Takeaway

Site owners lower the DNS TTL right before a cutover and are surprised when visitors keep reaching the old server for hours. This article explains how resolvers cache records under the previous TTL, and how to time the TTL change so the switch takes effect when planned.

You lowered the TTL on your A record to five minutes, waited a little, pointed the record at the new server, and hours later some visitors are still landing on the old one. The TTL change did work. It simply hadn't reached the resolvers that cached your record before you made it. The fix is mostly about timing, and the timing makes sense once you see what a resolver actually keeps in its cache.

What a resolver stores when it caches a record

When someone opens your site, the browser asks the operating system for the address. The OS stub resolver forwards the question to a recursive resolver, usually the ISP's or a public one. If the recursive resolver has no cached answer, it walks the hierarchy (root servers, then the TLD servers, then your authoritative nameservers) and receives the record along with its TTL, a number of seconds.

The resolver stores the record together with an expiry time: the moment it received the answer plus the TTL. Every client that asks afterwards gets the cached record with the remaining TTL, which counts down. Until that countdown reaches zero, the resolver does not contact your authoritative servers about that name at all.

The key detail is that DNS is pull-only between resolvers and authoritative servers. Your nameservers have no way to tell a resolver that a record changed or to invalidate its copy. The NOTIFY mechanism people sometimes mention exists between primary and secondary authoritative servers for zone transfers. It never reaches recursive resolvers. A resolver learns about your change only when its cached copy expires and it asks again.

Why lowering the TTL right before the cutover does nothing for cached copies

The TTL is part of the cached record. A resolver that fetched your record with a long TTL keeps that long TTL, no matter what you publish later. Here is a timeline with illustrative round numbers, assuming an old TTL of 86400 seconds (one day) and a new TTL of 300 seconds:

  1. At hour 0, a resolver fetches your A record. It caches the old IP with 86400 seconds to live.
  2. At hour 1, you lower the TTL to 300 on your authoritative servers. The resolver doesn't ask, so it still has 23 hours left on its copy.
  3. At hour 2, you switch the A record to the new IP. The resolver still doesn't ask.
  4. At hour 24, the cached copy expires. The resolver queries again and gets the new IP with a TTL of 300. From then on it refreshes every five minutes.

Every resolver cached your record at a different moment, so the switch reaches users unevenly. The worst case is a resolver that refreshed one second before you lowered the TTL. That resolver serves the old value for almost the full old TTL. This means the waiting period starts when the lowered TTL is actually being served by all of your authoritative nameservers, and it lasts as long as the old TTL. If your zone uses secondary nameservers, the change counts only after they have pulled the new zone, which you can confirm by checking that the SOA serial matches on each of them.

This misunderstanding shows up a lot in support. A customer says the DNS change is done and the site still shows the old server. The first useful question is what TTL the record had before anyone touched it, because that number is usually the answer.

Other caches between the visitor and your server

The recursive resolver is the biggest cache, but it isn't the only place an old address can survive.

Operating systems and browsers keep their own short-lived DNS caches. They typically follow the TTL they were given and are rarely the cause of hours-long delays, though a restarted browser or a flushed OS cache sometimes makes one machine behave differently from another.

Applications are a bigger risk. Long-running processes can resolve a hostname once and keep the result, and some runtimes and connection pools cache DNS on their own terms. Nginx is a common example. A hostname in proxy_pass is typically resolved when the configuration loads, so a reverse proxy in front of your app may keep sending traffic to the old IP until it is reloaded, unless it was set up to re-resolve.

Some resolver operators enforce a minimum cache TTL, so your 300 seconds may be held longer than you published. You can't control this from your side. You can only plan a margin for it.

Resolvers that implement serve-stale, described in RFC 8767, may keep answering with expired records if they cannot reach your authoritative servers. This matters when you move DNS hosting and shut down the old nameservers too early.

DNS also only affects new connections. Keep-alive HTTP connections, WebSockets, and other long-lived sessions stay on the old server until the client closes them, times out, or restarts. A client that has already resolved the new IP can still be talking to the old machine over a connection it opened earlier.

If the migration also changes nameservers at the registrar, a different TTL applies. The NS delegation sits in the parent zone, and its TTL is set by the registry, not by you. In that case, keep the old DNS provider serving the correct, updated zone until the delegation change has had time to spread.

Checking what resolvers are actually holding

You can see the countdown directly. First ask your authoritative nameservers what they publish. The TTL in their answer is the full configured value, not a remaining time.

# List the authoritative nameservers for the zone
dig +short NS example.com

# Ask one of them directly (replace with a name from the output above)
dig +noall +answer example.com A @ns1.example-dns.net

Then ask a few public recursive resolvers. Their answers show how many seconds their cached copy has left.

dig +noall +answer example.com A @1.1.1.1
dig +noall +answer example.com A @8.8.8.8

Illustrative output format:

example.com.    71842    IN    A    203.0.113.10

If a resolver shows a remaining TTL larger than your new TTL, it cached the record before you lowered it, and the number tells you roughly how many seconds remain until it refreshes. Large public resolvers run many separate cache instances behind one address, so repeated queries can return different TTLs or even different IPs during the transition. That is expected. Akamai's guide on lowering your DNS TTL also suggests using online checkers to compare what resolvers in different regions return. If answers look inconsistent at the authoritative level itself, tracing the delegation path helps, as covered in tracing the authoritative path with dig +trace.

On the server side, the old machine's access logs are the most honest signal. They show exactly who still arrives and whether that traffic is shrinking.

A cutover timeline that works

Work backwards from the old TTL rather than forwards from the migration date.

  1. Query your authoritative nameservers and note the current TTL on every record you plan to change. Include www, the apex, mail-related names, and any API hostnames. This value is your waiting period.
  2. Lower the TTL at least one old TTL before the planned cutover, plus a margin. Doubling the old TTL is a reasonable rule of thumb. Confirm that every authoritative nameserver serves the new TTL and that the SOA serials match.
  3. Before the cutover, check a few public resolvers. Their remaining TTLs should be at or below the new value. If one still shows a large number, wait.
  4. Switch the record to the new IP. Keep the old server running. If the site accepts writes such as orders, comments, or form submissions, either make the old copy read-only or have it proxy requests to the new server, so that no data lands on a machine you are about to retire.
  5. Watch the old server's logs until traffic drops to near zero. Expect a tail beyond the new TTL from resolvers that enforce a minimum TTL, from long-lived connections, and from clients with hardcoded hosts entries.
  6. Once the new server is stable, raise the TTL back to its normal value so resolvers stop querying your nameservers every few minutes.

The short version: a lowered TTL only takes effect after the old TTL has run out, so publish the low value at least one old TTL ahead of the move, check the countdown with dig before switching, and keep the old server answering until its logs go quiet.