Avahi, .local domain and DNS lookup

Avahi logoIf you have a .local domain, you could encounter the following problem: You can resolve hostname, but not FQDN. This is most likely caused by the Avahi and configuration of nsswitch.conf. Avahi is an implemention of Apple’s Bonjour. It can automatically advertise and discover network services and hosts. By default Avahi uses .local domain. I will not be debating on whether it’s appropriate to use .local domain, the fact is there are a lot of these domains out there. Now the important part. Your /etc/nsswitch.conf could contain a line like this:

hosts: files mdns4_minimal [NOTFOUND=return] dns

Translation: When resolving hostname, look in hosts file, if not found use Avahi, if not found quit. Important is that it will quit only when Avahi will know the domain (.local by default) and won’t find the hostname in it.

Solutions are multiple:

  1. Change nsswitch.conf file, remove [NOTFOUND=return]
  2. Set Avahi to use another domain in /etc/avahi/avahi-daemon.conf, option domain-name=local

Some applications might need restart (eg. Remmina) after making changes in nsswitch.conf.

This entry was posted in Linux and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>