Many migration plans assume one thing: lower the A record's TTL to 300 seconds a few minutes before the move, switch the record, and everyone follows within five minutes. It rarely works that way. Resolvers that cached the record before you lowered the TTL are still holding it under the old TTL. They will not ask your DNS server again until that old timer runs out.
The result is a familiar support conversation. The site owner says they lowered the TTL, changed the IP, and some visitors still land on the old server hours later. Nothing is broken. The cache is doing exactly what it was told to do, by the old TTL.
Why a new TTL never reaches caches that already have the record
TTL (time to live) is a number of seconds that the authoritative DNS server attaches to every record it hands out. The authoritative server is the one that actually hosts your zone. A recursive resolver, such as your ISP's DNS, a public resolver, or an office DNS server, fetches the record once and stores it. It then counts the TTL down. While the counter is above zero, the resolver answers from its cache and never contacts your authoritative server.
DNS has no push or invalidation mechanism. Your DNS server cannot reach out to resolvers and tell them a record changed or that the TTL is now shorter. The TTL travels with the answer at the moment of the fetch, and the resolver commits to it. So when you edit the TTL in your zone, you only change what the next fetch will receive. Every copy already sitting in a cache keeps its original countdown.
Here is an illustrative example. Your A record has a TTL of 86400 seconds, which is one day. A resolver fetched it an hour before you lowered the TTL to 300. That resolver will keep serving the old record for roughly 23 more hours, regardless of what your zone says now. If you change the IP during that window, its users keep going to the old server until the countdown ends.
In production this matters more, not less. A site with steady traffic is queried through many resolvers, and each one fetched the record at a different moment. Busy resolvers re-fetch soon after their copy expires, so at any given time some of them hold a copy with almost the full old TTL remaining. That is why the old IP does not disappear all at once. It drains gradually, and the worst case is one full old TTL after you lowered it.
Reading the remaining TTL with dig
You can see this mechanism directly. Ask the authoritative server for the configured TTL, then ask a recursive resolver for the time left on its cached copy. If the two numbers do not match, you have learned something.
# List the authoritative nameservers for the zone
dig +short NS example.com
# Ask one authoritative server directly: shows the TTL as configured now
dig +noall +answer example.com A @ns1.example.net
# Ask a recursive resolver: shows the remaining TTL on its cached copy
dig +noall +answer example.com A @1.1.1.1
Replace ns1.example.net with a nameserver returned by the first command, and repeat the second query for every nameserver in that list. The output looks something like this.
Illustrative output format (authoritative first, then resolver):
example.com. 300 IN A 203.0.113.10
example.com. 61842 IN A 198.51.100.20
The authoritative server already serves the new IP with a 300-second TTL. The resolver still holds the old IP and has about 17 hours left on the old one-day TTL. If you run the resolver query again a few seconds later, the number goes down. That confirms you are looking at a countdown, not at a setting.
Keep a few caveats in mind when you read these numbers. Large public resolvers run many cache instances behind the same address, so repeated queries can return different remaining TTLs or even different answers. Treat the highest number you see as the realistic worst case. You also cannot query every resolver your visitors use. Spot checks show you the mechanism, but plan with the configured old TTL, because that is the upper limit any cache can be holding.
This article covers changing a record inside a zone. Changing nameservers involves another layer of caching at the TLD servers, and that is a separate problem.
How far ahead to lower the TTL
The rule of thumb is simple. Lower the TTL at least one full old TTL before the change, and add some margin. With an old TTL of 3600, lower it more than an hour ahead. With 86400, lower it more than a day ahead. Many people pick two days for a one-day TTL, so a forgotten secondary server or a late edit does not eat into the window.
The countdown starts when the lowered TTL is actually served by every authoritative server, not when you click save. If your zone has secondary nameservers fed by zone transfers, they need to pick up the new zone serial first. With NOTIFY configured, that usually happens quickly. Without it, the timing depends on the SOA refresh interval. The dig loop over every NS record from the previous section is the quickest way to confirm.
A very low TTL is also not a guarantee. Some resolvers apply their own floor or ceiling to TTL values, and some DNS providers enforce a minimum TTL in their panel. A value like 300 is typically respected widely. Going much lower brings little extra benefit and depends more on resolver behavior you do not control.
DNS caches also exist outside the resolver. Operating systems, browsers, and some application runtimes keep their own short caches. Long-lived connections ignore DNS completely once they are open. This applies to keep-alive HTTP connections, websockets, database connection pools, and other mail servers that hold a session. These usually clear up quickly, but they explain why a trickle of traffic can reach the old server even after every resolver has caught up.
A cutover order that holds up in production
When this goes wrong, the support question is almost always the same: when was the TTL lowered, and what was it before? If the answer is "ten minutes before the switch" and the old value was a day, the behavior is explained. The fix is to wait, not to keep editing the record. The order below avoids that situation.
- Read the current TTL from an authoritative server and write it down. That number is how long your preparation window must be.
- Lower the TTL, for example to 300, at least one full old TTL before the planned move. Confirm the new value on every authoritative nameserver.
- Wait out the old TTL. Spot-check a few resolvers. Their remaining TTL should now never exceed the new low value.
- Do the final data sync, then change the record to the new IP.
- Keep the old server online and serving correctly, or proxying to the new one, for well beyond the new TTL. Watch its access logs until traffic tapers off to almost nothing.
- Once the new server is stable, raise the TTL back to a normal value. Leaving it at 300 permanently means more queries to your DNS and less tolerance if your DNS provider has a problem.
Step 5 is the one people skip most often. Even with perfect TTL timing, a small amount of traffic arrives late. An old server that still answers makes that harmless. An old server that was shut down the moment the record changed turns it into errors for real visitors.
The practical takeaway: the TTL that matters on migration day is the one you had before you touched anything. Check it with dig against your authoritative servers, lower it at least that long before the move, confirm resolvers have caught up, and keep the old server running through the overlap. Do that, and the cutover becomes a short, predictable drain instead of a day of mixed traffic.