Unable to set ddns-hostname in static-mapping-parameters

I recently followed this great thread about adding DDNS functionality to VYOS DHCP Server.

It worked as described and I was able to get DDNS working and updating a bind DNS server.
However it seems some devices on my network all report the same hostname (because who would buy multiple smart plugs?).

Anyway to get round this I planned on setting the hostname using the “ddns-hostname” option using the “static-mapping-parameters” setting which should insert it into the “host” block.
I seem to be able to set other custom DHCP options using this method but setting ddns-hostname fails to commit saying “check your options!”

`service dhcp-server shared-network-name IOT subnet static-mapping study1-tapo110 static-mapping-parameters ‘option host-name study1-tapo110;’

Not working:
subnet static-mapping study1-tapo110 static-mapping-parameters "option ddns-hostname "study1-tapo110";"

Because quote are not allow in the config, i used the same method of setting ddns-rev-domainname from the tutorial linked above (shared-network-parameters ‘ddns-rev-domainname "in-addr.arpa.";’)

Anyone tried anything similar and succeeded?

I could of course just add these static mappings to the DNS server as static entries but i’d prefer to only have it in one place since it makes maintenance and cleanup/decom easier down the line.

I fixed it. Turns out I was not applying the option correctly. I also then ran into a second problem which where devices with a static mapping (Static DHCP reservation) were not updating DNS.

So in the interest of helping others here is my working config which builds upon the link above to use VYOS to do DDNS updates to a bind 9 server.

service {
    dhcp-server {
        shared-network-name IOT {
            domain-name iot.home.example.com
            shared-network-parameters "key rndc-key { algorithm hmac-sha256; secret ThisIsAVerySecretKey; };"
            shared-network-parameters "ddns-domainname "iot.home.example.com.";"
            shared-network-parameters "ddns-rev-domainname "in-addr.arpa.";"
            shared-network-parameters "zone iot.home.example.com. { primary; key rndc-key; }"
            shared-network-parameters "zone 64.168.192.in-addr.arpa. { primary; key rndc-key; }"
            shared-network-parameters "ddns-update-style standard;"
            shared-network-parameters "ddns-updates on;"
            shared-network-parameters "update-static-leases true;"
            subnet {
                lease 86400
                range unreserved {
                static-mapping livingroom2-HS100 {
                    mac-address b0:4e:26:17:2a:12
                    static-mapping-parameters "ddns-hostname livingroom2-HS100;"
                    static-mapping-parameters "option host-name livingroom2-HS100;"
                static-mapping study1-tapo110 {
                    mac-address 1c:61:b4:ce:47:82
                    static-mapping-parameters "option host-name study1-tapo110;"
                    static-mapping-parameters "ddns-hostname "study1-tapo110";"

Key config parameters:

  • ddns-hostname - This sets the hostname reported to the DNS server.
  • "update-static-leases true;" - Without this dhcpd will not update ddns entries for static mappings.

Optional Config parameters:

  • option host-name - DHCP option 12. Says to the device, please use hostname xxx (not all device support/honor it)
  • ddns-update-style standard; - See ISC DHCP support for Standard DDNS

This is confirmed working on VYOS 1.4-rolling-202306010317 (running isc-dhcpd-4.4.3-P1). It should also work with Infoblox (NIOS and Bloxone DDI with some tweaking to the shared key) however if you have access to Infoblox use DHCP relay or run the B1DDI KVM image on the VYOS box. Infoblox makes this whole thing soooo much easier.


Hi @Shrug666! NICE job on fixing the issue and finding a solution, and thank you for sharing your working config! It’s always helpful to contribute to the community and help others facing similar challenges.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.