Page MenuHomeVyOS Platform

ddclient not working with generated RFC2136 / nsupdate config
Closed, ResolvedPublicBUG

Description

Hallo,
I tried to configure dynamic DNS with RFC2136 / nsupdate using a keyfile:

# show service dns
 dynamic {
     interface eth3 {
         rfc2136 host.dyn.my-domain.org {
             key /config/auth/dyn.my-domain.org.key
             record host.dyn.my-domain.org
             server my-dns.org
             ttl 60
             zone dyn.my-domain.org
         }
     }
 }

After some debugging I found that ddclient does not like the generated config file and could track down the problem to the commas at the end of the lines:

### Autogenerated by dynamic_dns.py ###
daemon=1m
syslog=yes
ssl=yes
pid=/var/run/ddclient/ddclient.pid
cache=/var/cache/ddclient/ddclient.cache

#
# ddclient configuration for interface "eth3":
#
use=if, if=eth3

# RFC2136 dynamic DNS configuration for host.dyn.my-domain.org
server=my-dns.org,
protocol=nsupdate,
password=/config/auth/dyn.my-domain.org.key,
ttl=60,
zone=dyn.my-domain.org,
host.dyn.my-domain.org

After removing the commas, everything works as expected.

Seems the template for the RFC2136 config in the conf_mode/dynamic_dns.py needs to be changed:

--- /lib/live/mount/rootfs/1.2-rolling-201911030217.squashfs/usr/libexec/vyos/conf_mode/dynamic_dns.py  2019-11-02 17:13:57.000000000 +0100
+++ /boot/rw/usr/libexec/vyos/conf_mode/dynamic_dns.py  2019-11-08 02:10:18.891923048 +0100
@@ -47,11 +47,11 @@
 {% for rfc in interface.rfc2136 -%}
 {% for record in rfc.record %}
 # RFC2136 dynamic DNS configuration for {{ record }}.{{ rfc.zone }}
-server={{ rfc.server }},
-protocol=nsupdate,
-password={{ rfc.keyfile }},
-ttl={{ rfc.ttl }},
-zone={{ rfc.zone }},
+server={{ rfc.server }}
+protocol=nsupdate
+password={{ rfc.keyfile }}
+ttl={{ rfc.ttl }}
+zone={{ rfc.zone }}
 {{ record }}
 {% endfor -%}
 {% endfor -%}

Works for me and I hope it will not break anything else. ;)

Cheers,
Chris

Details

Difficulty level
Easy (less than an hour)
Version
1.2-rolling-201911030217
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

c-po triaged this task as Normal priority.
c-po added a project: VyOS 1.3 Equuleus.
c-po changed Why the issue appeared? from Will be filled on close to Implementation mistake.
erkin set Issue type to Bug (incorrect behavior).Aug 31 2021, 6:21 PM