resolving .local addresses

Tim Frost timfrost at xtra.co.nz
Sun Jun 28 08:07:23 UTC 2009


On Fri, 2009-06-26 at 22:42 -0700, Bill Moseley wrote:
> I'm moving to zeronconf discovery for my host names on the LAN.
> 
> I added search paths for my domain and also "local".
> 
> $ cat /etc/resolv.conf 
> domain hank.org
> search hank.org local
> nameserver 192.168.1.1
> 
> "bumby2" has a zeroconf host name bumby2.local, so with the above I
> see:
> 
> $ host -v bumby2
> Trying "bumby2.hank.org"
> Trying "bumby2.local"
> Trying "bumby2"
> Host bumby2 not found: 3(NXDOMAIN)
> Received 99 bytes from 192.168.1.1#53 in 17 ms

The host command is explicitly linked with the resolver libraries that
are part of the BIND name server package.  Because of that, it will ONLY
use DNS (by default, it queries the servers listed in /etc/resolv.conf,
but you can over-ride this by specifying a server on the command line),
and will NOT check /etc/nsswitch.conf.  As a result, the above means
that the DNS server at 192.168.1.1 can't find an entry for bumby2 in
either .hank.org or .local.
> 
> Yet,
> 
> $ ping bumby2.local
> PING bumby2.local (192.168.1.5) 56(84) bytes of data.
> 64 bytes from bumby2.local (192.168.1.5): icmp_seq=1 ttl=64 time=1.68
> ms

This means that the IP address for bumby2.local has been found by a
resolution method other than querying the name server at 192.168.1.1.  


> $ cat /etc/nsswitch.conf  | grep hosts
> hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
> 
Given that mdns4 is listed, I assume that there is an avahi server
somewhere on the LAN, and bumby2 must have successfully registered with
that server (but not with the DNS server).

> Tried changing the order, but no luck.  Anyone know if I can get host
> names qualified with .local?

The name server (the machine with IP address 192.168.1.1) needs to have
a zone named 'local'.  If you run DHCP, and the zone is dynamic, it is
possible to tell the DHCP server to do the dynamic updates.  If you
don't use DHCP, you have two choices:
1: for a dynamic zone, allow ANY device to do dynamic updates 
2: manually update the zone (whether the zone is static or dynamic)



> 
> 
> 
> -- 
> Bill Moseley
> moseley at hank.org
-- 
Tim Frost <timfrost at xtra.co.nz>





More information about the ubuntu-users mailing list