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
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.
127.0.0.1
should work.
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
: