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.
Alternatively, you can change the default suffix that avahi uses for mDNS, by adding the following to the [server] section of /etc/avahi/avahi-daemon.conf:
domain-name=.alocal
(H/T Josh McIntyre)
>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
you can remove the mdns4_minimal entirely if you don’t want to fail *.local look ups that aren’t in mdns
.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…
Thanks for this post. It was very helpful.
Many thanks to this post! I was about to pull my hair out!!
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.
oh bless you, this was driving me nuts.
Thank you for this! This helped me resolve an issue authenticating against my .local Activate Directory domain in Kali.
http://avahi.org/wiki/AvahiAndUnicastDotLocal
“sudo nano /etc/avahi/avahi-daemon.conf”
Add “domain-name=.alocal” to the [server] section.
“sudo reboot”
Aha, that’s a good fix. I’ll update the post.