Re: First line in /etc/hosts
Mark Brown writes:
> ...NIS needs to hand out the IP address of the machine...
Machines don't have IP numbers. Interfaces have IP numbers. Every machine
with one or more external interfaces has at least two: 127.0.0.1 for the
loopback interface and one for each external interface.
> Resolving the hostname is a standard method for obtaining an IP address
> for the machine...
Every machine with more than one interface has at least two hostnames:
localhost on network 127 and something else on the external networks.
Routers often have different hostnames on different external interfaces.
I think there are two problems here: some packages make assumptions about
*the* IP number and/or *the* hostname, and /etc/hosts gets misconfigured
either by buggy software or the admin.
The purpose of /etc/hosts is to associate IP numbers with hostnames. I can
see no good reason to associate 127.0.0.1 with any name other than
localhost. It is also not always necessary for all of a machine's IP
numbers and/or hostnames to appear in /etc/hosts.
(I'm sure you know all this, Mark, but I'm not sure everyone else in the
thread does. I *am* sure that some people writing Linux programs don't.)