This question already has an answer here:

I'm trying to get dns resolution of Avahi .local domains.

I can do:

$ avahi-resolve-host-name redacted.local
Redacted.local  10.xx.xx.xx

but not

ping redacted.local
ping: redacted.local: Name or service not known
share|improve this question

marked as duplicate by Zanna, Eric Carvalho, TheWanderer, karel, RPi Awesomeness Dec 19 '16 at 18:01

This question was marked as an exact duplicate of an existing question.

It appears that your machine is not configured to actually use Avahi to do (or assist) it's DNS lookups. Try adding the following to the /etc/resolvconf/resolv.conf.d/base file:

nameserver 127.0.0.1

The IP address might be different in your case, make sure that it points to the server running Avahi. Then reload your resolve configuration by running:

sudo resolvconf -u

The system should now (also) check your Avahi server to resolve redacted.local into an IP address.

share|improve this answer
    
I'm running out of the box ubuntu 16.10. I don't know what my nameserver is – Thomas Grainger Oct 28 '16 at 21:28
    
If you installed Avahi on the same machine from which you're trying to resolve the domain name, 127.0.0.1 should work. – Oldskool Oct 29 '16 at 9:37
    
As I said, I didn't install Avahi. It's supposed to be pre-installed and pre-configured. – Thomas Grainger Oct 31 '16 at 9:44
    
Where did you say that? You just said your using "out of the box ubuntu 16.10". And no, it's not supposed to be pre-installed and pre-configured on a new install. Somewhere, someone installed Avahi, but apparently did not take the time to configure it in such a way that the server uses Avahi's DNS zones for lookups. But try the steps I mentioned in my answer, it should get your lookups working. – Oldskool Oct 31 '16 at 16:10
    
avahi-resolve-host-name is definitely pre-installed – Thomas Grainger Nov 1 '16 at 10:08

I ran into the same problem. Looks like a known issue with libnss-resolve/systemd-resolved and /etc/nsswitch.conf. Check out this other answer on Ask Ubuntu:

Some other reading with alternate options for /etc/nsswitch.conf:

share|improve this answer
    
Thanks for contributing :) A couple of general points... If your answer is essentially a referral to another post on Ask Ubuntu, consider flagging the question as a duplicate instead. If you are posting links, please include the key information here. Answers should be complete in themselves as far as possible. – Zanna Dec 15 '16 at 12:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.