What to pick for "localhost.localdomain"?

Tim ignored_mailbox at yahoo.com.au
Tue Apr 11 08:18:08 UTC 2006


On Sat, 2006-04-08 at 20:53 -0400, B Wooster wrote:
> Having run Linux for years now, with multiple machines behind a
> broadband router, I still am totally unclear on the concept of what to
> pick for "localhost" and "localdomain" when installing a new box.

"localhost" needs to remain associated with "127.0.0.1".  The additional
"localhost.localdomain" seems to be peculiar to some Linuxes, and I'd
still keep it as-is, for the sake of consistency.

The first *real* line in your hosts file should remain unadulterated as:
127.0.0.1  localhost.localdomain  localhost

Add other hostnames separately.  Whether that be to an interface, or a
variation on the 127.0.0.x network.  As you'll have read, don't just
invent names willy-nilly.  Initially I just expanded on the localdomain
idea, as it seems highly unlikely to get used as a real
top-level-domain.

e.g. 127.0.0.1    localhost.localdomain  localhost
     192.168.0.1  one.localdomain        one
     192.168.0.2  two.localdomain        two
     192.168.0.3  three.localdomain      three

Later, when I got my own domain, I just picked on it for my LAN, as well.

There are some reserved names set aside not to be allowed to be
registered for real internet domains:  localhost, test, example.com, and
invalid, with one exception (example.com does exist, but your own use of
it shouldn't going to cause problems for other people).  There's an RFC
about this.

Though I do wish they'd set aside something short for LANs, like "lan".
It'd save a lot of people headaches over this sort of thing.  Someone
could even register a domain for public use with 200 odd prepared
sub-domains, using people's names all associated with differnet
192.168.0.x addresses, so you could just suck it in and re-use it.

NB:  All of this applies whether you mess with the hosts file or a local
DNS server.

-- 
(Currently running FC4, occasionally trying FC5.)

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.




More information about the users mailing list