jump to navigation

Avahi and dot-local addresses on Ubuntu Gutsy September 28, 2007

Posted by andrewgdotcom in Linux.
Tags: , , ,
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.

Comments»

1. Loye Young - June 11, 2008

>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

2. oneangrydwarf » Blog Archive » .local Domains on Ubuntu Desktop - November 2, 2008

[...] Avahi and dot-local addresses on Ubuntu Gutsy from The Fifth Wheel of andrewg for more [...]

3. Martin Wolf’s weblog » Blog Archive » Why ‘.local’ is a bad choice for an internal domain - May 15, 2009

[...] 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 [...]

4. Rich - May 23, 2009

.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.

5. Andrew Gallagher - May 23, 2009

If I was setting a domain up now, I wouldn’t use .local. Unfortunately I’m working in an existing environment…