Operating System - HP-UX
1753893 Members
7758 Online
108809 Solutions
New Discussion юеВ

how to use nslookup to search 2nd DNS server

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

how to use nslookup to search 2nd DNS server

I am trying to resolve a hostname, but it is existed on on 2nd DNS server, not the on the default one. without changing /etc/resolv.conf, how to search different DNS server within nslookup?

Thanks,
none
7 REPLIES 7
Pete Randall
Outstanding Contributor
Solution

Re: how to use nslookup to search 2nd DNS server

According to the man page, you can specify the server:

nslookup [-option ...] host-to-find [server]


Pete

Pete
Vinod Kumar Yadav
Trusted Contributor

Re: how to use nslookup to search 2nd DNS server

Hi,

Frist check with resolv.conf then u got the dns entery in the that file.

Use the following step to resolve.


root # nslookup 135.37.9.18
Using /etc/hosts on: ts330

looking up FILES
Name: gab200dns.qip.hp.com
Address: 135.37.9.18

ah330 root # nslookup gab200dns.qip.hp.com
Using /etc/hosts on: ts330

looking up FILES
Name: gab200dns.qip.hp.com
Address: 135.37.9.18

ah330 root # nslookup 135.38.244.3
Using /etc/hosts on: ts330

looking up FILES
Trying DNS
Name: mo3980dns.qip.hp.com
Address: 135.38.244.3

Then u got the primay DNS & seconday DNS.


Thanks
Jai Shiv Shankar
Pete Randall
Outstanding Contributor

Re: how to use nslookup to search 2nd DNS server

Every one of those nslookups returns the fact that it is using /etc/hosts and not a dns server at all. To use a specific dns server, specify it in the nslookup command as I originally said.

# cat /etc/resolv.conf
domain holstein.com
nameserver 140.1.0.240
nameserver 140.1.0.239
# nslookup hp.com 140.1.0.240
Name Server: nsa.holstien.com
Address: 140.1.0.240

Trying DNS
Non-authoritative answer:
Name: hp.com
Addresses: 15.192.45.138, 15.192.45.139, 15.200.2.21, 15.200.30.21
15.200.30.22, 15.200.30.23, 15.200.30.24, 15.216.110.21, 15.216.110.22

15.216.110.139, 15.216.110.140, 15.192.45.21, 15.192.45.22

# nslookup hp.com 140.1.0.239
Name Server: nsb.holstien.com
Address: 140.1.0.239

Trying DNS
Non-authoritative answer:
Name: hp.com
Addresses: 15.216.110.139, 15.216.110.140, 15.192.45.21, 15.192.45.22
15.192.45.138, 15.192.45.139, 15.200.2.21, 15.200.30.21, 15.200.30.22
15.200.30.23, 15.200.30.24, 15.216.110.21, 15.216.110.22

#


Pete

Pete
Pete Randall
Outstanding Contributor

Re: how to use nslookup to search 2nd DNS server

Pete

> Every one of those nslookups returns the fact that it is using /etc/hosts and not a dns server at all.

Not true. The third one looks to DNS, but I'm still confused by what is being attempted.


Pete

Pete
Andrew C Fieldsend
Respected Contributor

Re: how to use nslookup to search 2nd DNS server

I usually force the server by using nslookup's command line:

# nslookup
> server
>

I'm curious why the hostname doesn't exist on both servers? DNS was designed as a distributed, resilient name service, and assumes that everything is the same whichever server you use (excluding zone propagation delays).
Suraj K Sankari
Honored Contributor

Re: how to use nslookup to search 2nd DNS server

Hi,
See the example

User: nslookup toolah.fourex.oz wurrup.fourex.oz
System: Server: wurrup
Address: 101.3.104.12

Name: toolah.fourex.oz
Address: 101.3.100.2

If you want to know more about nslookup see the below link.

http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.halu101/f1a1c260347.htm

Suraj

Re: how to use nslookup to search 2nd DNS server

feeling a little schizophrenic today Pete? Talking to yourself isn't generally a good sign... ;o)

Duncan

I am an HPE Employee
Accept or Kudo