tl:dr my ubuntu 16.04 system often struggles to resolve DNS that my colleagues (mostly using OSX/mac) have no problems with. We're all using 8.8.8.8 from the same wifi network. The domains in question are AWS urls that are frequently created or updated. Having read this question - I fear my nsswitch.conf doesn't make sense.
/etc/nsswitch.conf
contains the line:
hosts: files mdns4_minimal [NOTFOUND=return] dns
Does that look right? If I understand rightly it will check (in order) hosts file, mdns (local dns?) then fail before it would check dns servers?
running the command nmcli dev show | grep DNS
(from this question - how to know what dns I am using) returns the following:
IP4.DNS[1]: 8.8.8.8
IP4.DNS[2]: 8.8.4.4
I've also checked my hostfile doesn't contain any unexpected clashing entries. Where else should I look for clues?
The DNS lookups fail consistently (ie - it's not a slow DNS server that fails on the first attempt until a value is cached).
An example failed nslookup (with the domain changed to remove work domain) looks like:
> nslookup example.somedomain.com: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
*** Can't find example.somedomain.com: No answer
Online nslookup tools can resolve the urls correctly, and reveal that the time to live is 59 seconds, pretty short but not crazy.
Edit: More information (which I don't really understand, but may help an expert) after reading a few more questions:
the above nslookup seems to be using a local DNS server (127.0.1.1
) using nslookup but explicitly setting the dns server resolved the URLs correctly:
> nslookup example.somedomain.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: example.somedomain.com
Address: 10.116.[blah].[blah]
Name: example.somedomain.com
Address: 10.116.[blah].[blah]
/etc/NetworkManager/NetworkManager.conf
looks like the following:
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
#dns=dnsmasq