1826677 Members
2660 Online
109696 Solutions
New Discussion

Re: ping localhost

 
SOLVED
Go to solution
Rfinley
Occasional Contributor

ping localhost

I have several 9000/800/A500-44 servers running 11i and networked. They cannot reslove "localhost" even though the /etc/hosts file has the entry 127.0.0.0 localhost. I really need these machines to resolve this name. Can anybody tell me what is going on and what I need to do to solve it?

Thanks!
9 REPLIES 9
Uday_S_Ankolekar
Honored Contributor

Re: ping localhost

Can you ping to the Ip address??
ping 127.0.0.0

If you can able to ping IP address then You need to check DNS setup.

Look /etc/nsswitch.conf and /etc/resolv.conf for DNS

-USA..

Good Luck..
Rfinley
Occasional Contributor

Re: ping localhost

Yes I can ping 127.0.0.0. What should I be looking for in DNS setup. I seem to have no problens with any other networking.
Uday_S_Ankolekar
Honored Contributor

Re: ping localhost

Well, Then

Are you using DNS??

Check for /etc/nsswitch.conf
It should look like this fir the hosts :

hosts: files [NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]

-USA..
Good Luck..
Sachin Patel
Honored Contributor

Re: ping localhost

If you are using DNS for resolver then you should have entry in your main forward lookup file something like

localhost IN A 127.0.0.1

If you do not have this put it up increment the serial number and restart the named.

Check /etc/named.conf file in your dns server it should look for
zone "0.0.127.in-addr.arpa" {
type master;
file "named.local";
};

if you do not have this entry in your named.conf file add it.
Create a file called named.local (remember file name can be different).
This file will look like this

#cat named.local
;
; @(#)named.local 1.1 (Berkeley) 86/01/21
;
$TTL 86400
@ IN SOA mayday.dgc.com. root@
dgc.com. (
1002 ; Serial No
10800 ; Refresh every three hours
3600 ; Retry every hour
604800 ; Expire every 7 days
86400 ) ; Minimum TTL every 8 hours
;
; Servers for dgc.com
;
IN NS mayday.dgc.com.
;
1 IN PTR localhost.

Is photography a hobby or another way to spend $
Steven E. Protter
Exalted Contributor
Solution

Re: ping localhost

Quick DNS guide:

/etc/nsswitch.conf as noted above.

/etc/resolv.conf

This tells the system where to look for DNS resolution. These guys need to resolve names not defined in /etc/hosts


To test

nslookup local_host_name

This should resolve and it should tell you whether it worked in files for DNS. The server providing the information should be identified.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sachin Patel
Honored Contributor

Re: ping localhost

Forget to say that if you have 127.0.0.1 entry in your /etc/hosts file then just edit /etc/nsswitch.conf file for hosts entry.

hosts: files dns

Now nslookup will first look in to /etc/hosts file if it will not find the answer then it goes to dns.

Sachin
Is photography a hobby or another way to spend $
Francisco J. Soler
Honored Contributor

Re: ping localhost

Be sure in /etc/hots the entry localhost is 127.0.0.1 not 127.0.0.0 like you say in your post.

Frank.
Linux?. Yes, of course.
Rfinley
Occasional Contributor

Re: ping localhost

OK, I got it working now.
I tweaked the /etc/nsswitch.conf to look at the /etc/hosts file first and all is well.

Thanks for the help.
Jon Finley
Honored Contributor

Re: ping localhost

Hey.. Rfinley.. send me an email!

Jon
js_finley@hotmail.com
"Do or do not. There is no try!" - Yoda