1NSLOOKUP(1) BIND 9 NSLOOKUP(1)
2
3
4
6 nslookup - query Internet name servers interactively
7
9 nslookup [-option] [name | -] [server]
10
12 nslookup is a program to query Internet domain name servers. nslookup
13 has two modes: interactive and non-interactive. Interactive mode allows
14 the user to query name servers for information about various hosts and
15 domains or to print a list of hosts in a domain. Non-interactive mode
16 prints just the name and requested information for a host or domain.
17
19 Interactive mode is entered in the following cases:
20
21 a. when no arguments are given (the default name server is used);
22
23 b. when the first argument is a hyphen (-) and the second argument is
24 the host name or Internet address of a name server.
25
26 Non-interactive mode is used when the name or Internet address of the
27 host to be looked up is given as the first argument. The optional sec‐
28 ond argument specifies the host name or address of a name server.
29
30 Options can also be specified on the command line if they precede the
31 arguments and are prefixed with a hyphen. For example, to change the
32 default query type to host information, with an initial timeout of 10
33 seconds, type:
34
35 nslookup -query=hinfo -timeout=10
36
37 The -version option causes nslookup to print the version number and im‐
38 mediately exit.
39
41 host [server]
42 This command looks up information for host using the current de‐
43 fault server or using server, if specified. If host is an Inter‐
44 net address and the query type is A or PTR, the name of the host
45 is returned. If host is a name and does not have a trailing pe‐
46 riod (.), the search list is used to qualify the name.
47
48 To look up a host not in the current domain, append a period to
49 the name.
50
51 server domain | lserver domain
52 These commands change the default server to domain; lserver uses
53 the initial server to look up information about domain, while
54 server uses the current default server. If an authoritative an‐
55 swer cannot be found, the names of servers that might have the
56 answer are returned.
57
58 root This command is not implemented.
59
60 finger This command is not implemented.
61
62 ls This command is not implemented.
63
64 view This command is not implemented.
65
66 help This command is not implemented.
67
68 ? This command is not implemented.
69
70 exit This command exits the program.
71
72 set keyword[=value]
73 This command is used to change state information that affects
74 the lookups. Valid keywords are:
75
76 all This keyword prints the current values of the frequently
77 used options to set. Information about the current de‐
78 fault server and host is also printed.
79
80 class=value
81 This keyword changes the query class to one of:
82
83 IN the Internet class
84
85 CH the Chaos class
86
87 HS the Hesiod class
88
89 ANY wildcard
90
91 The class specifies the protocol group of the informa‐
92 tion. The default is IN; the abbreviation for this key‐
93 word is cl.
94
95 nodebug
96 This keyword turns on or off the display of the full re‐
97 sponse packet, and any intermediate response packets,
98 when searching. The default for this keyword is nodebug;
99 the abbreviation for this keyword is [no]deb.
100
101 nod2 This keyword turns debugging mode on or off. This dis‐
102 plays more about what nslookup is doing. The default is
103 nod2.
104
105 domain=name
106 This keyword sets the search list to name.
107
108 nosearch
109 If the lookup request contains at least one period, but
110 does not end with a trailing period, this keyword appends
111 the domain names in the domain search list to the request
112 until an answer is received. The default is search.
113
114 port=value
115 This keyword changes the default TCP/UDP name server port
116 to value from its default, port 53. The abbreviation for
117 this keyword is po.
118
119 querytype=value | type=value
120 This keyword changes the type of the information query to
121 value. The defaults are A and then AAAA; the abbrevia‐
122 tions for these keywords are q and ty.
123
124 Please note that it is only possible to specify one query
125 type. Only the default behavior looks up both when an al‐
126 ternative is not specified.
127
128 norecurse
129 This keyword tells the name server to query other servers
130 if it does not have the information. The default is re‐
131 curse; the abbreviation for this keyword is [no]rec.
132
133 ndots=number
134 This keyword sets the number of dots (label separators)
135 in a domain that disables searching. Absolute names al‐
136 ways stop searching.
137
138 retry=number
139 This keyword sets the number of retries to number.
140
141 timeout=number
142 This keyword changes the initial timeout interval to wait
143 for a reply to number, in seconds.
144
145 novc This keyword indicates that a virtual circuit should al‐
146 ways be used when sending requests to the server. novc
147 is the default.
148
149 nofail This keyword tries the next nameserver if a nameserver
150 responds with SERVFAIL or a referral (nofail), or termi‐
151 nates the query (fail) on such a response. The default is
152 nofail.
153
155 nslookup returns with an exit status of 1 if any query failed, and 0
156 otherwise.
157
159 If nslookup has been built with IDN (internationalized domain name)
160 support, it can accept and display non-ASCII domain names. nslookup ap‐
161 propriately converts character encoding of a domain name before sending
162 a request to a DNS server or displaying a reply from the server. To
163 turn off IDN support, define the IDN_DISABLE environment variable. IDN
164 support is disabled if the variable is set when nslookup runs, or when
165 the standard output is not a tty.
166
168 /etc/resolv.conf
169
171 dig(1), host(1), named(8).
172
174 Internet Systems Consortium
175
177 2022, Internet Systems Consortium
178
179
180
181
1829.16.30-RH NSLOOKUP(1)