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
vyos@R1# run show version
Version: VyOS 1.2-rolling-201911170217
Built by: [email protected]
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
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.
admin@vyos:~$ sh ve
Version: VyOS 1.2-rolling-201911190217
Built by: [email protected]
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.