I've recently done a fresh install of Ubuntu 15.10 and I'm experiencing problems accessing hosts on my local network.

Just an example:

host printer.mydomain.local

works perfectly, returns the actual hostname (printer is a cname) and corresponding IP address.

Trying to connect, or even pinging this hostname does not work:

ping printer.mydomain.local

returns: ping: unknown host printer.mydomain.local

however "ping printer" does work.

Already tried commenting out the dnsmasq line in /etc/NetworkManager/NetworkManager.conf added mydomain.local to /etc/avahi/avahi-daemon.conf

all to no avail. What am I missing?

local DNS server is bind9 on Ubuntu 12.04


1 Answer 1


Looks like I found my solution: edit /etc/nsswitch.conf and change the 'hosts' line. the default value is:

"hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname"

Move the option "dns" forward so it sits before the "mdns4_minimal" option to fix the problem.

The actual reason why the problem ocurred is that because my home network domain was .local (picked that up from working too long in windows environments), but because .local is used in zero-conf setups with mDNS instead of trying to resolve using DNS it only used mDNS.

This is working by design to reduce .local queries to the root-servers on the internet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .