summaryrefslogtreecommitdiff
path: root/src/conf_mode/dns_dynamic.py
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-09-21 21:35:18 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-09-23 22:07:49 -0500
commit8088cb8b6aacf9b7003845e4c9081b7f569b6fac (patch)
tree21a410f18aa56ba1be911063c47e7740d71d19b6 /src/conf_mode/dns_dynamic.py
parent35e88be03f013e0ae240b6ec9b73fdd8d36ed75e (diff)
downloadvyos-1x-8088cb8b6aacf9b7003845e4c9081b7f569b6fac.tar.gz
vyos-1x-8088cb8b6aacf9b7003845e4c9081b7f569b6fac.zip
ddclient: T5612: Enable TTL support for web-service based protocols
Enable TTL support for web-service based protocols in addition to RFC2136 based (nsupdate) protocol. Since TTL is not supported by all protocols, and thus cannot have a configuration default, the existing XML snippet `include/dns/time-to-live.xml.i` does not have common `<defaultValue>300</defaultValue>` anymore and is instead added explicitly whenever necessary.
Diffstat (limited to 'src/conf_mode/dns_dynamic.py')
-rwxr-xr-xsrc/conf_mode/dns_dynamic.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py
index 84c983ee3..5150574a8 100755
--- a/src/conf_mode/dns_dynamic.py
+++ b/src/conf_mode/dns_dynamic.py
@@ -35,6 +35,9 @@ zone_required = ['cloudflare', 'godaddy', 'hetzner', 'gandi', 'nfsn']
# Protocols that do not require username
username_unnecessary = ['1984', 'cloudflare', 'cloudns', 'duckdns', 'freemyip', 'hetzner', 'keysystems', 'njalla']
+# Protocols that support TTL
+ttl_supported = ['cloudflare', 'gandi', 'hetzner', 'dnsexit', 'godaddy', 'nfsn']
+
# Protocols that support both IPv4 and IPv6
dualstack_supported = ['cloudflare', 'dyndns2', 'freedns', 'njalla']
@@ -97,6 +100,9 @@ def verify(dyndns):
if 'username' not in config:
raise ConfigError(f'"username" {error_msg}')
+ if config['protocol'] not in ttl_supported and 'ttl' in config:
+ raise ConfigError(f'"{config["protocol"]}" does not support "ttl"')
+
if config['ip_version'] == 'both':
if config['protocol'] not in dualstack_supported:
raise ConfigError(f'"{config["protocol"]}" does not support '