Avahi and dot-local addresses on Ubuntu Gutsy
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.
Tags: avahi, local, mDNS, ubuntu
You can comment below, or link to this permanent URL from your own site.
June 11, 2008 at 7:37 am
>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
January 12, 2011 at 6:40 pm
you can remove the mdns4_minimal entirely if you don’t want to fail *.local look ups that aren’t in mdns
November 2, 2008 at 7:43 pm
[...] Avahi and dot-local addresses on Ubuntu Gutsy from The Fifth Wheel of andrewg for more [...]
May 15, 2009 at 7:12 pm
[...] 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 [...]
May 23, 2009 at 6:25 pm
.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.
May 23, 2009 at 8:35 pm
If I was setting a domain up now, I wouldn’t use .local. Unfortunately I’m working in an existing environment…
February 6, 2010 at 2:09 am
Thanks for this post. It was very helpful.
June 2, 2010 at 3:55 pm
Many thanks to this post! I was about to pull my hair out!!
October 28, 2010 at 2:56 am
gets more interesting with vpnc. original domain=xxx.com, vpn domain=yyy.local.
so first hhh.yyy.local would not resolve owing to avahi. after that was fixed, hhh would not resolve to hhh.yyy.local owing to the vpnc mods. /etc/vpnc/vpnc-script modifies /etc/resolv.conf when vpnc is run.
before running vpnc:
domain xxx.com
search xxx.com
after running vpnc:
domain yyy.local
search xxx.com
‘search’ overrides ‘domain’ as they are mutual exclusive and ‘search’ was specified later. so vpnc-script had to be modified to add both domains to search like so:
search xxx.com yyy.local
and life went on.
May 22, 2013 at 6:15 pm
oh bless you, this was driving me nuts.