watcher, config: no Record Change or Inconsistency for listed names (closes #255)
check / check (push) Canceled after 1m56s

DNSWATCHER_SKIP_RECORD_NOTIFICATIONS takes a comma-separated list of
names from DNSWATCHER_TARGETS, read as the targets are (letter case,
trailing dot, repeats). For a listed name no Record Change and no
Inconsistency notification is sent; its records are still checked and
saved, and its other notifications are sent. A listed name that is not
a target stops startup with an error naming it.

The two detections return early for a listed name. Apex domains are
covered too: their own records go through the same detection.

Live DNS cannot be made to disagree on purpose, so the Inconsistency
test feeds records to the change detection directly, as the existing
inconsistency tests do; the live test covers Record Change.

Model: opus-5-5
This commit is contained in:
2026-10-06 00:04:59 +00:00
parent 6822996134
commit bbba4bfdcb
6 changed files with 266 additions and 63 deletions
+12 -1
View File
@@ -730,12 +730,16 @@ func (w *Watcher) detectCNAMEAddressChanges(
// failed on either check has no records to compare. The records kept
// for a record type whose query failed are compared too, but not those
// of a type in UnknownTypes on either check, which the message leaves
// out as well.
// out as well. Nothing is sent for a name in SkipRecordNotifications.
func (w *Watcher) detectRecordChanges(
ctx context.Context,
hostname string,
prev, current *state.HostnameState,
) {
if slices.Contains(w.config.SkipRecordNotifications, hostname) {
return
}
for ns, cur := range current.RecordsByNameserver {
prevNS, ok := prev.RecordsByNameserver[ns]
if !ok || prevNS.Status != statusOK || cur.Status != statusOK {
@@ -835,11 +839,18 @@ func (w *Watcher) detectNSFailures(
}
}
// detectInconsistencies notifies each pair of nameservers that newly
// disagree (see newlyDisagreeingPairs). Nothing is sent for a name in
// SkipRecordNotifications.
func (w *Watcher) detectInconsistencies(
ctx context.Context,
hostname string,
prev, current *state.HostnameState,
) {
if slices.Contains(w.config.SkipRecordNotifications, hostname) {
return
}
for _, pair := range newlyDisagreeingPairs(prev, current) {
ns1, ns2 := pair[0], pair[1]
state1 := current.RecordsByNameserver[ns1]