Table of Contents

NAME

nslookup - query Internet name servers interactively

SYNOPSIS

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

DESCRIPTION

Nslookup is a program to query Internet domain nameservers. Nslookup has two modes: interactive and noninteractive.Interactive mode allows the user to queryname servers for information about various hosts anddomains or to print a list of hosts in a domain. Noninteractivemode is used to print just the name andrequested information for a host or domain.

ARGUMENTS

Interactive mode is entered in the following cases:

a) when no arguments are given (the default name serverwill be used),

b) when the first argument is a hyphen (-) and the secondargument is the host name or Internet address of aname server.

Non-interactive mode is used when the name or Internetaddress of the host to be looked up is given as the firstargument. The optional second argument specifies the hostname or address of a name server.

The options listed under the ``set'' command below can bespecified in the .nslookuprc file in the user's homedirectory if they are listed one per line. Options canalso be specified on the command line if they precede thearguments and are prefixed with a hyphen. For example, tochange the default query type to host information, and theinitial timeout to 10 seconds, type:
nslookup -query=hinfo -timeout=10

INTERACTIVE COMMANDS

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 itwith an escape character (\). N.B. an unrecognized commandwill be interpreted as a host name.

host [server]
Look up information for host using the currentdefault server or using server if specified. Ifhost is an Internet address and the query type is Aor PTR, the name of the host is returned. If hostis a name and does not have a trailing period, thedefault domain name is appended to the name. (Thisbehavior depends on the state of the set optionsdomain, srchlist, defname, and search). To look upa host not in the current domain, append a periodto the name.

server domain
lserver domain
Change the default server to domain. Lserver usesthe initial server to look up information aboutdomain while server uses the current defaultserver. If an authoritative answer can't be found,the names of servers that might have the answer arereturned.

root Changes the default server to the server for theroot of the domain name space. Currently, the hostns.internic.net is used. (This command is a synonymfor lserver ns.internic.net.) The name of theroot server can be changed with the set root command.

finger [name] [> filename]
finger [name] [>> filename]
Connects with the finger server on the currenthost. The current host is defined when a previouslookup for a host was successful and returnedaddress information (see the set querytype=A command).Name is optional. > and >> can be used toredirect output in the usual manner.

ls [option] domain [> filename]
ls [option] domain [>> filename]
List the information available for domain, optionallycreating or appending to filename. Thedefault output contains host names and their Internetaddresses. Option can be one of the following:

-t querytype
lists all records of the specified type (seequerytype below).
-a
lists aliases of hosts in the domain. synonymfor -t CNAME.
-d
lists all records for the domain. synonym for-t ANY.
-h
lists CPU and operating system information forthe domain. synonym for -t HINFO.
-s
lists well-known services of hosts in thedomain. synonym for -t WKS.

When output is directed to a file, hash marks areprinted for every 50 records received from theserver.

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]
This command is used to change state informationthat affects the lookups. Valid keywords are:

all
Prints the current values of the frequentlyusedoptions to set. Information about thecurrent default server and host is alsoprinted.

class=value
Change the query class to one of:

IN
the Internet class.
CHAOS
the Chaos class.
HESIOD
the MIT Athena Hesiod class.
ANY
wildcard (any of the above).

The class specifies the protocol group ofthe information.
(Default = IN, abbreviation = cl)

[no]debug
Turn debugging mode on. A lot more informationis printed about the packet sent to theserver and the resulting answer.(Default = nodebug, abbreviation = [no]deb)

[no]d2 Turn exhaustive debugging mode on. Essentiallyall fields of every packet areprinted.(Default = nod2)

domain=name
Change the default domain name to name. Thedefault domain name is appended to a lookuprequest depending on the state of the defnameand search options. The domain searchlist contains the parents of the defaultdomain if it has at least two components inits name. For example, if the defaultdomain is CC.Berkeley.EDU, the search listis CC.Berkeley.EDU and Berkeley.EDU. Usethe set srchlist command to specify a differentlist. Use the set all command todisplay the list.
(Default = value from hostname,/etc/resolv.conf or LOCALDOMAIN, abbreviation= do)

