need help/understanding with /etc/hosts.....

Stuart Sears stuart at sjsears.com
Thu Oct 7 17:30:37 UTC 2004


On Thursday 07 Oct 2004 16:05, bruce wrote:
> hi...
>
> i'm trying to install an app 'condor' which communicates betwen machines.
> i've got it on two test machines linux (rh8.0), but the app seems to be
> having a problem in communicating with each other...
>
> i can 'see' each box from the other box by pinging the respective boxes.
by name or IP address?
>
> however, i'm getting some form of warning that appears to point to the
> /etc/hosts file. can someone tell me what/how the /etc/hosts file is
> supposed to be.. and what the problem might be with my version, as well as
> how it might be corrected.
The /etc/hosts file is a local name resolution file - it is the first place 
your system looks when it needs to translate a hostname into an IP address.
You can put hosts on your local network in here if you don't have a local 
nameserver to do this for you.

ideally you should have your system's hostname specified in there, if only to 
reduce network traffic for unnecessary lookups. Condor seems to need a 
reverse lookup to succeed on your hostname (reverse= IP -> hostname) before 
it will work.

<snip>
>WARNING: Condor is running on the loopback address (127.0.0.1) of this
>machine, and is not visible to other hosts!  This may be due to a
>misconfigured /etc/hosts file. Please make sure your hostname is not listed
>on the same line as localhost in /etc/hosts.   

> the /etc/hosts file is:
> [root at lserver5 etc]# cat /etc/hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1               lserver5 localhost.localdomain localhost
ah. This could be your problem. RTFEM (EM = Error Message ) :-)
> 192.168.1.57            lserver7
condor wants a separate ip address for you hostname and will not accept the 
localhost line. lserver5 _does_ have another ip address, right? is the hosts 
file on each of your boxes like this?
ideally you should have a hosts file a bit like this:
# IP address FQDN   Short hostname
127.0.0.1  localhost.localdomain localhost
192.168.1.52  lserver2
192.168.1.57  lserver7
192.168.1.55  lserver5
...and so on.
The IPs must be the correct ones for you local network.
Do your machines not have FQDNs? If they do, then put them in as well.

> is there something that i should do to the /etc/hosts file. why am i able
> to ping/access the 'central manager' machine (lserver5) from the client
> machine (lserver2) by simply 'ping lserver5'....
well, if you have a line in /etc/hosts to resolve it to an IP address of 
course you can. Can you ping the client from the server?

Regards

Stuart

-- 
Stuart Sears RHCE, RHCX
Quidquid latine dictum sit, altum viditur 




More information about the redhat-list mailing list