I've got DNSMasq running on 192.168.0.4. It maps nino-nas to 192.168.0.7. However, I have to manually request a DNS lookup to make it work. My DNS entries seem properly configured:
nino@nino-ubuntu:~$ nmcli device show enp38s0 | grep IP4.DNS IP4.DNS: 192.168.0.4 IP4.DNS: 18.104.22.168
Yet the hostname is not resolved:
nino@nino-ubuntu:~$ ping nino-nas ping: unknown host nino-nas
Manually requesting a dns lookup:
nino@nino-ubuntu:~$ dig nino-nas ; <<>> DiG 9.10.3-P4-Ubuntu <<>> nino-nas ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29058 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;nino-nas. IN A ;; ANSWER SECTION: nino-nas. 0 IN A 192.168.0.7 ;; Query time: 0 msec ;; SERVER: 127.0.1.1#53(127.0.1.1) ;; WHEN: Tue Jul 18 23:54:34 CEST 2017 ;; MSG SIZE rcvd: 53
The the server ip: 127.0.1.1. It seems we already had the mapping and don't need to request it from 192.168.0.4? Now the same ping command works:
nino@nino-ubuntu:~$ ping nino-nas PING nino-nas (192.168.0.7) 56(84) bytes of data. 64 bytes from nino-nas (192.168.0.7): icmp_seq=1 ttl=64 time=0.224 ms 64 bytes from nino-nas (192.168.0.7): icmp_seq=2 ttl=64 time=0.283 ms 64 bytes from nino-nas (192.168.0.7): icmp_seq=3 ttl=64 time=0.249 ms
What could be the issue? Ubuntu version: 16.04
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1
# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback
Note that other devices in the network also have trouble resolving these names. In my TP-Link router, I have set 192.168.0.4 as primary DNS in DHCP settings.
Update @derHugo : it seems I am using Network-Manager, which is default since 15.04 ubuntu docs.
[main] plugins=ifupdown,keyfile,ofono dns=dnsmasq [ifupdown] managed=false