/etc/hosts and localhost

Anderson Lizardo andersonlizardo at yahoo.com.br
Sun Jan 18 18:08:28 PST 2004

On Sunday 18 January 2004 21:32, Ryan.Oliver at pha.com.au wrote:
> > localhost.localdomain localhost
> >
> > now becomes:
> >
> > localhost
> >
> > This shouldn't break anything
> Nope
> > but I thought I'd better the get word out just
> > in case someone envisages a problem.
> Not with LFS... the former is more correct though...

I would not say "more correct". This is that kind of practice not documented 
anywhere, but that became "official" because most popular distros started 
using it. AFAIK, the reservation of the ".localdomain" TLD for loopback 
purposes is not documented anywhere, and is not garanteed that someday a 
general-purpose .localdomain TLD will not exist. (But if you know some 
official doc that says .localdomain is reserved for loopback use, don't 
hesitate to send the link to me :P).

And, finally, removing "localhost.localdomain" from the loopback entry should 
not cause no problem at all, even the so-called "Sendmail problem on systems 
with no FQDN defined". When we don't have a network card, we use: <value of HOSTNAME>.example.org <value of HOSTNAME> localhost

and the system's FQDN (the "hostname -f" output) becomes "<value of 
HOSTNAME>.example.org". If we have a network card, we use: localhost <value of HOSTNAME>.example.org <value of HOSTNAME>

and the FQDN becomes, again, <value of HOSTNAME>.example.org. 
"localhost.localdomain" is never seen by the system, except, of course, if 
you explictly use "localhost.localdomain" on some configuration file.

Anderson Lizardo

More information about the lfs-dev mailing list