Page MenuHomePhabricator

Static DHCP mappings aren't available on DNS
Open, NormalPublicBUG


I ran into the issue as mentioned in, and attempted to use the solution as specified:

set service dhcp-server global-parameters "use-host-decl-names on;"

However, i have an issue with this solution - one of my servers print is available on multiple VLANs - main.local, print.local, and guest.local, and giving it a static IP in each causes dhcpd to fail. This is what the prepending of the dhcp shared network name was meant to solve.

I'd like these hostnames to still be available in dns, but keep the prepended shared network name in dhcpd.conf.

I suggest that when a static lease is added, the DHCP configuration script should add the machine's fqdn / ip address into /etc/hosts, and remove it when a static lease is removed.


Difficulty level
Unknown (require assessment)
VyOS 1.2.0-rolling+201805210337
Why the issue appeared?
Will be filled on close

Event Timeline

Inserting FQDN seems reasonable, but we need to think carefully when FQDN should come from, and if we use the "system domain-name" option, what should we do if it's not present.

syncer triaged this task as Normal priority.May 27 2018, 9:36 AM

Moving this out of 1.2.0, at least until we decide what to do when domain is not configured.

I've implemented this in our ansible-derived vyos configuration by allowing the static addresses to be generated with the VLAN prepended and adding a system static-host-mapping for the fqdn to ip.

Nothing vyos-side needs changing to do this, might be worth us documenting it as an option somewhere though?

set service dhcp-server shared-network-name VLAN{{vlan}} subnet {{network.address}} static-mapping {{static_lease.key}} ip-address {{static_lease.value.ip}}
set service dhcp-server shared-network-name VLAN{{vlan}} subnet {{network.address}} static-mapping {{static_lease.key}} mac-address {{static_lease.value.mac}}
set system static-host-mapping host-name {{static_lease.key}}.{{network.tag}} inet '{{static_lease.value.ip}}'
pasik added a subscriber: pasik.Mar 12 2019, 6:13 PM