A glass hourglass between two server stacks illustrates the time a DNS answer stays in cache.
TechVertu » Blog » Infrastructure and Networking » What Is DNS TTL? How It Affects a Record Change

What Is DNS TTL? How It Affects a Record Change

For DNS records, TTL (time to live) is the time in seconds that a resolver can normally reuse an answer. If you change your website’s IP address, a resolver that already has the old address can keep giving it to users until its copy expires. A TTL of 300 means five minutes from the lookup that filled that cache.

For a planned move, lower the TTL while the old address is still in place. Once the authoritative nameservers show the lower value, allow one full previous TTL before switching addresses. That gives ordinary caches time to age out. The change still reaches different users at different times.

Where does the TTL countdown start?

Your DNS host’s authoritative nameservers publish the record. A recursive resolver, such as the one your office uses, looks up the answer on behalf of users and can save a copy. A second colleague using that resolver may get the same copy with less time left. An office using another resolver may get a different answer because it first looked up the name later.

TTL belongs to a set of records with the same name and type. If you change the IPv4 address in an A record, check whether users also reach the service through an IPv6 address (AAAA) or an alias (CNAME). Each set has its own TTL. The DNS record types guide shows how to recognise these entries in your zone.

When should you lower the TTL?

Work backwards from the earliest acceptable switch time. If the existing TTL is 3,600 seconds and the change is booked for 10:00, aim to have the shorter TTL visible on every serving nameserver by 09:00. If the last one still shows 3,600 at 09:10 and first shows 300 at 09:15, use 10:15 as the earliest planned switch. The IETF’s guidance on scheduling TTL changes accounts for the delay between submitting an edit and its publication.

Have the person authorised to edit the active zone save the exact name, type, previous values and TTL. Confirm that the DNS host accepts the proposed value. For example, Cloudflare sets an automatic TTL for proxied records and normally returns its own addresses to visitors. The direct address change below assumes an unproxied record.

Before a cloud migration, ask the service owner to test the new endpoint using the real hostname and a valid TLS certificate. Agree how both endpoints will handle sessions and writes during the overlap, who can reverse the move and what failure would trigger that decision. When booking the change, reserve time for validation and recovery.

A worked example with two office resolvers

Suppose a business is moving portal.example.com from 192.0.2.10 to 192.0.2.20. This illustrative portal has one public A record, two authoritative servers and no alias or IPv6 record. Both endpoints can serve the same portal. The two office resolvers honour the advertised TTL, refresh on demand and can reach the authorities.

One portal move, as seen from two offices (UK time)
TimeWhat happensWhich answer can users get?
08:59Office A’s resolver looks up the portal.It caches the old address for 3,600 seconds, until 09:59.
09:00Both authoritative servers now give the old address with TTL 300.Office A’s existing copy still expires at 09:59. Start the one-hour lead time.
09:59:30Office B’s resolver looks up the portal. Office A has made no further lookup.B receives the old address with 300 seconds left. Its copy expires at 10:04:30.
10:00Both authoritative servers now give the new address with TTL 300.An uncached lookup can get the new address. B can still use its cached answer.
10:00:30Someone in each office opens the portal.A fetches the new address. B returns the old address with 240 seconds left.
10:04:30Office B’s copy expires.On its next lookup, B can fetch the new address. Check that the portal works from both offices.

At 10:00:30, two different answers are exactly what the change owner should expect. Asking Office B again at 10:01 would give its copy another chance to answer, but the expiry would still be 10:04:30. Record the address and the remaining TTL so the help desk knows when a repeat check will tell it something new.

Download the fillable DNS record change checklist and log (PDF, 112 KB) to record publication times, resolver answers, application results and the rollback decision.

How to check which DNS answer users get

From a machine with the BIND 9 dig lookup tool, substitute your public hostname and the servers you intend to check. These queries read DNS and require no zone-editing rights. Use your organisation’s resolver for internal names.

1. Check the source. Ask each delegated authoritative nameserver directly. For an existing A record in this example, look for the aa (authoritative answer) flag, the expected address and the TTL. If the servers disagree about this single address, check the active zone and the provider’s publication status before you start the wait.

dig @ns1.example.net. portal.example.com. A +norecurse

2. Check the affected network. Ask the recursive resolver used by the office that reported the problem. Repeat on a second relevant network. In the illustrative answer below, 240 means four minutes remain on that resolver’s cached copy of the old address. Repeat after its observed expiry. Each lookup describes the path you sampled.

dig @resolver.example.net. portal.example.com. A

; Illustrative line from the ANSWER SECTION
portal.example.com.  240  IN  A  192.0.2.10

3. Check the service. Open a fresh connection and complete an agreed task, such as signing in and reading a known record. If DNS gives the new address but the old site still appears, check AAAA and CNAME answers, then the application and any proxy in front of it. A client can reuse an open connection without performing another lookup. An office-only block page also warrants checking the DNS filtering policy.

For email changes, the equivalent service check is a message sent through an affected mail route. After publishing an SPF record or changing a DMARC policy, inspect the receiving system’s authentication results. A correct TXT lookup alone cannot show whether a legitimate message passed.

When can you roll back or restore the normal TTL?

If the new portal fails its application check, the change owner can restore the saved address once the service owner confirms that data written during the move will remain available. Keep the short TTL during rollback. A resolver that fetched the new address at 10:06 with a TTL of 300 can still direct users there until 10:11, even if every authority restores the old address at 10:07.

Keep both endpoints available while it is safe to do so. Watch traffic and application errors on each, test from the affected networks and record the service owner’s decision before retiring the old endpoint. If a resolver cannot refresh its data, the DNS serve-stale standard allows it to return an expired answer under specified conditions. A timer alone cannot establish that everyone has moved.

Once the chosen endpoint is stable and the rollback window has closed, restore the normal TTL and verify it at the authorities. Amazon Route 53’s DNS guidance explains why shorter lifetimes make later changes easier to pick up, while longer ones reduce repeat queries to your DNS host.

Frequently asked questions

Get help planning an infrastructure change

If your portal move also involves servers or office networks, share the change record with the team responsible for both. TechVertu’s infrastructure team can help you plan the server and network work.

Subscribe for Latest Tech Insights & Company News

anything else?

Lets Talk!

If you have additional comments or questions about this article, you can share them in this section.

Your email address will not be published. Required fields are marked *


Scroll to Top