NSLOOKUP(8) | System Manager's Manual | NSLOOKUP(8) |
nslookup
— query
Internet name servers interactively
nslookup |
[-option ...]
[host-to-find |
- [server]] |
nslookup
is a program to query Internet
domain name servers. nslookup
has two modes:
interactive and non-interactive. Interactive mode allows the user to query
name servers for information about various hosts and domains or to print a
list of hosts in a domain. Non-interactive mode is used to print just the
name and requested information for a host or domain.
Interactive mode is entered in the following cases:
Non-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. The optional second argument specifies the host name or address of a name server.
The options listed under the
“set
” command below can be specified
in the .nslookuprc file in the user's home directory
if they are listed one per line. Options can also be specified on the
command line if they precede the arguments and are prefixed with a hyphen.
For example, to change the default query type to host information, and the
initial timeout to 10 seconds, type:
nslookup -query=hinfo -timeout=10
Commands may be interrupted at any time by typing a control-C. To
exit, type a control-D (EOF
) or type
exit
. The command line length must be less than 256
characters. To treat a built-in command as a host name, precede it with an
escape character (‘\’).
N.B.: An
unrecognized command will be interpreted as a host name.
A
or PTR
, the name of the
host is returned. If host is a name and does not
have a trailing period, the default domain name is appended to the name.
(This behavior depends on the state of the set
options domain
, srchlist
,
defname
, and search
.)
To look up a host not in the current domain, append a period to the name.
server
domainlserver
domainlserver
uses the initial server to look up
information about domain, while
server
uses the current default server. If an
authoritative answer can't be found, the names of servers that might have
the answer are returned.root
ns.internic.net
is
used. (This command is a synonym for “lserver
ns.internic.net
”.) The name of the root server can be
changed with the “set root
”
command.finger
[name] [>
filename]finger
[name] [>>
filename]set
querytype
=A
” command). The
name is optional. >
and
>>
can be used to redirect output in the
usual manner.ls
[option] domain
[>
filename]ls
[option] domain
[>>
filename]-t
querytype-a
-t
CNAME
”.-d
-t
ANY
”.-h
-t
HINFO
”.-s
-t
WKS
”.When output is directed to a file, hash marks are printed for every 50 records received from the server.
view
filenamels
command(s) with more(1).help
?
exit
set
keyword[=value]all
set
. Information about the current default
server and host is also printed.class
=valueIN
CHAOS
HESIOD
ANY
The class specifies the protocol group of the information.
(Default = IN
; abbreviation =
cl
)
no
]debug
(Default = nodebug
; abbreviation =
[no
]deb
)
no
]d2
(Default = nod2
)
domain
=namedefname
and
search
options. The domain search list
contains the parents of the default domain if it has at least two
components in its name. For example, if the default domain is
CC.Berkeley.EDU, the search list is CC.Berkeley.EDU and Berkeley.EDU.
Use the “set srchlist
” command
to specify a different list. Use the “set
all
” command to display the list.
(Default = value from
hostname(1),
/etc/resolv.conf, or
LOCALDOMAIN
; abbreviation =
do
)
srchlist
=name1/name2/...set srchlist=lcs.MIT.EDU/ai.MIT.EDU/MIT.EDU
sets the domain to lcs.MIT.EDU and the search list to the
three names. This command overrides the default domain name and
search list of the “set
domain
” command. Use the “set
all
” command to display the list.
(Default = value based on
hostname(1),
/etc/resolv.conf, or
LOCALDOMAIN
; abbreviation =
srchl
)
no
]defname
(Default = defname
; abbreviation =
[no
]defname
)
no
]search
(Default = search
; abbreviation =
[no
]sea
)
port
=value(Default = 53; abbreviation =
po
)
querytype
=valuetype
=valueA
CNAME
HINFO
MINFO
MX
NS
PTR
SOA
TXT
UINFO
WKS
Other types (ANY
,
AXFR
, MB
,
MD
, MF
,
NULL
) are described in the RFC-1035
document.
(Default = A
; abbreviations =
q
, ty
)
no
]recurse
(Default = recurse
; abbreviation =
[no
]rec
)
retry
=numberset timeout
”),
the timeout period is doubled and the request is resent. The retry
value controls how many times a request is resent before giving up.
(Default = 4, abbreviation =
ret
)
ndots
=numberroot
=hostroot
” command.
(Default = ns.internic.net.
;
abbreviation = ro
)
timeout
=number(Default = 5 seconds; abbreviation =
ti
)
no
]vc
(Default = novc
; abbreviation =
[no
]v
)
no
]ignoretc
(Default = noignoretc
;
abbreviation =
[no
]ig
)
no
]fail
SERVFAIL
or a referral (nofail), or terminates
the query (fail) on such a response.
The default is nofail.
If nslookup
has been built with IDN
(internationalized domain name) support, it can accept and display non-ASCII
domain names. nslookup
appropriately converts
character encoding of a domain name before sending a request to a DNS server
or displaying a reply from the server. To turn off IDN support, define the
IDN_DISABLE environment variable. IDN support is disabled if the variable is
set when nslookup
runs, or when the standard output
is not a tty.
HOSTALIASES
LOCALDOMAIN
IDN_DISABLE
nslookup
returns with an exit status of
1
if any query failed, and 0
otherwise.
If the lookup request was not successful, an error message is printed. Possible errors are:
Timed
out
set
timeout
=value”) and a certain number
of retries (changed with “set
retry
=value”).No response from
server
No
records
set querytype
”
command.Non-existent
domain
Connection
refused
Network
is unreachable
ls
and finger
requests.Server
failure
Refused
Format
error
nslookup
.dig(1), resolver(3), resolv.conf(5), named(8)
P.V. Mockapetris, Domain Names - Concepts and Facilities, RFC 1034, Nov 1, 1987.
P.V. Mockapetris, Domain Names - Implementation and Specification, RFC 1035, Nov 1, 1987.
Andrew Cherenson
June 24, 1990 | NetBSD 10.99 |