fix: sync_dns_zone no longer copies an override made by hand #18

Merged
christianmanivong merged 1 commits from fix/hand-made-override-copies into master 2026-10-16 09:55:28 +00:00
Owner

Fixes the driver half of NetOrk/netork#1123.

What happened

sync_dns_zone deletes only overrides tagged [netork] and then adds every record it is given, tagged. netOrk sends every record of the zone, including the hand-made overrides its poll read off the same firewall. So each hand-made override got a tagged twin: four names twice on gw-01 and gw-02 (gw, nas, minecraft, db-01).

Change

An enabled, untagged override with the same name (case-insensitive), record type and address in the zone now counts as already pushed. The record is not added again.

A copy made earlier is tagged. The next sync deletes it as before and no longer re-adds it, so existing duplicates clear themselves.

Not affected:

  • a hand-made override in another zone, or with a different address;
  • a disabled hand-made override (it answers nothing).

Tests

5 new tests in TestSyncDnsZone. Two of them were red before the change. Full suite: 373 passed.

Related: #14 (a failed read doubles everything, a different cause) and #16 (tag rename; this change reads the tag through _NETORK_TAG, so it follows the rename).

Fixes the driver half of NetOrk/netork#1123. ## What happened `sync_dns_zone` deletes only overrides tagged `[netork]` and then adds every record it is given, tagged. netOrk sends every record of the zone, including the hand-made overrides its poll read off the same firewall. So each hand-made override got a tagged twin: four names twice on gw-01 and gw-02 (`gw`, `nas`, `minecraft`, `db-01`). ## Change An **enabled, untagged** override with the same name (case-insensitive), record type and address in the zone now counts as already pushed. The record is not added again. A copy made earlier is tagged. The next sync deletes it as before and no longer re-adds it, so existing duplicates clear themselves. Not affected: - a hand-made override in another zone, or with a different address; - a disabled hand-made override (it answers nothing). ## Tests 5 new tests in `TestSyncDnsZone`. Two of them were red before the change. Full suite: 373 passed. Related: #14 (a failed read doubles everything, a different cause) and #16 (tag rename; this change reads the tag through `_NETORK_TAG`, so it follows the rename).
christianmanivong added 1 commit 2026-10-16 09:49:09 +00:00
fix: sync_dns_zone no longer copies an override made by hand
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 32s
CI / test (3.12) (push) Successful in 40s
CI / test (3.10) (pull_request) Successful in 38s
CI / test (3.11) (pull_request) Successful in 35s
CI / test (3.12) (pull_request) Successful in 38s
5b54174cc4
The records netOrk sends include what its poll read off the same
firewall, hand-made host overrides among them. sync_dns_zone deletes only
tagged overrides and then added every record again under the tag, so each
hand-made override ended up on the device twice (NetOrk/netork#1123).

An enabled, untagged override with the same name, type and address in the
zone now stands in for its record. A copy made earlier is tagged, so the
next sync deletes it and does not add it again.
christianmanivong merged commit 5a1aa66db4 into master 2026-10-16 09:55:28 +00:00
christianmanivong deleted branch fix/hand-made-override-copies 2026-10-16 09:55:28 +00:00
Sign in to join this conversation.