2 .\" ++Copyright++ 1985, 1989
4 .\" Copyright (c) 1985, 1989
5 .\" The Regents of the University of California. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\" must display the following acknowledgement:
17 .\" This product includes software developed by the University of
18 .\" California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\" may be used to endorse or promote products derived from this software
21 .\" without specific prior written permission.
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" Portions Copyright (c) 1993 by Digital Equipment Corporation.
37 .\" Permission to use, copy, modify, and distribute this software for any
38 .\" purpose with or without fee is hereby granted, provided that the above
39 .\" copyright notice and this permission notice appear in all copies, and that
40 .\" the name of Digital Equipment Corporation not be used in advertising or
41 .\" publicity pertaining to distribution of the document or software without
42 .\" specific, written prior permission.
44 .\" THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
45 .\" WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
46 .\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
47 .\" CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
48 .\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
49 .\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
50 .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
55 .\" @(#)nslookup.8 5.3 (Berkeley) 6/24/90
62 .Nd query Internet name servers interactively
66 .Op Ar host-to-find | Fl Op Ar server
69 is a program to query Internet domain name servers.
71 has two modes: interactive and non-interactive.
72 Interactive mode allows the user to query name servers for
73 information about various hosts and domains or to print a list of hosts
75 Non-interactive mode is used to print just the name and requested information
78 Interactive mode is entered in the following cases:
81 when no arguments are given (the default name server will be used),
83 when the first argument is a hyphen (-) and the second argument
84 is the host name or Internet address of a name server.
87 Non-interactive mode is used when the name or Internet address
88 of the host to be looked up
89 is given as the first argument. The optional second argument specifies
90 the host name or address of a name server.
92 The options listed under the
94 command below can be specified in
97 file in the user's home directory if they are listed
98 one per line. Options can also be specified
99 on the command line if they precede the arguments and are prefixed with
100 a hyphen. For example, to change the default query type to host information,
101 and the initial timeout to 10 seconds, type:
102 .Bd -literal -offset indent
103 nslookup -query=hinfo -timeout=10
105 .Sh INTERACTIVE COMMANDS
106 Commands may be interrupted at any time by typing a control-C.
107 To exit, type a control-D
111 The command line length must be less than 256 characters.
112 To treat a built-in command as a host name,
113 precede it with an escape character
115 .Sy N.B.: An unrecognized command will be interpreted as a host name.
116 .Bl -tag -width "lserver"
117 .It Ar host Op Ar server
118 Look up information for
120 using the current default server or using
125 is an Internet address and the query type is
129 the name of the host is returned.
132 is a name and does not have a trailing period, the default
133 domain name is appended to the name. (This behavior depends on the state of the
136 .Ic domain , srchlist , defname ,
140 To look up a host not in the current domain, append a period to
142 .It Ic server Ar domain
143 .It Ic lserver Ar domain
144 Change the default server to
147 uses the initial server to look up information about
151 uses the current default server.
152 If an authoritative answer can't be found, the names of servers
153 that might have the answer are returned.
155 Changes the default server to the server for the root of the domain name space.
159 (This command is a synonym for
160 .Dq Ic lserver ns.internic.net . )
161 The name of the root server can be changed with the
164 .It Xo Ic finger Op Ar name
167 .It Xo Ic finger Op Ar name
168 .Op Ic >> Ar filename
170 Connects with the finger server on the current host.
171 The current host is defined when a previous lookup for a host
172 was successful and returned address information (see the
173 .Dq Ic set querytype=A
181 can be used to redirect output in the usual manner.
182 .It Xo Ic ls Op Ar option
183 .Ar domain Op Ic > Ar filename
185 .It Xo Ic ls Op Ar option
186 .Ar domain Op Ic >> Ar filename
188 List the information available for
190 optionally creating or appending to
192 The default output contains host names and their Internet addresses.
194 can be one of the following:
195 .Bl -tag -width "-a "
196 .It Fl t Ar querytype
197 lists all records of the specified type (see
201 lists aliases of hosts in the domain;
205 lists all records for the domain;
209 lists CPU and operating system information for the domain;
213 lists well-known services of hosts in the domain;
218 When output is directed to a file, hash marks are printed for every
219 50 records received from the server.
220 .It Ic view Ar filename
221 Sorts and lists the output of previous
227 Prints a brief summary of commands.
230 .It Xo Ic set Ar keyword
233 This command is used to change state information that affects the lookups.
235 .Bl -tag -width "class=v"
237 Prints the current values of the frequently-used options to
239 Information about the current default server and host is also printed.
240 .It Ic class= Ns Ar value
241 Change the query class to one of:
242 .Bl -tag -width "HESIOD "
248 the MIT Athena Hesiod class
250 wildcard (any of the above)
253 The class specifies the protocol group of the information.
262 Turn debugging mode on. A lot more information is printed about the
263 packet sent to the server and the resulting answer.
274 Turn exhaustive debugging mode on.
275 Essentially all fields of every packet are printed.
279 .It Ic domain= Ns Ar name
280 Change the default domain name to
282 The default domain name is appended to a lookup request depending on the
288 The domain search list contains the parents of the default domain if it has
289 at least two components in its name.
290 For example, if the default domain
291 is CC.Berkeley.EDU, the search list is CC.Berkeley.EDU and Berkeley.EDU.
294 command to specify a different list.
297 command to display the list.
299 (Default = value from
301 .Pa /etc/resolv.conf ,
306 .It Ic srchlist= Ns Ar name1/name2/...
307 Change the default domain name to
309 and the domain search list
312 etc. A maximum of 6 names separated by slashes (/)
315 .Bd -literal -offset indent
316 set srchlist=lcs.MIT.EDU/ai.MIT.EDU/MIT.EDU
319 sets the domain to lcs.MIT.EDU and the search list to the three names.
320 This command overrides the
321 default domain name and search list of the
326 command to display the list.
328 (Default = value based on
330 .Pa /etc/resolv.conf ,
338 If set, append the default domain name to a single-component lookup request
339 (i.e., one that does not contain a period).
350 If the lookup request contains at least one period but
352 end with a trailing period, append the domain names in the domain search list
353 to the request until an answer is received.
361 .It Ic port= Ns Ar value
362 Change the default TCP/UDP name server port to
368 .It Ic querytype= Ns Ar value
369 .It Ic type= Ns Ar value
370 Change the type of information query to one of:
371 .Bl -tag -width "HINFO "
373 the host's Internet address.
375 the canonical name for an alias.
377 the host CPU and operating system type.
379 the mailbox or mail list information.
383 the name server for the named zone.
385 the host name if the query is an Internet address;
386 otherwise, the pointer to other information.
389 .Dq start-of-authority
392 the text information.
394 the user information.
396 the supported well-known services.
400 .Pq Dv ANY, AXFR, MB, MD, MF, NULL
401 are described in the RFC-1035 document.
410 Tell the name server to query other servers if it does not have the
419 .It Ic retry= Ns Ar number
420 Set the number of retries to
422 When a reply to a request is not received within a certain
423 amount of time (changed with
424 .Dq Ic set timeout ) ,
425 the timeout period is doubled and the request is resent.
426 The retry value controls how many times a request is resent before giving up.
428 (Default = 4, abbreviation =
430 .It Ic root= Ns Ar host
431 Change the name of the root server to
438 .Ic ns.internic.net. ;
441 .It Ic timeout= Ns Ar number
442 Change the initial timeout interval for waiting for a reply to
444 seconds. Each retry doubles the timeout period.
446 (Default = 5 seconds; abbreviation =
451 Always use a virtual circuit when sending requests to the server.
462 Ignore packet truncation errors.
473 If the lookup request was not successful, an error message is printed.
475 .Bl -tag -width "Timed"
477 The server did not respond to a request after a certain amount of
479 .Dq Ic set timeout= Ns Ar value )
480 and a certain number of retries (changed with
481 .Dq Ic set retry= Ns Ar value ) .
482 .It Li \&No response from server
483 No name server is running on the server machine.
485 The server does not have resource records of the current query type for the
486 host, although the host name is valid.
487 The query type is specified with the
490 .It Li Non-existent domain
491 The host or domain name does not exist.
492 .It Li Connection refused
493 .It Li Network is unreachable
494 The connection to the name or finger server could not be made
496 This error commonly occurs with
501 .It Li Server failure
502 The name server found an internal inconsistency in its database
503 and could not return a valid answer.
505 The name server refused to service the request.
507 The name server found that the request packet was not in the proper format.
508 It may indicate an error in
512 .Bl -tag -width "/usr/share/misc/nslookup.helpXXX" -compact
513 .It Pa /etc/resolv.conf
514 initial domain name and name server addresses
515 .It Pa $HOME/.nslookuprc
516 user's initial options
517 .It Pa /usr/share/misc/nslookup.help
520 .Bl -tag -width "HOSTALIASESXXXX" -compact
522 file containing host aliases
524 overrides default domain
530 .Dq Domain Names - Concepts and Facilities ;
532 .Dq Domain Names - Implementation and Specification .