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

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



Reco <recoverym4n@gmail.com> writes:

>  Hi.
>
> On Thu, Sep 04, 2014 at 08:26:38PM -0400, Podrigal, Aron wrote:
>> Any idea what can be the cause? I am installing proxmox-ve and when
>> starting pve-cluster it fails with [main] crit: Unable to get local
>> IP address. So I tried
>> to look up with host utility and it does not resolve.
>> 
>> host localhost
>> Host localhost not found: 3(NXDOMAIN)
>
> This is the way it should be - you DNS tells you that it knows nothing
> about localhost hostname (because host utility only does DNS requests).
> If you need to test the validity of /etc/hosts, you should use:
>
> getent hosts localhost
>
>
>> /etc/hosts
>> 127.0.0.1       localhost
>> 
>> 
>> in /etc/nsswitch.conf  I have
>> hosts:          files dns
>
> While this may look good, I believe you're missing a customary entry
> pointing to your hostname in /etc/hosts. I.e.
>
> <your_static_ip_here> <your_hostname_here>
>
> Reco

Not to derail the thread (hence the subject change) but being
something of a lamer about how all this works and seeing it carefully
laid out by Bob P.  was very informative, as are Reco, Jonathan
... etc.

Though my question is a minor one it will probably require a quick
summary of my setup:

   Debian (jessie)
  Single user (really simple) setup on home lan.  No trick stuff 
  going on.

This was close to a vanilla install.  The only things that might be
considered a little unusual for such a simple setup was using the
exim4-heavy pkg (I wanted a small mail hub for the lan), and setting
up a webserver.

So cutting to the chase:
I'm a bit puzzled by what seems like a curious line in my
nsswitch.conf.

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.  

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

Aside:
My lan is totally fictitious, right out of my pea brain 10.0.0.0/
and `hostname -f dv.local.lan'.

The 10.0.0.0/ is forced by comcasts new style modem/router/wifi
hardware that used that IP.  It can all be changed, of course, but
would still be fictitious.


Reply to: