[K12OSN] help with /etc/hosts file and 127.0.0.1

Les Mikesell les at futuresource.com
Thu Jul 21 03:21:25 UTC 2005


On Wed, 2005-07-20 at 17:51, Gary Frederick wrote:

> 1: is having the hostname return a name that maps to 127.0.0.1 trouble?
> 
> 2: is removing 127.0.0.1 a bad idea?
> 
> any and all details that will help me understand are much appreciated.

Usually you want:
127.0.0.1   localhost.localdomain   localhost
in /etc/hosts and all the other names/addresses in DNS.  It wouldn't
hurt anything to add the other machine names to that line but it
could lead to surprises later.  For example if you forget doing that
and later replace this machine with a new one and change this one's
hostname and IP, any attempt from this machine to connect to the
new one with its old name will go to the loopback instead.

Removing 127.0.0.1 completely is a bad idea because some programs
that bind to all interfaces are unhappy if they can't look up
a name to match the address.  If you come up with the network
disconnected and can't reach the DNS server it may take a long
time for sendmail, samba, etc. to start - but then they aren't
going to work anyway...

-- 
  Les Mikesell
    les at futuresource.com





More information about the K12OSN mailing list