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

Re: /etc/hosts format WAS [Re: host hostname not found]



 Hi.

On Thu, 11 Sep 2014 16:43:53 -0400
Harry Putnam <reader@newsguy.com> wrote:
 The `hosts' entry:
> 
>   hosts:      files myhostname mdns4_minimal [NOTFOUND=return] dns
> 
> What does all that mean?  I understand `files' first and `dns' at the
> end but none of what is in between.  

Every hostname → IP resolving and every IP → hostname resolving goes
in the following order:

1) /etc/hosts

2) libnss-myhostname
I honestly don't know what scares me most about libnss-hostname - the
need of it in the first place, the author of the library, software that
behaves funny without it or the setups that genuinely need it :(

3) avahi-daemon
Uses funny IPs from 169.254.0.0/16 range and (in)famous .local domain.
Not needed if you have DNS in your LAN.

NOTFOUND=return belong to mdns4_minimal in this setup, and, according
to nsswitch.conf(5), means 'The lookup succeeded, but the requested
entry was not found'.

In this particular case it means 'regardless of result of queries to
resolve anything in .local domain - stop here, don't go further'.

4) Plain good old Domain Name Server, or several, according to
the /etc/resolv.conf (or its equivalent if resolvconf is used).


> Further, I'm wondering if; where it says myhostname... it is supposed
> to be edited with my actual host name?

No, please read the output of 'apt-cache show libnss-myhostname'. It'll
explain this 'myhostname' thing to you better that I can.


Reco


Reply to: