On Thu, 2002-07-04 at 14:50, Rob Saul wrote:
> On Wednesday 03 July 2002 10:48, Anthony E. Greene wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On 03-Jul-2002/20:53 -0400, Jay Daniels <[EMAIL PROTECTED]> wrote:
> > >On Wed, 2002-07-03 at 19:57, Emmanuel Seyman wrote:
> > >> On Wed, Jul 03, 2002 at 07:27:46PM -0400, Jay Daniels wrote:
> > >> > Then why is the structure of the /etc/hosts backward from any unix
> > >> > book I have ever read?
> > >>
> > >> You have a structure different from:
> > >>
> > >> IP_address       FQDN    alias1  alias2
> 
> 
> This is the same format I've always used. However, I just looked
> at /etc/hosts on a system run by a friend who has years of sys-admin
> experience and found it has both formats and they seem to work
> equally well.
> 
> Perhaps its a matter of where and/or when one started dealing with
> this sort of thing.  What a given book says may depend on the authors
> background as much as anything.
> 
>       ~Rob
> 
> -- 
> Rob Saul.:|:[EMAIL PROTECTED]:|:.de recta non tolerandum sunt
> 

The "hosts" file was superceded by DNS.  The only reason you would need
a FQDN in the hosts file at all is for the gateway machine to reference
the box by the FQDN without DNS or some other machine on the network to
reference the box or if you want to use a short name like the hostname
part to address the machine.

To keep with conformity and avoid using the line that says DO NOT REMOVE
THIS LINE on redhat linux. You can use this format instead... 

<ip_address> <hostname> <alias>

Now if you had put the localhost as 
127.0.0.1       localhost.localdomain localhost

When you ping it would output localhost.localdomain.  This isn't right. 
But if you put...
<ip>    <hostname>      <domain>

127.0.0.1       localhost       localhost.localdomain
192.168.1.1     engima          enigma.mydomain.com

...ping outputs localhost as expected and ouputs enigma if you ping
enigma!

You do not want the hostname on the line that loopback address line
because if you ping the machine name then it would return 127.0.0.1
instead of the ip address of the lan interface which is 192.168.1.1 in
my case.  

The slackware documentation also address this problem and warns users to
NOT put the hostname on the loopback address line.

Now, you have removed the long line that says DO NOT REMOVE THIS LINE OR
SERVICES MAY FAiL and thus create some conformity in the hosts file!
There is actually no need insert the FQDN in the hosts file unless of
course you run some service such as a webserver and you want to address
the server by the FQDN without using the remote DNS server just like if
you are on the internet and not on your local lan.

Why would you even put a line like this, it serves no purpose.

<ip_address>    <FQDN>

As I stated before, I don't not know which is actually correct, but I
know FQDN is not even needed except for the above purposes I have
stated.  Other services like mysqld or sendmail may fail if you remove
the localhost.localdoamin completely.

Perhaps someone from RedHat can address this?



jay




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to