DNS Changes During Migration: TTLs, Checks, Rollback — Cloud & DevOps article by Rui Codex

DNS changes during migration are safest when you lower the TTL well before cutover, verify the new targets before traffic moves, keep the old endpoint running, and write a rollback that restores previous records. Each step limits how long users can see stale answers.

Key takeaways

  • Lower the TTL on every record you will change at least one full old-TTL period before the planned cutover.
  • Verify the new environment against its final hostnames before any public DNS record changes.
  • Keep the old endpoint serving until error rates and data checks have stayed clean for an agreed period.
  • Write the rollback as exact record values with a named owner and a decision deadline.

What does TTL control during a DNS cutover?

The TTL, or time to live, tells a resolver how long it may keep a cached answer before asking again. It therefore sets the longest window in which some users still reach the old system after you edit a record.

The TTL is a field attached to each resource record and is expressed in seconds. The rules for how caches must store and count it are set out in RFC 2181, the IETF specification that clarifies the DNS standard.

The TTL is not a switch. A cache counts the value down from the moment it fetched the record, so an old answer can persist for up to the old TTL even after you have changed the zone. Caching happens at several layers, including the operating system, the browser, the office router and the internet provider's resolver, and each layer holds its own copy. The basic record format and resolution model are described in RFC 1035.

When should you lower the TTL before a migration?

Lower the TTL at least one full old-TTL period before the planned change, so that every cache holding the old answer has expired before you switch. The lowering itself is subject to the same delay, which is why it must happen first.

Plan the timeline backwards from the cutover. If the current TTL is long, the lowering change needs its own window, and you should not combine it with the cutover. Checklist for the preparation phase:

  • Record the current TTL of every record that will change, including subdomains and mail-related records.
  • Lower those TTLs in a separate change window and confirm the new value from several resolvers.
  • Wait until the old TTL has fully passed before starting the cutover.
  • Keep the short TTL in place for a few days after cutover so that a rollback can also propagate quickly.

Very short TTLs have trade-offs. They increase query volume against your authoritative servers and make any misconfiguration spread quickly. Some resolvers also clamp or ignore very low values, so a short TTL reduces the window but never guarantees instant propagation.

Tip: Note the TTL you are replacing in the change log. Without it, nobody can calculate how long the lowering step must run.

How do you validate DNS records before switching traffic?

Test the new system against its final hostname using a hosts-file override, a staging name or a temporary record, and confirm every record type the application needs before any public record changes. Validation covers more than the website address.

Inventory every record type

Many cutovers check only A and AAAA records. Mail depends on MX records and on TXT records for sender authentication, and domain verification for third-party services usually lives in TXT records as well. A missing TXT record rarely breaks the website, which is why it is often found days later.

Check answers from several resolvers

Query your own authoritative servers and at least two public resolvers. Compare the returned values and the remaining TTLs with what the plan expects. Differences usually mean a cache is holding an old copy, not that the new record is wrong.

Test the application, not only the name

Confirm that the TLS certificate covers the hostname, that redirects land on the correct paths, and that the health endpoint reports healthy. A correct DNS answer pointing at a server with the wrong certificate still fails for users.

  • Every record type in the inventory has an expected value written down.
  • Mail flow has been tested with a message in each direction.
  • The certificate, redirects and health checks pass against the new target.
  • Someone other than the author has reviewed the record list.

Hypothetical examples of a DNS cutover

Here are two hypothetical scenarios: each describes a plausible situation and makes no claim about any real organisation.

In the first scenario, an online shop moves its storefront to a new platform. The team lowers the TTL on the web records, tests the new platform on a staging name and keeps the old platform running. The cutover is clean for web traffic, but a payment provider's verification record was never copied, so the provider flags the domain until the TXT record is restored.

In the second scenario, an internal accounting system moves to a hosted service. The team validates the web address carefully but forgets the mail exchange records, which then point at the old mail server during the transition. Mail continues to arrive at the old server, and the team must forward it until the records have fully propagated. Both scenarios show why the inventory step matters more than the speed of the switch.

How do you roll back a DNS change safely?

Keep the previous record values written down exactly, keep the old system able to serve traffic, and agree in advance on the condition that triggers a rollback. A DNS rollback is only as fast as the TTL you set and the old system still being available.

A rollback restores DNS answers, but it does not move data. Any writes accepted by the new system during the window stay there unless you plan a reverse data sync. Decide the point of no return before cutover, because after that point a rollback may lose data.

  • Export the complete zone before the change, not only the records you expect to edit.
  • Name the person who can make the rollback change and the backup person who can approve it.
  • Define measurable triggers, such as error rates or failed login counts, that start the rollback decision.
  • Keep the old endpoint serving until the agreed observation period has passed.
Tip: Rehearse the rollback once in a non-production zone. A rollback that has never been run usually takes longer than the plan assumes.

Where does a DNS-based cutover fail?

A DNS-based cutover fails when something depends on an address that DNS does not control. Hard-coded IP addresses in client software, pinned certificates and long-lived connections keep using the old target after the record has changed. Find these dependencies during discovery, not during the cutover window.

Signed zones add another failure point. If DNSSEC signing material is not updated consistently with the zone, validating resolvers can refuse answers that look correct. Treat signing changes as part of the cutover plan with their own checks. For systems that connect several platforms, the surrounding integration work often matters as much as the DNS change itself, and our team covers that work through system integration services at https://ruicodex.com/Services/Integrations.

Infrastructure changes also need a clear owner for monitoring after cutover. Our guide on securing cloud infrastructure covers the baseline controls that should stay in place once the new environment is live.

Frequently Asked Questions

How long before a migration should the TTL be lowered?

Lower the TTL at least one full old-TTL period before the planned cutover. This lets every cache that holds the old answer expire before you switch. Make the lowering change in its own window and confirm it from several resolvers before you rely on it.

Does a lower TTL guarantee instant propagation?

No, a lower TTL only limits how long resolvers keep the old answer. Some resolvers clamp or ignore very low values, and some clients hold their own copies. Plan for a period of mixed answers and keep the old endpoint serving during that window.

Should the old server be kept running after cutover?

Yes, keep the old endpoint serving until the agreed observation period has passed and the new system has shown clean error rates. Users with cached answers will still reach it during propagation. Shutting it down too early turns a slow change into an outage for those users.

What should a DNS rollback plan include?

A rollback plan lists the exact previous record values, the person who makes the change, the trigger that starts the decision and the point after which rollback may lose data. It should also include a verification step that confirms recovery from several resolvers.

Conclusion

DNS changes during a migration succeed when the preparation is as deliberate as the switch itself. Lower the TTL early, validate every record type against the final hostnames, keep the old system available and write the rollback before you need it. If you want a second engineering review of your cutover plan, request a project consultation at https://ruicodex.com/Contact or email info@ruicodex.com to discuss your project. You can also see delivered projects at https://ruicodex.com/CaseStudies.

Sources

Tags: DNS migration TTL DNS validation DNS rollback system migration cutover planning DNS records cloud infrastructure

Need Help Implementing This?

Our team can help you put these insights into practice. From AI automation to custom software development, we build solutions that deliver real results.

Send a project request