nslookup(1) CLIX nslookup(1)
NAME
nslookup - Queries name servers interactively
SYNOPSIS
nslookup [-option] [host-to-find|-[server]]
DESCRIPTION
The nslookup command is a program to query DARPA Internet domain name
servers. The nslookup command has two modes: non-interactive and
interactive. Non-interactive mode is entered when the host-to-find
parameter is specified on the command line. The hostname or Internet
address of the server to perform the query can optionally be specified
following the host-to-find parameter. The name and Internet address of
the host-to-find, and the name and Internet address of the server where
the query was made is the only information returned in this mode.
Interactive mode allows the user to query the name server for information
about one or more hosts and domains, or print a list of hosts in the
domain. The nslookup prompt (>) appears when in interactive mode. This
mode is entered in the following cases:
⊕ When no parameters are given (the default name server will be used).
⊕ When the hostname or Internet address of a name server is specified on
the command line, preceded by a hyphen (-), but no host-to-find is
specified.
In either mode the -options parameter can be used to specify any of the
nslookup set commands listed in the "Interactive Commands" section. The
set commands are used to change state information that affects the
lookups. The options specified on the command line must be prefixed with
a hyphen and must precede the host and name server parameters.
Interactive Commands
Commands entered at the the nslookup prompt (>) may be interrupted at any
time by keying in <Ctrl-C>. To exit nslookup, key in <Ctrl-D> (EOF) or
exit. The command line length must be less than 80 characters. Note that
an unrecognized command will be interpreted as a host name.
host [server] Looks up information for host using the current default
server or using server if specified.
server domain
lserver domain Changes the default server to domain. The lserver command
uses the initial server to look up information about domain
while server uses the current default server. If an
2/94 - Intergraph Corporation 1
nslookup(1) CLIX nslookup(1)
authoritative answer cannot be found, the names of servers
that may have the answer are returned.
root Changes the default server to the server for the root of
the domain name space. Currently, the host nic.ddn.mil is
used. (This command is a synonym for lserver nic.ddn.mil.)
The name of the root server can be changed with the set
root command.
finger [name] [> filename]
finger [name] [>> filename]
Connects with the finger server on the current host. The
current host is defined when a previous lookup for a host
was successful and returned address information (see the
set querytype=A command). The name parameter is optional.
The > and >> symbols can be used to redirect output.
ls [-a] [-h] [-d] domain [> filename]
ls [-a] [-h] [-d] domain [>> filename]
Lists the information available for domain, optionally
creating or appending to filename. The default output
contains host names and their Internet addresses. The -a
option lists aliases of hosts in the domain. The -h option
lists CPU and operating system information for the domain.
The -d option lists all contents of a zone transfer. When
output is directed to a file, hash marks are printed for
every 50 records received from the server.
view filename Sorts and lists the output of previous ls command(s) with
more(1).
help
? Prints a brief summary of commands.
exit Exits the program.
set keyword[=value]
Changes state information that affects the lookups. Valid
keywords are:
all Prints the current values of the various options
to set. Information about the current default
server and host is also printed.
[no]debug Turns debugging mode on. Additional information
is printed about the packet sent to the server
and the resulting answer. (The default is
nodebug. The abbreviation is [no]deb.)
2 Intergraph Corporation - 2/94
nslookup(1) CLIX nslookup(1)
[no]d2 Turns exhaustive debugging mode on. Essentially
all fields of every packet are printed. (The
default is nod2.)
[no]defname
Appends the default domain name to every lookup.
(The default is defname. The abbreviation is
[no]def.)
[no]search With defname, searchs for each name in parent
domains of the current domain. (The default is
search.)
domain=name
Changes the default domain name to name. The
default domain name is appended to all lookup
requests if the defname option has been set.
The search list is set to parents of the domain
with at least two components in their names.
(The default is the value in hostname or
/etc/resolv.conf. The abbreviation is do.)
querytype=value
type=value Changes the type of information returned from a
query to one of the following:
A The host's Internet address (the
default).
PTR The host name if the query is an Internet
address.
CNAME The canonical name for an alias.
HINFO The host CPU and operating system type.
MD The mail destination.
MX The mail exchanger.
MG The mail group member.
MINFO The mailbox or mail list information.
MR The mail rename domain name.
NS Name server for the named zone. Other
types specified in the RFC-1035 document
are valid but aren't very useful. (The
abbreviation is q.)
2/94 - Intergraph Corporation 3
nslookup(1) CLIX nslookup(1)
[no]recurse
Tell the name server to query other servers if
it does not have the information. (The default
is recurse. The abbreviation is [no]rec.)
retry=number
Sets the number of retries to number. When a
reply to a request is not received within a
certain amount of time (changed with set
timeout), the request is sent again. The retry
value controls how many times a request is sent
before giving up. (The default is 2. The
abbreviation is ret.)
root=host Changes the name of the root server to host.
This affects the root command. (The default is
nic.ddn.mil. The abbreviation is ro.)
timeout=number
Changes the timeout interval for waiting for a
reply to number seconds. (The default is 10
seconds. The abbreviation is t.)
[no]vc Always uses a virtual circuit when sending
requests to the server. (The default is novc.
The abbreviation is [no]v.)
EXAMPLES
To query the name server for information about the default host,
specifying the default query type as host information (HINFO), and the
default timeout to 10 seconds, enter:
nslookup -query=hinfo -timeout=10
FILES
/etc/resolv.conf
Initial domain name and name server addresses
/etc/nslookup.help
Summary of commands
DIAGNOSTICS
If the lookup request was not successful, an error message is printed.
Possible errors include the following:
Time-out
The server did not respond to a request after a certain amount of
4 Intergraph Corporation - 2/94
nslookup(1) CLIX nslookup(1)
time (changed with set timeout=value) and a certain number of
retries (changed with set retry=value)
No information
Depending on the query type set with the set querytype command, no
information about the host was available, though the host name is
valid
Non-existent domain
The host or domain name does not exist.
Connection refused
Network is unreachable
The connection to the name or finger server could not be made at
the current time. This error commonly occurs with finger requests.
Server failure
The name server found an internal inconsistency in its database and
could not return a valid answer.
Refused
The name server refused to service the request.
Format error
The name server found that the request packet was not in the proper
format.
EXIT VALUES
The nslookup command exits with a value of 0 if exiting with the exit
command, a <Ctrl-D>, or other normal termination. If an error occurs, it
exits with a non-zero value.
RELATED INFORMATION
RFC-1034 ``Domain Names - Concepts and Facilities'', RFC-1035 ``Domain
Names - Implementation and Specification''
Commands: dig(1), named(8)
Fuctions: resolver(3)
Files: named.boot(4)
2/94 - Intergraph Corporation 5