sync_dns_zone duplicates every host override when reading them fails #14

Open
opened 2026-10-14 08:58:50 +00:00 by christianmanivong · 0 comments
Owner

_get_unbound_host_overrides (~2767) and _get_dnsmasq_host_overrides (~2817) catch every exception, log a warning and return what they have, i.e. []. sync_dns_zone (~2899-2913) deletes the overrides that list names and then adds every record again. A transient API error during a sync therefore deletes nothing and adds everything a second time.

Fix: let the read raise; a sync must not run on an answer it could not get. Test: a failing search leaves the overrides untouched and raises.

Prio P3: wrong DNS data on the firewall after any transient error.

`_get_unbound_host_overrides` (~2767) and `_get_dnsmasq_host_overrides` (~2817) catch every exception, log a warning and return what they have, i.e. `[]`. `sync_dns_zone` (~2899-2913) deletes the overrides that list names and then adds every record again. A transient API error during a sync therefore deletes nothing and adds everything a second time. Fix: let the read raise; a sync must not run on an answer it could not get. Test: a failing search leaves the overrides untouched and raises. Prio P3: wrong DNS data on the firewall after any transient error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-opnsense#14