[avahi] domain search path

Alan Chandler alan at chandlerfamily.org.uk
Tue Apr 28 11:58:18 PDT 2009

On Tuesday 28 April 2009, Matt LaPlante wrote:
> Please excuse the noob nature of this question, but I didn't see it
> covered in the FAQ.  I run a very mixed environment on my LAN, and
> while I traditionally have used dynamic dns to deal with host
> lookups, it's a definite pain to implement.  The good side of it was
> that (when working) I could have my local zone in my search path and
> hit any host by name from any application.  I've installed avahi to
> see if mDNS could solve my hostname coordination problem across
> platforms in a less monstrous way.  So far it seems to be working
> superbly, but I don't like having to type .local in order to resolve
> a host.  No big deal on occasion, but major overhead when done
> repeatedly!  Is there a way to search the .local domain during
> lookups so i can just ssh [hostname] and have it work?  I do *not*
> use a .local unicast domain.

I'm playing around with this too - although not in quite the same way (I 
have a router box that acts as a dhcp server - necessary so I can 
allocate a specific address to my web/mailserver PC and port forward to 
it - but want to ensure if the internet drops out and the box fails, I 
can still do cross machine backups via the names of the machine).

I think (only from reading the man pages) that /etc/resolv.conf is your 
first stop, with a domain entry in their being what gets added to a 
short name to turn it into a name to query with.  

The problems with that is that it tends to get created dynamically by 
your dhchlient program from information provided by your dhcp server, so 
you may have to step back there.

If you aren't using dhcp (for example with avahi-autoipd, or via a 
static address) then the resolver says is gets the domainname from the 
hostname command.  If you look in the manual for that, it says it gets 
that from the /etc/hosts file, so maybe that implies a line like yourhostname.local yourhostname localhost

Alan Chandler

More information about the avahi mailing list