4

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
0

2 Answers 2

0

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.

7
  • I'm running out of the box ubuntu 16.10. I don't know what my nameserver is Oct 28, 2016 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, 2016 at 9:37
  • As I said, I didn't install Avahi. It's supposed to be pre-installed and pre-configured. Oct 31, 2016 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, 2016 at 16:10
  • avahi-resolve-host-name is definitely pre-installed Nov 1, 2016 at 10:08
0

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:

1
  • 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, 2016 at 12:54

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