I'm having DNS issues on a new install of Ubuntu 16.04:
kqs@mycomputer:~$ nslookup localserver
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find localserver: NXDOMAIN
But if I specify the DNS server (or sometimes if I just wait awhile), it works:
kqs@mycomputer:~$ nslookup localserver 192.168.0.1
Server: 192.168.0.1
Address: 192.168.0.1#53
Name: localserver.localdomain
Address: 192.168.0.24
And this is the same DNS server that shows up first in Network Manager:
kqs@mycomputer:~$ nmcli device show
IP4.ADDRESS[1]: 192.168.0.152/24
IP4.GATEWAY: 192.168.0.1
IP4.ROUTE[1]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]: 192.168.0.1
IP4.DNS[2]: 131.215.254.100
IP4.DNS[3]: 131.215.139.100
It seems to be the same problem as "dnsmasq sometimes resolves things, sometimes it doesn't" and "Intranet address resolution and dnsmasq", but in that solution they disable dnsmasq
by commenting out the dns=dnsmasq
line in /etc/NetworkManager/NetworkManager.conf
.
However, I'd like to troubleshoot dnsmasq
rather than bypassing it completely.
So my questions are:
- My understanding is that
dnsmasq
is a lightweight DNS server running on my computer. Presumably, the Network Manager DNS settings are used to configurednsmasq
, but ultimately it isdnsmasq
that is solely responsible for handling DNS lookups (with the help of upstream DNS servers as it deems necessary). Is this correct? - Can I see how
dnsmasq
is handling a particular DNS lookup? i.e. is it answering it from its cache? Which upstream DNS server is it forwarding it to? - Can I instruct
dnsmasq
to use a particular DNS server for the local domain?