VMS Help
TCPIP Services, NSLOOKUP
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
NSLOOKUP is a debugging tool provided with BIND that allows
anyone to directly query a name server and retrieve information.
Use NSLOOKUP to determine if your local name server is running
correctly or for retrieving information from remote servers.
NSLOOKUP makes direct queries to name servers around the world to
obtain DNS information, including:
o Host names and addresses on the local domain
o Host names and addresses on remote domains
o Host names that serve as mail exchangers (MX records)
o Name servers for a specific zone
1 - Starting and Stopping
|
NSLOOKUP Options shows how to start and stop NSLOOKUP.
Table 1-1 NSLOOKUP Options
Action Type This...
Run NSLOOKUP $ RUN SYS$SYSTEM:TCPIP$NSLOOKUP.EXE
Terminate > exit
NSLOOKUP
from within
interactive mode
Terminate the > Ctrl/z
current NSLOOKUP
session
Display online > HELP
help
To run NSLOOKUP as a foreign command, enter the following command
at the $ prompt or place the command in your login.com file:
$NSLOOKUP :== RUN SYS$SYSTEM:TCPIP$NSLOOKUP.EXE
You can then run an interactive NSLOOKUP session by entering:
$NSLOOKUP
>
You can put NSLOOKUP set commands in an initialization file,
SYS$LOGIN:NSLOOKUPINIT.INI. The commands are executed when you
start NSLOOKUP.
NSLOOKUP:
o Command line must be less than 256 characters.
o Interprets unrecognized commands as host names.
o Is partly case-sensitive. It:
o Accepts lowercase
o Accepts uppercase
o Does not accept mixed case
When NSLOOKUP first starts, you see the name and address of the
default BIND server, followed by the NSLOOKUP prompt.
NSLOOKUP Commands lists the NSLOOKUP commands:
Table 1-2 NSLOOKUP Commands
Command Function
host [ server ] Looks up information using the current default
server or using the server you specify. Enter
the name of the host for which you need an IP
address.
server domain Changes the default server to the domain you
specify.
lserver domain Changes the default server.
root Changes the default server to server specified
by the root option.
ls Lists information about hosts in the domain
you specify. The default output contains host
names and their IP addresses. The options
for ls are listed in Options to the NSLOOKUP
Command.
help or ? Prints a summary of the available commands.
exit Exits NSLOOKUP.
set Selects the type of information that NSLOOKUP
displays.
NSLOOKUP has options which influence the type of information you
receive from a query and the way NSLOOKUP behaves. Some of the
options take a value and others are boolean options. The options
have default values and can be changed by using the set command.
You obtain a list of the options and their default values by
entering the set all command immediately after starting an
interactive NSLOOKUP session.
You can change the type of information output from a query: The
default query type is A.
4.1 - A Type Query
This is the default NSLOOKUP querytype. It returns the name
and IP address of a host. The following NSLOOKUP session
shows a query for the host apple. The query to the server
condor.lgk.dec.com is successful and the server returns the IP
address 16.99.208.10.
$ nslookup
Default Server: condor.lgk.dec.com
Address: 16.99.208.53
> apple
Server: condor.lgk.dec.com
Address: 16.99.208.53
Name: apple.lgk.dec.com
Address: 16.99.208.10
>
If you enter a domain name without a trailing period, NSLOOKUP
appends the default domain to the name. You can change the
default domain with the set domain or set srchlist commands.
To lookup up a host not in the current domain, append a period to
the name as shown:
$NSLOOKUP apple.koz.dec.com.
4.2 - PTR Type Query
To obtain the host name for an IP address, change the querytype
to PTR and enter the IP address as shown in the following
example:
> set type=ptr
> 16.99.208.189
Server: condor.lgk.dec.com
Address: 16.99.208.53
Name: dove.lgk.dec.com
Address: 16.99.208.189
You can also use the PTR querytype to obtain more information
about a domain as the following examples shows:
> lgk.dec.com
Server: condor.lgk.dec.com
Address: 16.99.208.53
lgk.dec.com
origin = condor.lgk.dec.com
mail addr = postmaster.lgk.dec.com
serial = 1998101948
refresh = 3600 (1H)
retry = 300 (5M)
expire = 604800 (1W)
minimum ttl = 43200 (12H)
>
4.3 - MX Type Query
To obtain information about mail exchanger records, set the
querytype to MX and enter a domain. The output will tell you
which host(s) handles mail for the specified domain.
> set type=mx
> lgk.dec.com
Server: condor.lgk.dec.com
Address: 16.99.208.53
lgk.dec.com preference = 200, mail exchanger = crl.dec.com
lgk.dec.com preference = 50, mail exchanger = collie.lgk.dec.com
lgk.dec.com preference = 100, mail exchanger = mail13.digital.com
lgk.dec.com preference = 100, mail exchanger = mail11.digital.com
lgk.dec.com preference = 200, mail exchanger = mail2.digital.com
lgk.dec.com nameserver = collie.lgk.dec.com
lgk.dec.com nameserver = condor.lgk.dec.com
lgk.dec.com nameserver = hageln.lgk.dec.com
crl.dec.com internet address = 192.58.206.2
collie.lgk.dec.com internet address = 16.99.208.100
mail13.digital.com internet address = 192.208.46.30
mail2.digital.com internet address = 204.123.2.56
condor.lgk.dec.com internet address = 16.99.208.53
hageln.lgk.dec.com internet address = 16.99.208.10
4.4 - SOA Type Query
The SOA querytype returns the domain's start-of-authority
information.
> set type=soa
> microsoft.com
Server: condor.lgk.dec.com
Address: 16.99.208.53
microsoft.com
origin = dns1.microsoft.com
mail addr = msnhst.microsoft.com
serial = 1998101204
refresh = 7200 (2H)
retry = 1800 (30M)
expire = 2592000 (4w2d)
minimum ttl = 86400 (1D)
microsoft.com nameserver = dns3.nwnet.net
microsoft.com nameserver = dns4.nwnet.net
microsoft.com nameserver = dns1.microsoft.com
microsoft.com nameserver = dns2.microsoft.com
microsoft.com nameserver = dns1.moswest.msn.net
microsoft.com nameserver = dns2.moswest.msn.net
dns3.nwnet.net internet address = 192.220.250.7
dns4.nwnet.net internet address = 192.220.251.7
dns1.microsoft.com internet address = 131.107.1.7
dns2.microsoft.com internet address = 131.107.1.240
4.5 - NS Type Query
To obtain information about the name servers for a particular
zone, set the querytype to NS and then enter the desired zone.
The following example shows the nameservers for the microsoft.com
zone.
> set type=ns
> microsoft.com
Server: condor.lgk.dec.com
Address: 16.99.208.53
Non-authoritative answer:
microsoft.com nameserver = dns2.microsoft.com
microsoft.com nameserver = dns1.moswest.msn.net
microsoft.com nameserver = dns2.moswest.msn.net
microsoft.com nameserver = dns3.nwnet.net
microsoft.com nameserver = dns4.nwnet.net
microsoft.com nameserver = dns1.microsoft.com
Authoritative answers can be found from:
dns2.microsoft.com internet address = 131.107.1.240
dns3.nwnet.net internet address = 192.220.250.7
dns4.nwnet.net internet address = 192.220.251.7
dns1.microsoft.com internet address = 131.107.1.7
>
If you want to use another name server as your default server,
use the server command.
$ nslookup
Default Server: condor.klg.dec.com
Address: 16.99.208.53
> server ns01.koz.dec.com
Default Server: ns01.koz.dec.com
Address: 16.99.9.20
If for some reason the default server is not responding, you can
always use the lserver command to change the default server. The
lserver command uses the initial default name server to lookup
the IP address of the new server.
> lserver collie.klg.dec.com
Default Server: collie.klg.dec.com
Address: 16.99.208.10
Or, if you already know the IP address of the new server, you can
use the server command to reset the default server.
>server 16.99.208.10
> server 16.99.99.226
Default Server: beagel.zok.dec.com
Address: 16.99.99.226
6 - Listing Domain Information
|
The ls command lists information about a domain. This command is
useful for:
o Determining the number of hosts within a domain
o Hostnames and their IP addresses
o Troubleshooting DNS problems
Table 1-3 Options to the NSLOOKUP ls Command
Option Function
-a Lists aliases of hosts in the domain (CNAME entries)
-d Lists all the entries in the domain
-h Lists CPU and operating system information for the
domain (HINFO entries)
-m Lists mail exchangers (MX) entries in the domain
-s Lists well known services (WKS) in the domain
-t Lists a specified entry type
The following examples shows the use of the ls command to obtain
address records for all hosts within a zone.
> ls -t a lgk.dec.com
[condor.lgk.dec.com]
@ 12H IN A 16.99.208.208
dhcp-253 12H IN A 16.99.208.253
ucxv4a 12H IN A 16.99.208.129
beavis 12H IN A 16.99.208.90
boxmor 12H IN A 16.99.208.30
kempo 12H IN A 16.99.208.47
pacnet 12H IN A 16.99.208.84
kwai 12H IN A 16.99.208.63
alxica 12H IN A 16.99.9.37
ppponvms 12H IN A 16.99.208.104
a71kt 12H IN A 16.99.208.142
peteathome 12H IN A 16.99.208.101
larisa 12H IN A 16.99.208.49
pigdog 12H IN A 16.99.208.140
ntruder 12H IN A 16.99.208.110
In the following example, the ls command displays alias records
for hosts within the lgk.dec.com domain.
> ls -a lgk.dec.com
[condor.lgk.dec.com]
$ORIGIN LGK.DEC.COM.
celics 12H IN CNAME celtics
news 12H IN CNAME nntpd.KLG.DEC.COM.
tiger 12H IN CNAME ntruder
console 12H IN CNAME bblts.KLG.DEC.COM.
deebug 12H IN CNAME dot
ayla 12H IN CNAME ayla.KLG.DEC.COM.
cscibm 12H IN CNAME cscibm.KLG.DEC.COM.
>
Using the -m option obtains the MX records for hosts within the
lgk.dec.com domain which the following example shows.
> ls -m lgk.dec.com
brigit 12H IN MX 10 brigit
12H IN MX 100 mail1.digital.com.
12H IN MX 100 mail2.digital.com.
12H IN MX 200 crl.DEC.com.
piglet 12H IN MX 10 piglet
12H IN MX 100 mail1.digital.com.
12H IN MX 100 mail2.digital.com.
12H IN MX 200 crl.DEC.com.
tieta 12H IN MX 10 tieta
12H IN MX 100 mail1.digital.com.
12H IN MX 100 mail2.digital.com.
12H IN MX 200 crl.DEC.com.
sherry 12H IN MX 10 sherry
12H IN MX 100 mail1.digital.com.
12H IN MX 100 mail2.digital.com.
12H IN MX 200 crl.DEC.com.
In the following example, using the -s option displays the well
known services for a domain.
> ls -s lgk.dec.com
[condor.lgk.dec.com]
WKStesthave 12H IN WKS 16.99.208.255 21 ( )
WKStesthavenot 12H IN WKS 16.99.208.255 255 ( )
WKStestnumbers 12H IN WKS 16.99.208.255 255 ( 21 23 )
You can redirect the output from this command to a file which is
helpful when the domain consists of a large number of hosts. Once
the file is created, you can look at its contents with the DCL
TYPE command.
> ls -t a klg.dec.com > systems.txt
[condor.klg.dec.com]
#############
Received 932 answers (0 records).
$ TYPE SYSTEMS.TXT
> ls -t a klg.dec.com
[condor.klg.dec.com]
$ORIGIN KLG.DEC.COM.
@ 12H IN A 16.99.208.208
dhcp-253 12H IN A 16.99.208.253
ucxv4a 12H IN A 16.99.208.129
beavis 12H IN A 16.99.208.90
boxmor 12H IN A 16.99.208.30
kempo 12H IN A 16.99.208.47
pacnet 12H IN A 16.99.208.84
kwai 12H IN A 16.99.208.63
alxica 12H IN A 16.99.9.37
ppponvms 12H IN A 16.99.208.104
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.