← Back to Learning Hub

DNS Records • Intermediate • 5 min read

Fix: SOA Serial Number Format Is Invalid

Why validators flag an invalid SOA serial, how the YYYYMMDDnn convention works, the RFC 1982 rollover rule, and how to fix a serial so secondaries update.

"SOA serial number format is invalid" is a DNS health-check warning about the serial field in your zone's SOA record. Strictly speaking, DNS allows any 32-bit unsigned integer as a serial, so the warning is almost never about a value DNS itself rejects. It is about a value that does not follow the widely used date-based convention (YYYYMMDDnn), which validators flag because a non-conforming serial is easy to mismanage and can quietly stop secondary nameservers from picking up your changes. This article explains the convention, the serial arithmetic rule that makes decreasing a serial dangerous, and how to correct the value safely.

What the serial does

The serial is the first number in the SOA rdata and acts as a version stamp for the zone. Secondary nameservers compare the serial they hold against the primary's; if the primary's is higher, they pull a fresh copy with IXFR or AXFR. If it is not higher, they assume nothing changed and keep serving what they have. You can read the current serial directly:

dig +short SOA example.com
ns1.example.com. hostmaster.example.com. 2026111503 7200 600 1209600 3600

Here 2026111503 is the serial. Because the whole update mechanism hinges on "is the new number bigger," the format and the direction of change matter far more than the exact value.

The YYYYMMDDnn convention

The recommended format, described in RFC 1912, encodes the date plus a two-digit counter: four digits of year, two of month, two of day, and two for the revision number that day. So the third edit made on 15 November 2026 is 2026111503. The convention has two advantages: the serial always increases as long as you edit on or after the previous date, and a human can read when the zone was last touched at a glance.

Validators flag a serial as invalid format when it clearly is not a date, for example a small counter like 3 or 42, a Unix timestamp, or a date-like number with an impossible month or day such as 20261503xx. None of these break DNS on their own, but they signal a zone that is not using the convention the tooling and your future self will expect.

The one real hazard: serials only go forward

DNS serial numbers use sequence space arithmetic defined in RFC 1982. The serial is a 32-bit unsigned value (0 to 4294967295), and comparison is done modulo 2^32, not as a plain integer. The practical rule that matters is simple: never let a new serial be lower than the one secondaries already hold. If you decrease the serial, secondaries conclude the zone did not advance and refuse to transfer the new version, so your edits silently fail to propagate while the primary looks correct.

This is exactly how the counter runs into trouble. Suppose you are on 2026111599 (the 99th edit of the day, the maximum the nn slot holds) and need one more change the same day. You cannot go to ...100 without borrowing a digit. The clean move is to jump forward to the next day, 2026111600, which is larger and keeps the format valid.

How to fix an invalid or stuck serial

If the warning is purely about format and the value is still lower than today's date, just adopt the convention: set the serial to today in YYYYMMDDnn form, for example 2026111501, and bump the nn each time you edit. Make sure it is higher than whatever secondaries currently hold.

If someone previously set a serial far too high, such as a Unix timestamp or a typo like 9999999999 (which exceeds the 32-bit maximum and will be truncated), you cannot simply drop back to a date-based value because that would be a decrease. The standard recovery, documented by BIND operators, is the add-2147483647 trick, which exploits the modular comparison:

  1. Take the current (wrong) serial and add 2147483647 (2^31 - 1). If that overflows past 4294967295, wrap it. Set the zone to this value and let secondaries transfer it.
  2. Once every secondary has the large value, set the serial to a small or date-based value. Because of modular arithmetic, the new value now compares as "greater," so secondaries accept it.

On most hosted DNS platforms the serial is auto-managed and increments correctly on every save, so you will rarely need the trick there. It matters mainly for self-run BIND, NSD, or Knot zones where you edit the serial by hand.

Verifying the fix propagated

After correcting the serial, confirm two things: that the primary publishes the new serial, and that your secondaries now report the same one. Query each nameserver's SOA and compare. The fastest way to read the live authoritative serial without local cache in the way is a DNS lookup, which returns the SOA straight from the authoritative servers so you can confirm the serial advanced and the format is now valid.

Frequently asked questions

Does an invalid serial format stop my DNS from working?

Not by itself. Resolution continues. The real risk is operational: a malformed or decreased serial can stop secondary nameservers from pulling updates, so your changes appear to save on the primary but never reach the other servers.

What is the correct SOA serial format?

The common convention is YYYYMMDDnn: four-digit year, two-digit month, two-digit day, and a two-digit daily revision counter, for example 2026111502. It guarantees the serial increases over time and is human-readable.

Why can't I just lower the serial back to a date?

DNS serial comparison (RFC 1982) is modular and treats a lower number as "no change." Secondaries would refuse to transfer. To recover from a too-high serial, use the add-2147483647 two-step so the value still compares as greater.

What happens after the serial reaches 99 for the day?

Roll to the next day: go from 2026111599 to 2026111600. That is larger and keeps the format valid. The nn slot only needs to cover the number of edits in a single day.

My provider manages the serial automatically. Why the warning?

A few providers use an epoch timestamp or a plain counter instead of the date convention, which strict validators flag even though it works. If you cannot change the scheme, the warning is informational; confirm your secondaries stay in sync and you can safely ignore it.

An invalid SOA serial is usually a formatting habit rather than an outage, but a mishandled one can stall every future change. Adopt YYYYMMDDnn, never decrease the number, and read your live serial with the DNS lookup tool to confirm the fix advanced across all your nameservers.

Troubleshooting box

If results look inconsistent, compare authoritative nameservers first, then recursive resolvers by region. Capture snapshots every 10 minutes for deterministic incident timelines.

Try VallaDNS free →

Intermediate • 7 min

How to Check If DNSSEC Is Valid on a Domain

Enabling DNSSEC is not the same as validating. Check that the parent DS matches your DNSKEY, that RRSIGs verify, and read the AD flag to prove the chain works.