Operating System - HP-UX
1827807 Members
3041 Online
109969 Solutions
New Discussion

Re: nslookup does not return the information of the hosts file

 
SOLVED
Go to solution
Lora Ganeva
Regular Advisor

nslookup does not return the information of the hosts file

I have HP-UX server running 11.0 and my DNS works correctly, but when I make an "nslookup" for a host not defined in DNS but only in /etc/hosts the messages is:
TRYING DNS
looking up FILES
No address information is available for ....

It seems that the /etc/hosts is correct.

Any help would be appreciated
13 REPLIES 13
Praveen Bezawada
Respected Contributor

Re: nslookup does not return the information of the hosts file

Hi
This could be a permission problem with /etc/hosts. On our machine it's 555 and ownership is bin:bin.
And I hope that the syntax in hosts file is correct.

...BPK...
Alex Glennie
Honored Contributor

Re: nslookup does not return the information of the hosts file

check permissions & ownership on /etc/hosts ?

post copy of etc/hosts & /etc/nsswitch.conf ... should read ->

hosts: dns [ NOTFOUND = continue ] files

would be useful.
melvyn burnard
Honored Contributor

Re: nslookup does not return the information of the hosts file

Have you configured /etc/nsswitch.conf to do this?
example of my nsswitch.conf file is:

# See the Adminstering Internet Services Manual and the switch(4) man
# page for more information on the name service switch.
#

hosts: dns [NOTFOUND=continue] files
services: files
protocols: files
networks: files
rpc: files
netgroup: files
automount: files


My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Lora Ganeva
Regular Advisor

Re: nslookup does not return the information of the hosts file

My /etc/nsswitch.conf is:
hosts: dns [NOTFOUND=continue UNAVAILABLE=continue TRYAGAIN=continue] files[NOTFOUND=return UNAVAILABLE=continue TRYAGAIN=return]
Alex Glennie
Honored Contributor

Re: nslookup does not return the information of the hosts file

try Melvins copy ?
Lora Ganeva
Regular Advisor

Re: nslookup does not return the information of the hosts file

Thank You very much. I've tried all of this but it didn't help.
Alex Glennie
Honored Contributor

Re: nslookup does not return the information of the hosts file

Can I see

ll /etc/hosts ?

copy of /etc/hosts ?

This should work :( if above are correct and you are using Melvins copy of nsswitch.conf.
Sachin Patel
Honored Contributor

Re: nslookup does not return the information of the hosts file

Hi Lora,
What Alex says should work. I have create same setup in my system.

In my /etc/hosts file I have add one dummy system name. I run nslookup and it didn't work. I changed the nsswitch.conf file
hosts dns [NOTFOUND=continue] files
and it works. Remove the entry after "files" on nsswitch.conf.

Sachin

Is photography a hobby or another way to spend $
Joseph C. Denman
Honored Contributor

Re: nslookup does not return the information of the hosts file

Hi Lora,

I have had this problem before. If you set up your nsswitch.conf file as Melv stated. This it should work if permissions are correct. Not only the permissions of hosts, but also nsswitch.conf. Try this.

1. Check /etc/hosts and /etc/nsswitch.conf for correctness.

2. chmod 444 /etc/hosts /etc/nsswitch.conf

That should do it.

...jcd...
If I had only read the instructions first??
Mark van Hassel
Respected Contributor
Solution

Re: nslookup does not return the information of the hosts file

Hi Lora,

I encountered the same problem on HP-UZ 11.00 a few years back. I believe its a bug in nslookup since other commands like ping and telnet do work properly. I did sent it to HP but still have not received an answer, so I don't know if a patch is available. The solution is to change the order in /etc/nsswitch.conf around to resolve local files first:
hosts: files [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
Alex Glennie
Honored Contributor

Re: nslookup does not return the information of the hosts file

try installing PHNE_23274 Bind patch if Mark is correct, reading the patch documentation he could be.
Mark van Hassel
Respected Contributor

Re: nslookup does not return the information of the hosts file

Alex is correct, the patch solves the problem.
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
Lora Ganeva
Regular Advisor

Re: nslookup does not return the information of the hosts file

Hi,
Thank You very much for Your help. Only changing the order of DNS and Files in /etc/nsswitch.conf worked. I haven't installed the patch , but I'm going to di it tomorrow.
Thanks a lot