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

Re: localhost in /etc/hosts



Michelle Konzack wrote:
Am 2006-11-13 02:07:52, schrieb David Jardine:


To muddy the water a little more, I have

127.0.0.1	quash	localhost	loopback


This is definitivly wrong!

An /etc/hosts file can have only 3 fields plus comment.
It should be

127.0.0.1		localhost	localhost	# Localhost

IP.OF.THE.SYSTEM	<fqdn>		<hostname>	# My Computer

What you write disagrees with my man page:

This manual page describes the format of the /etc/hosts file. This file is a simple text file that associates IP addresses with host- names, one line per IP address. For each host a single line should be
       present with the following information:


              IP_address canonical_hostname aliases


Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a
       comment, and is ignored.

AIUI, any number of fields may be present. Here is my hosts entry for my
machine:

127.0.0.1            Presario-1 localhost.localdomain localhost

My machine name is "Presario-1", the string "localhost.localdomain" can
be just about anything, and one of the aliases needs to be "localhost"
or lots of bad things can happen. One could just as well have

127.0.0.1 FreddyPoo FreddyPoo.com localhost Freddy Barney

If I read it aright, then the machine name would be FreddyPoo, with
aliases localhost, Freddy, and Barney. The only important fields
are the 127.0.0.1, and the localhost alias. The domain entry and other
aliases are optional. A minimal workable entry is

127.0.0.1 localhost

I'm sure others will correct me if I'm wrong :-)

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!



Reply to: