Issue description:
Using static mappings in the dhcp server config section allows to hand the same "reserved" IP to the same hosts whenever they connect. If service dhcp-server hostfile-update is set, the /etc/hosts will get updated with the hostname and IP address upon successful connection.
However, since the DHCP configuration also has a shared-network-name, this name, followed by an underscore, will preceed the host name and thus break resolution.
Example:
set service dhcp-server hostfile-update set service dhcp-server shared-network-name WIFI subnet 192.168.XX.YY/24 static-mapping myhost ip-address 192.168.XX.ZZ set service dhcp-server shared-network-name WIFI subnet 192.168.XX.YY/24 static-mapping myhost mac-address 00:11:22:33:44:55 set service dhcp-server shared-network-name WIFI subnet 192.168.XX.YY/24 domain-name mydomain.local set service dhcp-server shared-network-name WIFI subnet 192.168.XX.YY/24 domain-search mydomain.local commit
Resulting entries in /etc/hosts:
192.168.XX.YY WIFI_myhost.mydomain.local.mydomain.local 192.168.XX.YY WIFI_myhost.mydomain.local
Expected behavior:
There should only be one additional entry in /etc/hosts:
192.168.XX.YY myhost.mydomain.local
Workaround:
Disable hostfile updates:
delete service dhcp-server hostfile-update commit && save