From 11ea9a6f1aa93e3286c83e9ffe478f55fe58561c Mon Sep 17 00:00:00 2001 From: Sven Luthi Date: Mon, 20 Jul 2026 15:05:29 +0200 Subject: [PATCH] modified: README.md modified: netbox_dns_bridge/notify_handler.py Remove hardcoded client notify port and connect to plugin setting instead. --- README.md | 11 +++++++++-- netbox_dns_bridge/notify_handler.py | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b684765..f7b9e04 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,11 @@ The plugin has 2 different NOTIFY mechanisms that may be turned on individually - [For all Zones](ns-notify-for-all-zones) Note: This makes the *Per Zone* mechanism redundant. There is no point in enabling both. +#### Global NOTIFY Settings +``` +'notify_over_tcp': True +``` +Switch to using TCP instead of UDP. Defaults to False #### Client NOTIFY Clients may be notified of zone changes using the NOTIFY mechanism defined in RFC 1996. @@ -104,10 +109,12 @@ This enables the NOTIFY system. Defaults to False This sets how long a client is considred "alive" after it last queried the transfer endpoint. Once the client has failed to check in for this amout of time, it is automatically removed from the list of clients to be notified on zone changes. Default is 24 hours. + ``` -'notify_over_tcp': True +'notify_client_port': 53 ``` -Switch to using TCP instead of UDP. Defaults to False +Destination port used to send NOTIFY messages to clients. Defaults to 53. + #### NS NOTIFY diff --git a/netbox_dns_bridge/notify_handler.py b/netbox_dns_bridge/notify_handler.py index 229b2ef..1ade725 100644 --- a/netbox_dns_bridge/notify_handler.py +++ b/netbox_dns_bridge/notify_handler.py @@ -48,6 +48,7 @@ class SendDNSNotify(JobRunner): def run(self, *args, **kwargs): notify_over_tcp = SETTINGS.get("notify_over_tcp", False) + port = SETTINGS.get("notify_client_port", 53) view_name = kwargs["view_name"] try: @@ -89,10 +90,10 @@ class SendDNSNotify(JobRunner): try: if notify_over_tcp: LOGGER.debug("Sending NOTIFY over TCP") - dns.query.tcp(msg, client.source_ip, port=5355, timeout=2) + dns.query.tcp(msg, client.source_ip, port=port, timeout=2) else: LOGGER.debug("Sending NOTIFY over UDP") - dns.query.udp(msg, client.source_ip, port=5355, timeout=2) + dns.query.udp(msg, client.source_ip, port=port, timeout=2) LOGGER.info( f"NOTIFY sent: {client.source_ip} {view_name}/{zone_name} {soa_serial}"