Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#2192·DnsServer

NOTIFY lost for zone changes made while a notify round is waiting on an unreachable secondary

Author: garygentryCreated Sep 27, 2026Updated Sep 29, 2026

Version: 15.4 (Debian 13 LXC). The changelog shows no NOTIFY change through 15.5, and the code below is from current master.

Setup: a three-node cluster: ns1 is the primary; ns2 and ns3 are secondaries. Member zones are in the cluster catalog, and the catalog's notify is SpecifiedNameServers [ns2, ns3] (the cluster default). The zone in question is a Conditional Forwarder on ns1 (SecondaryForwarder on the others), but the code path is common to every ApexZone.

Summary

While one secondary is unreachable, a zone change made during an in-progress NOTIFY round is never notified to any secondary, including the healthy ones. They stay stale until their own SOA refresh fires. With the default refresh of 900 s, that means up to 15 minutes of stale answers, and the primary never logs it as a failure.

Steps to reproduce

  1. Cluster with one primary and two secondaries. Stop one secondary (ns3), so it is unreachable (no ICMP reply, packets dropped).
  2. On the primary, add record A to a catalog member zone. The primary notifies ns2 at once (logged: successfully notified name server 'ns2…'). The ns3 notify then hangs for ~50 s before failed to notify name server 'ns3…'.
  3. Within that ~50 s, add record B to the same zone (a second change 10–15 s after the first is enough).
  4. Watch ns2's soaSerial (/api/zones/list), or query B on ns2.

Observed: The primary logs Saved zone file for change B but no notify line at all. ns2 stays one serial behind and does not answer B. It catches up only at its next SOA refresh: in our test, ns2 healed 5 s after last refresh + 900 s. POST /api/zones/resync on ns2 fixes it immediately. A change made after the round has finished is notified normally. With every secondary reachable, a round takes milliseconds, so the window almost never opens.

Expected: Every change reaches every reachable secondary promptly. An unreachable secondary must not delay or swallow NOTIFY to the healthy ones.

Cause (as far as I can read it)

DnsServerCore/Dns/Zones/ApexZone.cs (permalinks at 7b141ff):

  1. TriggerNotify() drops the trigger while a round is pending or running (L508-L509):
    csharp
    if (_notifyTimerTriggered)
        return;
  2. The flag is cleared only in the resolver task's finally, after all notifies of the round complete (L381-L384):
    csharp
    finally
    {
        _notifyTimerTriggered = false;
    }
    An unreachable secondary holds the round open for NOTIFY_TIMEOUT 10 000 ms × NOTIFY_RETRIES 5, about 50 s (L105-L106). Any TriggerNotify() in that window is discarded, and nothing records that it happened.
  3. The follow-up rounds for the failed server are armed with the SOA retry (L370) and run with _notifyTimerTriggered == false. That means onlyFailedNameServers = !_notifyTimerTriggered = true (L328-L346), so they only ever retry the down secondary. The healthy secondary that missed change B is never re-notified.

A smaller variant of the same race: during one of those failed-server retry rounds, TriggerNotify() sets the flag and arms the 5 s timer. If the old round's finally then clears the flag before the new task evaluates !_notifyTimerTriggered, the new round also runs as "only failed servers".

Suggested fix

One of:

  • Remember a pending trigger. In TriggerNotify(), when _notifyTimerTriggered is already set, record _notifyPending = true instead of returning silently. In the finally, if _notifyPending is set, clear it and re-arm the timer (NOTIFY_TIMER_INTERVAL) for a full round to all servers. This keeps the coalescing and loses nothing.
  • Or pass the round's intent explicitly instead of deriving it from a shared flag at run time: a change-triggered round always notifies all servers, and only the retry timer uses "failed servers only". The first retry after a change could also notify all servers.

Not blocking the round on a slow server would also help. For example, the healthy servers' results could complete the round (and clear the flag) while the unreachable one keeps retrying in its own task.

Workarounds we use

  • Lower the member zones' SOA refresh (we use 300 s) to cap the staleness.
  • After each change, compare soaSerial across nodes and POST /api/zones/resync any secondary that is behind.
  • Alert when a reachable secondary's serial differs from the primary's for longer than a refresh interval.

Thanks for Technitium. It has been solid otherwise, and the clustering is great.

Source: TechnitiumSoftware/DnsServer

View original on GitHubView discussion on GitHub