DHCP: hostnames of clients not resolving after update v1.2.3 -> 1.2-rolling

using

set service dhcp-server hostfile-update

VyOS should be able to resolve hostnames of clients supplied with an IP address
using DHCP. with v1.2-rolling-201911170217 VyOS fails to resolve these hostnames.
this worked when using v1.2.3

the hosts file (VyOS 1.2-rolling-201911170217) seems to be correct:

admin@vyos:~$ cat /etc/hosts

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

# Local host
127.0.0.1       localhost
127.0.1.1       vyos.lan vyos

# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

# From DHCP and "system static host-mapping"
192.168.1.150   macmini.lan

BTW, there seems to be a bug in v1.2.3:
the first entry in the hosts file is missing a carriage return
and then it fails to resolve that hostname. the subsequent ones
will work though.

VyOS v1.2.3:

admin@vyos:~$ cat /etc/hosts

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

# Local host
127.0.0.1       localhost
127.0.1.1       vyos.lan vyos

# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

# From DHCP and "system static host-mapping"192.168.1.150	 macosmini.lan	 #on-dhcp-event 00:00:0F:11:11:11
192.168.1.150	 macmini.lan	 #on-dhcp-event 00:00:0F:11:11:11

regards,
michael

Hi @mikeboss, in phabricator exists task ⚓ T1678 hostfile-update missing line feed
And now I tested this feature on 1.2-rolling-201911170217 , seems all works.

vyos@R1# run show version 
Version:          VyOS 1.2-rolling-201911170217
Built by:         autobuild@vyos.net
Built on:         Sun 17 Nov 2019 02:17 UTC
...
Copyright:        VyOS maintainers and contributors
[edit]
vyos@R1# sudo cat /etc/hosts

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

# Local host
127.0.0.1       localhost
127.0.1.1       R1

# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

# From DHCP and "system static host-mapping"
100.64.0.100	VPCS1	
[edit]
vyos@R1# run ping VPCS1
PING VPCS1 (100.64.0.100) 56(84) bytes of data.
64 bytes from VPCS1 (100.64.0.100): icmp_seq=1 ttl=64 time=1.53 ms
64 bytes from VPCS1 (100.64.0.100): icmp_seq=2 ttl=64 time=1.07 ms
^C
--- VPCS1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 1.072/1.301/1.531/0.232 ms

Provide please output of command ping macmini.lan

good morning!

sorry, I forgot to mention that the hostnames are resolved on VyOS itself but not on clients on the LAN. interestingly, pinging “macmini.lan” on macmini worked this morning (I let sit everything over night). but after restarting VyOS and the Mac mini, it again didn’t work. also tried with a Windows 10 client: the hosts are listed in /etc/hosts but they won’t resolve. internet hosts on the other hand are resolved flawless.

regards,
michael

Hello,
Agree. I think we need reload or restart pdns when file /etc/hosts updates
Can you try restart pdns for confirmation?

sudo /etc/init.d/pdns-recursor restart

yup, confirmed! after the command

sudo /etc/init.d/pdns-recursor restart

the hostname was resolved successfully.

regards,
michael

@mikeboss can you create bug-report on https://phabricator.vyos.net/ with this issue?

will do! I just created an account, waiting for approval…

thnx for the approval!

it looks like user “c-po” this afternoon already opened up a bug report about this issue:
https://phabricator.vyos.net/T1812

@mikeboss the fix for this has been merged, so once the new rolling builds in a bit, can you test and confirm that it’s fixed?

Thanks

good morning!

just installed the latest build:

admin@vyos:~$ sh ve
Version:          VyOS 1.2-rolling-201911190217
Built by:         autobuild@vyos.net
Built on:         Tue 19 Nov 2019 02:17 UTC
Build UUID:       8dbc995f-e2ee-4b38-a941-f72efcdf04e0
Build Commit ID:  e7a834c040cbd9

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  PC Engines
Hardware model:   apu2
Hardware S/N:     1186034
Hardware UUID:    Unknown

Copyright:        VyOS maintainers and contributors

unfortunately, the /etc/hosts file now does not show any entries from client hosts at all.

regards,
michael

The rolling that builds a bit later will have the fix now. Temporarily made it worse (with an invalid syntax), which was fixed now

okay, will soon try again with the latest build…

nice! I can confirm that the latest build fixed it. THNX.

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