srchlist=name1/name2/...
Change the default domain name to name1 andthe domain search list to name1, name2, etc.A maximum of 6 names separated by slashes(/) can be specified. For example,set srchlist=lcs.MIT.EDU/ai.MIT.EDU/MIT.EDUsets the domain to lcs.MIT.EDU and thesearch list to the three names. This commandoverrides the default domain name andsearch list of the set domain command. Usethe set all command to display the list.(Default = value based on hostname,/etc/resolv.conf or LOCALDOMAIN, abbreviation= srchl)

[no]defname
If set, append the default domain name to asingle-component lookup request (i.e., onethat does not contain a period).(Default = defname, abbreviation = [no]def)

[no]search
If the lookup request contains at least oneperiod but doesn't end with a trailingperiod, append the domain names in thedomain search list to the request until ananswer is received.
(Default = search, abbreviation = [no]sea)

port=value
Change the default TCP/UDP name server portto value.
(Default = 53, abbreviation = po)

querytype=value
type=value
Change the type of information query to oneof:

A
the host's Internet address.
CNAME
the canonical name for an alias.
HINFO
the host CPU and operating systemtype.
MINFO
the mailbox or mail list information.
MX
the mail exchanger.
NS
the name server for the namedzone.
PTR
the host name if the query is anInternet address, otherwise thepointer to other information.

SOA the domain's ``start-ofauthority''information.

TXT
the text information.
UINFO
the user information.
WKS
the supported well-known services.

Other types (ANY, AXFR, MB, MD, MF, NULL)are described in the RFC-1035 document.(Default = A, abbreviations = q, ty)

[no]recurse
Tell the name server to query other serversif it does not have the information.(Default = recurse, abbreviation = [no]rec)

retry=number
Set the number of retries to number. When areply to a request is not received within acertain amount of time (changed with settimeout), the timeout period is doubled andthe request is resent. The retry value controlshow many times a request is resentbefore giving up.
(Default = 4, abbreviation = ret)

root=host
Change the name of the root server to host.

This affects the root command.(Default = ns.internic.net., abbreviation =ro)

timeout=number
Change the initial timeout interval forwaiting for a reply to number seconds. Eachretry doubles the timeout period.(Default = 5 seconds, abbreviation = ti)

[no]vc Always use a virtual circuit when sendingrequests to the server.
(Default = novc, abbreviation = [no]v)

[no]ignoretc
Ignore packet truncation errors.(Default = noignoretc, abbreviation =[no]ig)

DIAGNOSTICS

If the lookup request was not successful, an error messageis printed. Possible errors are:

Timed out
The server did not respond to a request after a certainamount of time (changed with set timeout=value)and a certain number of retries (changed with setretry=value).

No response from server
No name server is running on the server machine.

No records
The server does not have resource records of the currentquery type for the host, although the host nameis valid. The query type is specified with the setquerytype command.

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 notbe made at the current time. This error commonlyoccurs with ls and finger requests.

Server failure
The name server found an internal inconsistency inits 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 notin the proper format. It may indicate an error innslookup.

FILES

/etc/resolv.conf
initial domain name andname server addresses.
$HOME/.nslookuprc
user's initial options.
/usr/share/misc/nslookup.help
summary of commands.

ENVIRONMENT

HOSTALIASES
file containing host aliases.
LOCALDOMAIN
overrides default domain.

SEE ALSO

resolver(3), resolver(5), named(8),
RFC-1034 ``Domain Names - Concepts and Facilities''RFC-1035 ``Domain Names - Implementation and Specification''

AUTHOR

Andrew Cherenson


Table of Contents


www.fiveanddime.net


Google
Web www.fiveanddime.net