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.

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)

Advertisement

15 thoughts on “Avahi and dot-local addresses on Ubuntu Gutsy

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

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

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

  4. Thank you for this! This helped me resolve an issue authenticating against my .local Activate Directory domain in Kali.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s