[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How does host lookup work



On Mon, Mar 23, 2009 at 09:28:27PM +0000, Alan Chandler wrote:
> I am extremely confused about host lookup works now that avahi daemon 
> has been added into the equation.
> 
> my /etc/nsswitch.conf file has this in it for the host entry
> 
> hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
> 
> But as much as I google, I can find absolutely no explanation of what 
> mdns4_minimal does.

its part of libnss-mdns
/usr/share/doc/libnss-mdns/README.Debian
https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/94940 (of interest) 



> 
> In particular - if one does a host lookup and its not found in files 
> (presumably /etc/hosts) and not found by mdns4_minimal, does 
> the "[NOTFOUND=return]" stop the lookup process from using the dns. (It 
> clearly doesn't - so presumably mdns4_minimal does something else)
> 
> Coupled with that - I am not sure if there is a command line command 
> which uses this mechanism of host lookup.  The man page for "host" 
> command and the one for the "dig" command effectily say they are only 
> doing a dns lookup.

something like ping uses the local machine host lookup mechinism, dig
talks DNS via the resolvers in /etc/resolv.conf


> 
> Why am I asking;
> 
> I am doing some planning on how to change my home network when I (very 
> shortly now) acquire a linux laptop.
> 
> I will want to use it to develop some simple javascript/php/html/css web 
> applications - and therefore will want to run apache web server.  
> Ideally I would like a number of separate virtual hosts, for each 
> separate application but
> 
> a) When I am disconnected from the network I still need to see the host 
> names (so I assume I use /etc/hosts to give aliases to localhost?)

sounds good, although there are problems when you use 127.0.0.1

> b) When I am connected to the local home network I want to have other 
> people see these virtual hosts so that I can test some multiuser 
> aspects of the applications.  In this case, I could either use avahi to 
> publish these names (although at the moment I can't quite work out 
> how - it seems only to publish a single host name derived from 
> the /etc/hostname), or make sure the names are properly identified in 
> my local dns (I can allocate the IP address based on the mac address of 
> the laptop thereby ensuring it always has the same one)

do the names need to be dynamic, why not make then static such that when
you are not there the web page times out!

I am not a big user of avahi or mdns

> 
> But without understanding the basics, I can't really proceed to plan.
> 
> Can someone explain.
> -- 
> Alan Chandler
> http://www.chandlerfamily.org.uk
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 

-- 
"It's clearly a budget. It's got a lot of numbers in it."

	- George W. Bush
05/05/2000
Reuters

Attachment: signature.asc
Description: Digital signature


Reply to: