Can’t ping localhost in Linux (Successfully resolved)
$ ping localhost
ping: unknown host localhost
below is the solution If you unable to ping localhost in Linux:
==============================================================
/etc/hosts
Verify that the /etc/hosts file has entires for localhost which looks like the following:
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
/etc/nsswitch.conf
The file /etc/nsswitch.conf requires specific permissions. Verify that it is set to 644.
#chmod 644 /etc/nsswitch.conf
Also verify that /etc/nsswitch.conf has an entry like the following:
hosts: files dns
==============================================================
$ ping localhost
ping: unknown host localhost
below is the solution If you unable to ping localhost in Linux:
==============================================================
/etc/hosts
Verify that the /etc/hosts file has entires for localhost which looks like the following:
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
/etc/nsswitch.conf
The file /etc/nsswitch.conf requires specific permissions. Verify that it is set to 644.
#chmod 644 /etc/nsswitch.conf
Also verify that /etc/nsswitch.conf has an entry like the following:
hosts: files dns
==============================================================
Thanks Yogesh.
ReplyDeleteThanks Yogesh.... Really helpful.. !!!
ReplyDeleteThanks Yogesh for your useful info
ReplyDelete