BSD 4_3_Net_1 release
[unix-history] / named / tools / nslookup / nslookup.1
CommitLineData
95f51977 1.\" Copyright (c) 1986 Regents of the University of California.
e3419641 2.\" All rights reserved.
95f51977 3.\"
e3419641
C
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
95f51977 15.\"
e3419641
C
16.\" @(#)nslookup.1 1.6 (Berkeley) 8/17/88
17.\"
18.TH NSLOOKUP 1 "August 17, 1988"
ca67e7b4 19.UC 6
95f51977
C
20.SH NAME
21nslookup \- query name servers interactively
22.SH SYNOPSIS
23.B nslookup
e3419641
C
24[
25.I \-option ...
26]
95f51977 27[
e3419641
C
28.I host-to-find
29| \- [
30.I server
95f51977
C
31]]
32.SH DESCRIPTION
e3419641 33.I Nslookup
ca67e7b4
C
34is a program to query DARPA Internet domain name servers.
35Nslookup has two modes: interactive and non-interactive.
36Interactive mode allows the user to query the name server for
37information about various hosts and domains or print a list of hosts
38in the domain.
39Non-interactive mode is used to print just the name and Internet address
40of a host or domain.
95f51977 41.sp 1
ca67e7b4
C
42.SH ARGUMENTS
43Interactive mode is entered in the following cases:
44.IP a) 4
e3419641 45when no arguments are given (the default name server will be used),
ca67e7b4
C
46.IP b) 4
47when the first argument is a hyphen (\-) and the second argument
e3419641 48is the hostname or Internet address of a name server.
ca67e7b4
C
49.LP
50Non-interactive mode is used when the name of the host to be looked up
51is given as the first argument. The optional second argument specifies
e3419641
C
52the hostname or Internet address of a name server.
53.LP
54The options listed under the ``set'' command below can be specified on
55the command line if they precede the arguments and are prefixed with
56a hyphen. For example, to change the default query type to host information,
57and the default timeout to 10 seconds, type:
58.sp 1
59 nslookup \-query=hinfo \-timeout=10
ca67e7b4
C
60.sp 1
61.SH "INTERACTIVE COMMANDS"
95f51977 62Commands may be interrupted at any time by typing a control-C.
e3419641 63To exit, type a control-D (EOF) or type exit.
95f51977
C
64The command line length must be less than 80 characters.
65\fBN.B.\fP an unrecognized command will be interpreted as a host name.
66.sp 1
e3419641 67.IP "\fIhost\fP [\fIserver\fP]"
95f51977 68Look up information for \fIhost\fP using the current default server
e3419641 69or using \fIserver\fP if specified.
95f51977
C
70.sp 1
71.IP "\fBserver\fP \fIdomain\fP"
72.ns
73.IP "\fBlserver\fP \fIdomain\fP"
74Change the default server to \fIdomain\fP.
75\fBLserver\fP uses the initial server to look up
76information about \fIdomain\fP while \fBserver\fP
77uses the current default server.
78If an authoritative answer can't be found, the names of servers
79that might have the answer are returned.
80.sp 1
81.IP \fBroot\fP
82Changes the default server to the server for the root of the domain name space.
83Currently, the host sri-nic.arpa is used.
84(This command is a synonym for the \fBlserver sri-nic.arpa\fP.)
85The name of the root server can be changed with the \fBset root\fP command.
86.sp 1
87.IP "\fBfinger\fP [\fIname\fP] [\fB>\fP \fIfilename\fP]"
88.ns
89.IP "\fBfinger\fP [\fIname\fP] [\fB>>\fP \fIfilename\fP]"
90Connects with the finger server on the current host.
91The current host is defined when a previous lookup for a host
92was successful and returned address information (see the
93\fBset querytype=A\fP command).
94\fIName\fP is optional.
95\fB>\fP and \fB>>\fP can be used to redirect output in the
96usual manner.
97.sp 1
98.IP "\fBls\fP \fIdomain\fP [\fB>\fP \fIfilename\fP]"
99.ns
100.IP "\fBls\fP \fIdomain\fP [\fB>>\fP \fIfilename\fP]"
101.ns
102.IP "\fBls -a\fP \fIdomain\fP [\fB>\fP \fIfilename\fP]"
103.ns
104.IP "\fBls -a\fP \fIdomain\fP [\fB>>\fP \fIfilename\fP]"
105.ns
106.IP "\fBls -h\fP \fIdomain\fP [\fB>\fP \fIfilename\fP]"
107.ns
108.IP "\fBls -h\fP \fIdomain\fP [\fB>>\fP \fIfilename\fP]"
e3419641 109.ns
ca67e7b4
C
110.IP "\fBls -d\fP \fIdomain\fP [\fB>\fP \fIfilename\fP]"
111.ns
e3419641
C
112.IP "\fBls -d\fP \fIdomain\fP [\fB>>\fP \fIfilename\fP]"
113.ns
114List the information available for \fIdomain\fP, optionally creating
115or appending to \fIfilename\fP.
95f51977
C
116The default output contains host names and their Internet addresses.
117The \fB-a\fP option lists aliases of hosts in the domain.
118The \fB-h\fP option lists CPU and operating system information for the domain.
ca67e7b4 119The \fB-d\fP option lists all contents of a zone transfer.
95f51977
C
120When output is directed to a file, hash marks are printed for every
12150 records received from the server.
122.sp 1
123.IP "\fBview\fP \fIfilename\fP"
ca67e7b4 124Sorts and lists the output of previous \fBls\fP command(s) with \fImore\fP(1).
95f51977 125.sp 1
e3419641 126.ne 3
95f51977
C
127.IP "\fBhelp\fP"
128.ns
129.IP "\fB?\fP"
130Prints a brief summary of commands.
131.sp 1
e3419641
C
132.IP "\fBexit\fP"
133Exits the program.
134.sp 1
95f51977
C
135.IP "\fBset\fP \fIkeyword\fP[=\fIvalue\fP]"
136This command is used to change state information that affects the lookups.
137Valid keywords are:
138.RS
139.IP "\fBall\fP"
140Prints the current values of the various options to \fBset\fP.
141Information about the current default server and host is also printed.
142.IP "\fB[no]debug\fP"
143Turn debugging mode on. A lot more information is printed about the
144packet sent to the server and the resulting answer.
145.br
146(Default = nodebug, abbreviation = [no]deb)
ca67e7b4
C
147.IP "\fB[no]d2\fP"
148Turn exhaustive debugging mode on.
149Essentially all fields of every packet are printed.
150.br
151(Default = nod2)
95f51977
C
152.IP "\fB[no]defname\fP"
153Append the default domain name to every lookup.
154.br
ca67e7b4
C
155(Default = defname, abbreviation = [no]def)
156.IP "\fB[no]search\fP"
157With defname, search for each name in parent domains of the current domain.
158.br
159(Default = search)
95f51977
C
160.IP "\fBdomain=\fIname\fR"
161Change the default domain name to \fIname\fP.
162The default domain name is appended to all lookup requests if
163the \fBdefname\fP option has been set.
ca67e7b4
C
164The search list is set to parents of the domain with at least two components
165in their names.
95f51977 166.br
ca67e7b4 167(Default = value in hostname or /etc/resolv.conf, abbreviation = do)
95f51977 168.IP "\fBquerytype=\fIvalue\fR"
ca67e7b4 169.IP "\fBtype=\fIvalue\fR"
95f51977
C
170Change the type of information returned from a query to one of:
171.RS
172.IP A 10
173the host's Internet address (the default).
174.IP CNAME 10
175the canonical name for an alias.
176.IP HINFO 10
177the host CPU and operating system type.
178.IP MD 10
179the mail destination.
180.IP MX 10
181the mail exchanger.
182.IP MG 10
183the mail group member.
184.IP MINFO 10
185the mailbox or mail list information.
186.IP MR 10
187the mail rename domain name.
ca67e7b4
C
188.IP NS 10
189nameserver for the named zone.
95f51977 190.RE
e3419641 191Other types specified in the RFC-1035 document are valid but aren't
95f51977
C
192very useful.
193.br
194(Abbreviation = q)
195.IP "\fB[no]recurse\fP"
196Tell the name server to query other servers if it does not have the
197information.
198.br
199(Default = recurse, abbreviation = [no]rec)
200.IP \fBretry=\fInumber\fR
201Set the number of retries to \fInumber\fP.
202When a reply to a request is not received within a certain
203amount of time (changed with \fBset timeout\fP),
204the request is resent.
205The retry value controls how many times a request is resent before giving up.
206.br
207(Default = 2, abbreviation = ret)
208.IP \fBroot=\fIhost\fR
209Change the name of the root server to \fIhost\fP. This
210affects the \fBroot\fP command.
211.br
212(Default = sri-nic.arpa, abbreviation = ro)
213.IP \fBtimeout=\fInumber\fR
214Change the time-out interval for waiting for a reply to \fInumber\fP seconds.
215.br
216(Default = 10 seconds, abbreviation = t)
217.IP "\fB[no]vc\fP"
218Always use a virtual circuit when sending requests to the server.
219.br
220(Default = novc, abbreviation = [no]v)
221.RE
95f51977
C
222.SH DIAGNOSTICS
223If the lookup request was not successful, an error message is printed.
224Possible errors are:
225.IP "Time-out"
226The server did not respond to a request after a certain amount of
227time (changed with \fBset timeout=\fIvalue\fR)
228and a certain number of retries (changed with \fBset retry=\fIvalue\fR).
229.IP "No information"
230Depending on the query type set with the \fBset querytype\fP command,
231no information about the host was available, though the host name is
232valid.
233.IP "Non-existent domain"
234The host or domain name does not exist.
235.IP "Connection refused"
236.ns
237.IP "Network is unreachable"
238The connection to the name or finger server could not be made
239at the current time.
240This error commonly occurs with \fBfinger\fP requests.
241.IP "Server failure"
242The name server found an internal inconsistency in its database
243and could not return a valid answer.
244.IP "Refused"
245The name server refused to service the request.
246.sp 1
247.PP
248The following error should not occur and it indicates a bug in the program.
249.IP "Format error"
250The name server found that the request packet was not in the proper format.
251.sp 1
252.SH FILES
253/etc/resolv.conf initial domain name and name server addresses.
e3419641
C
254.br
255/usr/local/nslookup.help summary of commands.
95f51977 256.SH SEE ALSO
e3419641
C
257resolver(3), resolver(5), named(8),
258.br
259RFC-1034 ``Domain Names \- Concepts and Facilities''
260.br
261RFC-1035 ``Domain Names \- Implementation and Specification''
95f51977
C
262.SH AUTHOR
263Andrew Cherenson