Address review: rename settings to notify_ns_* and add global toggle

Per PR review feedback:
- Rename settings: custom_field_force_notify -> notify_ns_custom_field_name,
  force_notify_port -> notify_ns_port.
- Add notify_ns_all_zones (bool, default False) to enable the feature globally
  for every zone; it coexists with the per-zone custom field — a NOTIFY is sent
  if the global switch is on OR the zone's custom field is set.
- Rename the internal job/scheduler/log strings to the notify_ns naming for
  consistency (SendZoneNSNotify, schedule_notify_ns).
- Update README and CHANGELOG.
This commit is contained in:
d_ev committed 2026-07-16 14:57:14 +03:00
1 parent dc1c223400
commit 4ad41360de
4 files changed
+61 -41

No files matched your search

+24 -15
View File
@@ -98,22 +98,31 @@ list of clients to be notified on zone changes. Default is 24 hours.
```
Switch to using TCP instead of UDP. Defaults to False
#### Forced NOTIFY to a zone's nameservers
#### NOTIFY to a zone's own nameservers
In addition to notifying clients that queried the transfer endpoint, the plugin can send a NOTIFY
directly to a zone's own nameservers whenever that zone's SOA serial number changes. This is useful
when you want specific zones to have their nameservers pull updates immediately, independent of the
`notify_clients` mechanism.
The feature is driven by a boolean custom field on the NetBox DNS Zone object. Create a boolean
custom field (e.g. `dns_bridge_force_notify_ns`) that applies to `netbox_dns > zone`, then point the
plugin at it:
```
'custom_field_force_notify': 'dns_bridge_force_notify_ns'
```
When this setting is present, every time a zone whose custom field is set to `True` changes its SOA
serial number, the plugin schedules a background NOTIFY to each of the zone's configured nameservers.
when you want nameservers to pull updates immediately, independent of the `notify_clients` mechanism.
Only a change of the SOA serial triggers this — other zone edits that leave the serial untouched do
not. The setting is unset by default, which disables the feature entirely.
not.
This can be enabled per zone, globally, or both. If neither of the settings below is configured, the
feature is disabled entirely.
**Per zone (custom field).** Create a boolean custom field (e.g. `dns_bridge_notify_ns`) that applies
to `netbox_dns > zone`, then point the plugin at it:
```
'notify_ns_custom_field_name': 'dns_bridge_notify_ns'
```
A NOTIFY is then sent for any zone whose custom field is set to `True`. This lets you toggle the
behavior per zone straight from the NetBox UI, without changing the plugin config.
**Globally (all zones).**
```
'notify_ns_all_zones': True
```
When enabled, a NOTIFY is sent for every zone on serial change, regardless of the custom field.
Defaults to `False`. The two options coexist: a NOTIFY is sent if the global switch is on **or** the
zone's custom field is set.
The nameserver addresses are resolved from NetBox DNS itself by looking up active A/AAAA records
(within the zone's view) matching each nameserver's hostname. The NOTIFY messages are signed with the
@@ -121,9 +130,9 @@ same per-view TSIG key configured under `tsig_keys`, so the receiving nameserver
signed with that key (e.g. BIND's `allow-notify { key "..."; };`).
```
'force_notify_port': 53
'notify_ns_port': 53
```
Destination port used for these forced NOTIFY messages. Defaults to 53.
Destination port used for these NOTIFY messages. Defaults to 53.
As with the client NOTIFY feature, this uses NetBox's background job system, so at least one
`rq-worker` service must be running.