modified: README.md
modified: netbox_dns_bridge/notify_handler.py Remove hardcoded client notify port and connect to plugin setting instead.
This commit is contained in:
1 parent
83965817d6
commit
11ea9a6f1a
2 files changed
+12
-4
No files matched your search
@@ -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)
|
- [For all Zones](ns-notify-for-all-zones)
|
||||||
Note: This makes the *Per Zone* mechanism redundant. There is no point in enabling both.
|
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
|
#### Client NOTIFY
|
||||||
Clients may be notified of zone changes using the NOTIFY mechanism defined in RFC 1996.
|
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.
|
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
|
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.
|
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
|
#### NS NOTIFY
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class SendDNSNotify(JobRunner):
|
|||||||
|
|
||||||
def run(self, *args, **kwargs):
|
def run(self, *args, **kwargs):
|
||||||
notify_over_tcp = SETTINGS.get("notify_over_tcp", False)
|
notify_over_tcp = SETTINGS.get("notify_over_tcp", False)
|
||||||
|
port = SETTINGS.get("notify_client_port", 53)
|
||||||
view_name = kwargs["view_name"]
|
view_name = kwargs["view_name"]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -89,10 +90,10 @@ class SendDNSNotify(JobRunner):
|
|||||||
try:
|
try:
|
||||||
if notify_over_tcp:
|
if notify_over_tcp:
|
||||||
LOGGER.debug("Sending 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:
|
else:
|
||||||
LOGGER.debug("Sending NOTIFY over UDP")
|
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(
|
LOGGER.info(
|
||||||
f"NOTIFY sent: {client.source_ip} {view_name}/{zone_name} {soa_serial}"
|
f"NOTIFY sent: {client.source_ip} {view_name}/{zone_name} {soa_serial}"
|
||||||
|
|||||||
Reference in new issue
Block a user