2

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[1]:                             192.168.0.4
IP4.DNS[2]:                             185.37.37.37

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

Contents of resolv.conf:

# 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

Contents of /etc/network/interfaces:

# 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.

/etc/NetworkManager/NetworkManager.conf :

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false
  • In your /etc/network/interfaces there are no interfaces defined except the localhost loopback .. so I guess you are using some kind of network manager? Please show us the config of this one , too. – derHugo Jul 19 '17 at 5:28
  • @derHugo: done. In the networork connections GUI, I left everything at default (DHCP etc) and added 192.168.0.4 as 'additional DNS' – Nino van Hooff Jul 25 '17 at 20:28
  • Someone suggested disabling IPv6 will make it work. I know I turned mine off a while ago for unrelated problems. – WinEunuuchs2Unix Jul 25 '17 at 20:38

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.