Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

localhost is returning someone elses machine! 1

Status
Not open for further replies.

dklloyd

MIS
Mar 9, 2001
78
GB
When we 'ping localhost' the returning IP address being returned is somewhere way out of our domain, possibly another country!
THere is an entry in hosts as follows:
127.0.0.1 loopback localhost # loopback (lo0) name/address
If we look at static routes in smit there is an entry for this strange IP address that uses a gateway reference of our way out into the world.
Doing a 'ping 127.0.0.1' is okay and pinging the machine name is okay also.
We've been using DNS lookup here for some time now and this has only just started to happen this week.

Any ideas anyone?

Thanks in advance....

DKLLOYD
 
Can you post the contents your /etc/hosts file? Seems as if there is an entry in there that has been messed up.
 
What is the IP address returned by "ping localhost" ?

Is it the 127.0.0.1 you referenced ?

If so, this is normal. All machines have 127.0.0.1 as an IP address for localhost.

Bill.
 
I think he is saying that it is not returning 127.0.0.1, but instead it is returning an IP from the other side of his gateway. But a ping of 127.0.0.1 returns OK.
 
A ping of localhost returns an address outside of our group which belong to another company that we have no link to.

The host file only contains the line mentioned in my 1st notice i.e.
127.0.0.1 loopback localhost # loopback (lo0) name/address

Thanks for the interest in this.....

 
If I ping loopback I get 127.0.0.1

Thanks

DKLLOYD
 
Very strange indeed....this is a stretch, but in your paste of the /etc/hosts info, there appear to be 2 or 3 spaces between loopback and localhost, can you verify? There should only be one space, but I don't think the hosts file really cares.
 
I have tried one space and tried a [tab] neither of which appears to make a difference. Is this dynamic or do I have to do anything else for the changed hosts file to be picked up?

DKLLOYD
 
You shouldn't have to do anything. In fact to test that, add an entry to the hosts file that reads:

127.0.0.1 localtest # This is an entry to test my hosts file
 
/etc/netsvc.conf should have "hosts=local,bind"
/etc/resolv.conf should have a &quot;search=<domain name>&quot; and no more than 3 &quot;nameserver=<IP Address of name server> lines.

Bill.
 
Well........... Changed the loopback localhost entry to a space as recommended from the responses. Found that somehow the netsvc.conf had gone missing. Recreated it as it should be (is there a difference between bind & bind4?) using bind and low & behold localhost now returns 127.0.0.1. Yee-hah.

Thanks everyone for the numerous replies, thought we were going for a record.

DKLLOYD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top