1829656 Members
9006 Online
109992 Solutions
New Discussion

ping localhost fails

 
v_8
New Member

ping localhost fails

In my RHL 8.0, I can "ping 127.0.0.1" but not "ping localhost". Replies with an "unknown host" error.

3 REPLIES 3
Jerome Henry
Honored Contributor

Re: ping localhost fails

In a shell enter neat, or redhat-config-network, or hit hat menur / system tools /control of network peripherical (could be slightly different name, I'm translating from my box on french menus), select your NIC, configure, and on the host section, check that you should have a line with '127.0.0.7 localhost.localdomain localhost' (being IP name Alias sections).
This effect is due to the fact that your IP is not linked to you machine short name.
Re-start network.
hth
J
You can lean only on what resists you...
U.SivaKumar_2
Honored Contributor

Re: ping localhost fails

Hi,

Edit /etc/hosts
127.0.0.1 localhost localhost.localdomain

Save the file.

#ping localhost

that's it.

regards,
U.SivaKumar
Innovations are made when conventions are broken
Caesar_3
Esteemed Contributor

Re: ping localhost fails

Hello!

Check the permisions of your /etc/hosts file
and see that you have read permisions on it.
If it's OK check that you have a line in the file /etc/hosts : 127.0.0.1 localhost
if not add it, then it should work.

Caesar