can't resolve localhost
Hello,
I cannot ping my oun machine by using the hostname. It will work fine using the IP. Typing hostname will give me the correct hostname. The /etc/hosts has all the correct entries. Can someone give me a clue as to how to fix it? Thanks very much! |
Is the loopback device up?
ifconfig |
Yes, the lo device 127.0.0.1 is up.
|
What do you have in your hosts file:
cat /etc/hosts |
As I said, the /etc/hosts file is fine and no change to it will correct the problem. Here it is anyway... This has always worked, but now I can't ping linea.
127.0.0.1 linea localhost.localdomain localhost 192.168.1.103 linea The problem has something to do with the resolver and is not a typical tweak. Thanks for taking shots at it. |
Are you able to ping "localhost"? If not, you might have a problem with your nsswitch.conf file.
|
Nope, can't ping localhost. Here is my nsswitch.conf file. In "hosts:" I moved "nis" to the end of the line so it would be sure to find "files" . Nada.
passwd: compat group: compat hosts: files dns nis services: nis [NOTFOUND=return] files networks: nis [NOTFOUND=return] files protocols: nis [NOTFOUND=return] files rpc: nis [NOTFOUND=return] files ethers: nis [NOTFOUND=return] files netmasks: nis [NOTFOUND=return] files netgroup: nis bootparams: nis [NOTFOUND=return] files publickey: nis [NOTFOUND=return] files automount: files aliases: nis [NOTFOUND=return] files |
What is the exact error message when you try to ping "localhost". Also, please post the output of your resolv.conf file.
|
[root@linea root]# ping localhost
ping: unknown host localhost cat /etc/resolv.conf nameserver 63.249.95.8 nameserver 63.249.95.9 nameserver 192.168.1.1 Seems like resolv.conf would be the problem but I have my router and 2 DNS servers listed. When I boot up I get," Could not look up Internet address for linea. It may be possible to correct this problem by adding lines to /etc/hosts. Thanks |
First of all what distro are you using? I think there maybe an error in your /etc/hosts file. You can try renaming it and then re-entering it manually into a new file. Sometimes there's a file corruption of some type that can't be seen visually.
|
I'm using RedHat 9.
Tried eliminating any possable errors in the hosts file by creating another manually. No difference. I did notice that I can't ping anything in the host file. The /etc/hosts file is not being read, even when I create a new one with just a couple of lines. This all started when I attempted to upgrade MySql and found I had to also upgrade the libraries... This must have screwed up something relating to the resolver. Thanks for your Ideas and feedback aznluvsmc. |
Do you know what libraries you upgraded?
|
Are you using nscd? Try turning it off then ping:
service nscd stop ping localhost |
127.0.0.1 linea localhost.localdomain localhost
192.168.1.103 linea _____________________________ can u remove linea in the second coloumn and try.. something like 127.0.0.1 localhost.localdomain localhost 192.168.1.103 linea |
Not running nscd. The /etc/hosts file isn't read no matter what is listed in any order. It must have something to do with ld.so, glibc or libc libraries as these are the aRPMs I attempted to upgrade. Tried doing a Redhat upgrade, but now think I'll have to do a complete install which is overkill to fix a broken library. Thanks.
|
All times are GMT -5. The time now is 04:28 PM. |