nslookup(1M) Maintenance Commands nslookup(1M)
NAME
nslookup - query name servers interactively
SYNOPSIS
nslookup [ -opt ] [ host | - ] [ server ]
AVAILABILITY
SUNWcsu
DESCRIPTION
nslookup is an interactive program to query ARPA Internet
domain name servers. The user can contact servers to request
information about a specific host, or print a list of hosts
in the domain.
OPTIONS
-opt Allows you to set options as in the interac-
tive set option shown below. For example -
querytype=HINFO to ask for host information
instead of the default query type of A for
address information.
host Look up the host host directly and do not go
into interactive mode.
- Use the name server specified next on the
command line instead of the servers in
/etc/resolv.conf. Note that if both host and
server are specified on the command line
this - argument becomes optional.
server Use the name server specified. This can be
either a name or an Internet address. If
this fails, it will default to using the
entries in the /etc/resolv.conf file.
USAGE
Overview
The Internet domain name-space is tree-structured, with five
top-level domains at present:
COM commercial establishments
EDU educational institutions
ORG not-for-profit organizations
GOV government agencies
MIL MILNET hosts
SunOS 5.5 Last change: 14 Sep 1992 1
nslookup(1M) Maintenance Commands nslookup(1M)
If you are looking for a specific host, you need to know
something about the host's organization in order to deter-
mine the top-level domain it belongs to. For instance, if
you want to find the Internet address of a machine at UCLA ,
do the following:
o Connect with the root server using the root com-
mand. The root server of the name space has
knowledge of the top-level domains.
o Since UCLA is a university, its domain name is
ucla.edu. Connect with a server for the ucla.edu
domain with the command server ucla.edu. The
response will print the names of hosts that act as
servers for that domain. Note: the root server does
not have information about ucla.edu, but knows the
names and addresses of hosts that do. Once located
by the root server, all future queries will be sent
to the UCLA name server.
o To request information about a particular host in
the domain (for instance, locus), just type the host
name. To request a listing of hosts in the UCLA
domain, use the ls command. The ls command requires
a domain name (in this case, ucla.edu) as an argu-
ment.
If you are connected with a name server that handles more
than one domain, all lookups for host names must be fully
specified with its domain. For instance, the domain
harvard.edu is served by seismo.css.gov, which also services
the css.gov and cornell.edu domains. A lookup request for
the host aiken in the harvard.edu domain must be specified
as aiken.harvard.edu. However, the
set domain=name
and
set defname
commands can be used to automatically append a domain name
to each request.
After a successful lookup of a host, use the finger command
to see who is on the system, or to finger a specific person.
To get other information about the host, use the
set querytype=value
command to change the type of information desired and
request another lookup. (finger requires the type to be A.)
Commands
To exit, type CTRL-D (EOF).
The command line length must be less than 80 characters.
An unrecognized command will be interpreted as a host name.
host [server]
Look up information for host using the current default
server, or using server if it is specified.
server domain
lserver domain
Change the default server to domain. lserver uses the
initial server to look up information about domain
while server uses the current default server. If an
authoritative answer can not be found, the names of
servers that might have the answer are returned.
root Change the default server to the server for the root of
the domain name space. Currently, the host
ns.nic.ddn.mil is used; this command is a synonym for
lserver ns.nic.ddn.mil. The name of the root server
can be changed with the set root command.
finger [ name ]
Connect with the finger server on the current host,
which is defined by a previous successful lookup for a
host's address information (see the set querytype =A
command). As with the shell, output can be redirected
to a named file using > and >>.
ls [-ah]
List the information available for domain. 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. As with the shell, output
can be redirected to a named file using > and >>. When
output is directed to a file, hash marks are printed
for every 50 records received from the server.
view filename
Sort and list the output of the ls command with
more(1).
help
? Print a brief summary of commands.
set keyword [ = value ] This command is used to change state
information that affects the lookups. Valid keywords
are:
all Print the current values of the various options to
set. Information about the current default
server and host is also printed.
[no]deb[ug]
Turn debugging mode on. A lot more information is
printed about the packet sent to the server and
the resulting answer. The default is nodebug.
[no]def[name]
Append the default domain name to every lookup.
The default is nodefname.
do[main]= filename
Change the default domain name to filename. The
default domain name is appended to all lookup
requests if defname option has been set. The
default is the value in /etc/resolv.conf.
q[querytype] = value
Change the type of information returned from a
query to one of:
A The host's Internet address (the
default).
CNAME The canonical name for an alias.
HINFO The host CPU and operating system
type.
MD The mail destination.
MX The mail exchanger.
MB The mailbox domain name.
MG The mail group member.
MINFO The mailbox or mail list information.
(Other types specified in the RFC 883 document are
valid, but are not very useful.)
[no]recurse
Tell the name server to query other servers if it
does not have the information. The default is
recurse.
ret[ry] = count
Set the number of times to retry a request before
giving up to count. When a reply to a request is
not received within a certain amount of time
(changed with set timeout), the request is resent.
The default is count is 2.
ro[ot] = host
Change the name of the root server to host. This
affects the root command. The default root server
is ns.nic.ddn.mil.
t[timeout] = interval
Change the time-out for a reply to interval
seconds. The default interval is 10 seconds.
[no]v[c]
Always use a virtual circuit when sending requests
to the server. The default is novc.
FILES
/etc/resolv.conf initial domain name and name server
addresses
SEE ALSO
nstest(1M), resolver(3N), resolv.conf(4)
DIAGNOSTICS
If the lookup request was not successful, an error message
is printed. Possible errors are:
Time-out The server did not respond to a request after
a certain amount of 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 incon-
sistency in its database and could not return
a valid answer.
Refused The name server refused to service the
request.
The following error should not occur and it indicates a bug
in the program.
Format error
The name server found that the request packet was not in the
proper format.