How to Fix Broken DNS Records Without Taking Your Site Offline

How to Fix Broken DNS Records Without Taking Your Site Offline

You fix DNS records without downtime by never editing the record your traffic currently depends on. Add a parallel record with a new name or a lower time to live, verify it resolves and serves correctly from multiple resolvers, then cut over and leave the old one in place until caches expire. The same discipline applies whether you are correcting a typo, moving an address, or repairing a broken delegation.

Most outages blamed on DNS are not the protocol failing. They are an operator changing a live record, watching one resolver, and assuming everyone sees what they see. DNS is a cache-driven system, and every step below is about controlling what is cached, where, and for how long.

Understand what a change actually touches before you fix DNS records without downtime

Every answer carries a time to live in seconds. A recursive resolver holds that answer until the TTL expires, then asks the authoritative server again. That single number is your window of risk. If a record has a long TTL and you overwrite it, some clients will keep using the old value for the full duration while others switch immediately, and you cannot tell which is which from the outside.

Lower the TTL on the records you plan to change well before you change them. The rule is to wait at least as long as the current TTL, so that every cache holding the old, longer value has expired and picked up the shorter one. Only then does the new low TTL actually govern. Editing the TTL and the value in the same step defeats the purpose.

Check what is published right now and what TTL is attached. Query the authoritative servers directly rather than a local cache, so you see the source of truth:

dig +norecurse @ns1.example.net www.example.com A
;; ->>HEADER<<- opcode: QUERY, status: NOERROR
;; ANSWER SECTION:
www.example.com.  3600  IN  A  192.0.2.10

That 3600 is the number to beat. If you plan a change, drop it to something short, wait out the old value, and confirm the authoritative answer now returns the short TTL. Note the distinction between the header flags and the answer section: NOERROR with an empty answer section means the name exists but has no record of that type, which is a different problem from NXDOMAIN, where the name does not exist at all. Fixing the wrong one wastes your maintenance window.

The safe sequence for correcting a broken record

Treat the correction as a migration, not an edit. Stand up the correct answer alongside the broken one wherever the record type allows it. For address records, add the new address as an additional record in the same set, verify it, then remove the old one. For a name that must change, create the new name first and confirm it works before you touch the old name's records.

For a record you cannot duplicate, such as a single CNAME or a mail exchanger, the safe move is to point the existing name at an intermediate you control. A CNAME to a name you manage lets you change the target behind it without ever editing the record clients are querying. Where a CNAME is not allowed at the apex, check whether your provider supports an alias or flattening record type, and if not, plan for a short TTL and a brief, deliberate change.

Verify from the authoritative servers first, then from public resolvers, and only then trust it:

dig @ns1.example.net www.example.com A +short
dig @1.1.1.1 www.example.com A +short
dig @8.8.8.8 www.example.com A +short

If the authoritative answer is correct but a public resolver still returns the old value, that is a cache, not a bug. It will clear on its own. Do not "fix" it by changing records again, which only resets the clock and spreads confusion.

Negative caching is the trap most people miss

A resolver that asks for a name and gets NXDOMAIN caches that absence too, governed by the SOA record's minimum field. If you remove a record by mistake and clients query during the gap, they cache the failure. When you re-add the record, those clients keep failing until the negative cache expires. This is why you add before you remove, and why you never leave a name unpublished "for a moment" during a fix.

Sequencing changes across subdomains, mail and the apex

Mail records deserve their own window. The MX record points at a hostname, and that hostname needs its own A or AAAA record. Changing the MX target and the address it resolves to in the same step means a resolver can cache a mail host with no address, and mail bounces. Change the address first, confirm it resolves, then change the MX.

Delegation changes are the riskiest and the easiest to get wrong. If you are moving a subdomain to different name servers, the parent zone holds NS records for it and the child zone must serve matching NS records. A mismatch leaves the subdomain unresolvable. Publish the new name servers in the child zone first, confirm they answer authoritatively, and only then change the delegation in the parent.

A quick check that a server really is authoritative for a zone, and not just answering from cache, is the AA flag in the header:

dig @ns1.example.net example.com SOA +noall +comments
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

That aa means the answer came from the zone's own data. If it is absent, you are talking to a resolver, not the authority, and any test you run against it tells you nothing about what you published.

Check the zone before it goes live

Where your tooling allows, run a zone file check before publishing. A syntax error in a zone file can cause a server to refuse to load the zone entirely, which takes everything under it offline at once. Validate locally, then publish, then query. The order matters because a bad load can be silent until the old zone expires from caches.

named-checkzone example.com /etc/bind/db.example.com
zone example.com/IN: loaded serial 2024010101

The serial in the SOA record is what tells secondary servers the zone changed. If you edit records but forget to increment it, secondaries may never pick up your correction, and you will spend an hour debugging a fix that was never distributed.

What to do next

Before your next change, write down the current TTL for every record you intend to touch, lower those TTLs, and wait out the old values. Then rehearse the change against the authoritative servers with dig before you publish anything, add the new answer before removing the old, and keep a note of the serial and the time you made the change. If something looks wrong afterward, query the authority first and the public resolvers second, and resist the urge to edit again until you know which layer is stale.

Related articles

Subscribe to our newsletter

Get the latest hosting tips, performance insights, and industry news.