Avahi and dot-local addresses on Ubuntu Gutsy September 28, 2007
Posted by andrewgdotcom in Linux.Tags: avahi, local, mDNS, ubuntu
trackback
I’ve noticed a problem with avahi and *.local addresses on ubuntu gutsy
- this will probably have cropped up on other distributions, or will do
soon. It is related to the similar Mac *.local problem.
It is thus: if you have avahi (aka zeroconf) installed, *.local
addresses are resolved via mDNS first. The default config of avahi is to
fail if mDNS is enabled and the host is not found in mDNS. This means
that you cannot resolve addresses under .local which are
in DNS but not mDNS.
To fix, edit /etc/nsswitch.conf and remove the text “[NOTFOUND=return]“
as follows:
hosts: files mdns4_minimal dns mdns4 #hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
You then need to restart the problem software. Avahi still works, but
will fail over to standard DNS if the host cannot be resolved via mDNS.

>To fix, edit /etc/nsswitch.conf and remove the text >“[NOTFOUND=return]“
>as follows:
>hosts: files mdns4_minimal dns mdns4
>You then need to restart the problem software. Avahi still >works, but
>will fail over to standard DNS if the host cannot be resolved via >mDNS.
The “fix” has it backwards: mDNS should come LAST and work only when a properly configured DNS server is not available.
If you want mDNS (I’m not sure why you would, but I digress), here is the correct line for nsswitch.conf:
hosts: files dns mdns4_minimal mdns4
Happy Trails
[...] Avahi and dot-local addresses on Ubuntu Gutsy from The Fifth Wheel of andrewg for more [...]
[...] offered by Avahi, so I just uninstalled it (sudo apt-get remove avahi-daemon). Alternatively, here is a receipt for disabling the special treatment of .local, but keeping the rest of the daemon [...]
.local addresses are avoidable, actually, if you host your own domain (mydomain.net). If you use BIND, look in to setting up separate ‘internal’ and ‘external’ views.
If I was setting a domain up now, I wouldn’t use .local. Unfortunately I’m working in an existing environment…