1832084 Members
3223 Online
110037 Solutions
New Discussion

nslookup

 
Huseyin Utlu
Occasional Advisor

nslookup

Hi to all,
In my linux config the host name search path is :hosts, dns. When i run nslookup the search order is still dns and i don't see the server name i put in the hosts file..! Do i make a mistake, or should i change something else to get the host name search path : hosts, dns?

Thanks in advance.
Huseyin
10 REPLIES 10
Alexander M. Ermes
Honored Contributor

Re: nslookup

Hi there.
Try this way :
hosts: files [NOTFOUND=CONTINUE UNAVAIL=CONTINUE] dns [NOTFUND=return UNAVAIL=continue TRYAGAIN=return]

Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Alexander M. Ermes
Honored Contributor

Re: nslookup

Hi there.
Sorry, wrong OS.
hosts, dns is ok. Did you enter your dns servers in the hosts file ? They should be
in the resolv.conf . Can you put a sample in a reply ?
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Huseyin Utlu
Occasional Advisor

Re: nslookup

Hi,
I will give an example:
hosts file:
127.0.0.1 localhost
130.240.70.60 server1.abc.nl
130.240.70.65 server2.abc.nl

nsswitch.conf file:
#hosts db files nisplus nis dns
hosts: files dns

host.conf file:
order hosts, dns
multi on

resolv.conf file:
nameserver 130.240.1.2
nameserver 130.240.2.2


So, the server2 is not in the domain name service. When i run nslookup server2 on server1
the dns says that server2 cannot be found. The search order is hosts then dns isn't ?
What is wrong?

Huseyin
Maik Danstedt
Occasional Advisor

Re: nslookup

Hi Huseyin,

your configuration looks ok, but is it right that you tried the command:
"nslookup server2"
on server1?
In your /etc/hosts server2 is not an alias name for 130.240.70.65. Try the follwoing:
130.240.70.65 server2.abc.nl server2
in the /etc/hosts of server1. Or you have to run nslookup as the following:
"nslookup server2.abc.nl"

hope that helps,
MaDMaik
I haven't lost my mind! I backed it up on tape somewhere...
Huseyin Utlu
Occasional Advisor

Re: nslookup

Hi Maik,

I tried that already, even that will not work...

Maybe nslookup is different on Linux and HPUX servers?

Bye.
Huseyin
Sachin Patel
Honored Contributor

Re: nslookup

Hi
Do you have search entry on /etc/resolv.conf.
search domain.com
nameserver xxx.xxx.xxx.xxx

Also move your hosts.conf file to different name, restart the named and try nslookup.
We have same setting as you mention. It works fine. We do not have hosts.conf file.

Sachin
Is photography a hobby or another way to spend $
Maik Danstedt
Occasional Advisor

Re: nslookup

Hi Huseyin,

what does nslookup say if you just start it up without any parameters?


Maik
I haven't lost my mind! I backed it up on tape somewhere...
Huseyin Utlu
Occasional Advisor

Re: nslookup

Hi Maik,

If i start nslookup, it says: the dns is found and the ip adress is shown.
Default Server: zmd.abc.nl
Address: 130.240.1.2

But, we are going to put the server2 host name in the dns, this will work, because the dns is in the search order.
Thanks anyway.
Bye
Huseyin
Laurent Paumier
Trusted Contributor

Re: nslookup

Don't use nslookup, it will not look /etc/hosts file. nslookup is a tool for testing DNS queries. Try a command like ping server2 and see if it resolves the name...

Re: nslookup

Hi
nslookup will look for nis/nis+ and dns etc. But if you make a connection it will definitely check fot the hosts file first. You can try this by giving an alias to a host in your /etc/hosts file and try pinging or telneting to that host. It will work...

Manoj