1820256 Members
2599 Online
109622 Solutions
New Discussion юеВ

nslookup is not working

 
SOLVED
Go to solution
Andrew_80
Advisor

nslookup is not working

Quick question,
When I do nslookup "return" It doesn't give me
the Using /etc/hosts on:

>prompt

my nsswitch.conf file is OK.
hosts: files [NOTFOUND=continue] dns
services: files
protocols: files
networks: files
rpc: files
netgroup: files


Any ideas ??
The Sky is the Limit
5 REPLIES 5
MANOJ SRIVASTAVA
Honored Contributor

Re: nslookup is not working

Andrew

Theserver resolves the names of itself and of the other servers using either DNS server or /etc/hosts , for nslookup to work and if you are using the DNS service the server uses the nsswitch.conf to know in what order the server name can be resolved and also /etc/resolv.conf which should have the entry for the ip adress of the Name server , so the server will look at that server to resolve the name.

For your problem the issue can be either the resolv.conf is not pointing to the coreect server or the Name server itslef is not working . You can rename the /etc/resolv.conf to some test file and then the server will use /etc/hosts to resolve the name , this way you can isolate the problem


Manoj Srivastava

Denver Osborn
Honored Contributor

Re: nslookup is not working

Have you tried moving nsswitch.conf aside and creating a new one with only "hosts: files [NOTFOUND=continue] dns"?

I'd also check that you have an up to date bind patch installed on the box.

-Denver
Steven E. Protter
Exalted Contributor

Re: nslookup is not working

hosts: dns[notfound=continue unavail=continue tryagain=continue]
files

Those are my settings. Your system is not rolling over to dns when /etc/hosts failes. Perhaps the notfound, tryagain and unavail messages would work for you.

hosts: files[notfound=continue unavail=continue tryagain=continue]
dns

If the /etc/resolv.conf isn't pointing to a valid dns server, then the behavior is probably normal. If the dns server is valid it should be checked and the nsswitch change might be warranted.

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
Bill Hassell
Honored Contributor
Solution

Re: nslookup is not working

Stop using the automatic features of nslookup and nsswitch.conf and explicitly talk to your DNS server(s) with nslookup as in:

nslookup some_host 12.34.56.78

where the IP address is the first DNS server in /etc/resolv.conf. If this seems to hang, then the server is dead or refuses to talk to you. It will take 15-20 seconds to timeout. Then try the next DNS server and if you have one, the third server. If none of your DNS servers are responding (or blocked by your router/gateway) then it will take nslookup almost a minute to finally timeout. It is ALWAYS a good idea to put files first rather than DNS in /e/tc/nsswitch.conf since you'll always resolve your local name instantly. That also verifies that nslookup is working as it should. But when an address is needed that is found only on the DNS server(s), a hang indicates DNS or networking problems. I would also add the UNAVAIL entry as in:

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

You will also find nsquery much more useful in tracking down hostname lookup issues (nsquery is a fairly new tool for HP-UX).


Bill Hassell, sysadmin
Andrew_80
Advisor

Re: nslookup is not working

Actually my default route was missing, It is working now.

Thanks for your help
The Sky is the Limit