1.. 2 Copyright (C) Internet Systems Consortium, Inc. ("ISC") 3 4 This Source Code Form is subject to the terms of the Mozilla Public 5 License, v. 2.0. If a copy of the MPL was not distributed with this 6 file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 8 See the COPYRIGHT file distributed with this work for additional 9 information regarding copyright ownership. 10 11.. 12 Copyright (C) Internet Systems Consortium, Inc. ("ISC") 13 14 This Source Code Form is subject to the terms of the Mozilla Public 15 License, v. 2.0. If a copy of the MPL was not distributed with this 16 file, You can obtain one at http://mozilla.org/MPL/2.0/. 17 18 See the COPYRIGHT file distributed with this work for additional 19 information regarding copyright ownership. 20 21 22.. highlight: console 23 24.. _man_nslookup: 25 26nslookup - query Internet name servers interactively 27---------------------------------------------------- 28 29Synopsis 30~~~~~~~~ 31 32:program:`nslookup` [-option] [name | -] [server] 33 34Description 35~~~~~~~~~~~ 36 37``Nslookup`` is a program to query Internet domain name servers. 38``Nslookup`` has two modes: interactive and non-interactive. Interactive 39mode allows the user to query name servers for information about various 40hosts and domains or to print a list of hosts in a domain. 41Non-interactive mode is used to print just the name and requested 42information for a host or domain. 43 44Arguments 45~~~~~~~~~ 46 47Interactive mode is entered in the following cases: 48 49a. when no arguments are given (the default name server will be used) 50 51b. when the first argument is a hyphen (-) and the second argument is 52 the host name or Internet address of a name server. 53 54Non-interactive mode is used when the name or Internet address of the 55host to be looked up is given as the first argument. The optional second 56argument specifies the host name or address of a name server. 57 58Options can also be specified on the command line if they precede the 59arguments and are prefixed with a hyphen. For example, to change the 60default query type to host information, and the initial timeout to 10 61seconds, type: 62 63:: 64 65 nslookup -query=hinfo -timeout=10 66 67The ``-version`` option causes ``nslookup`` to print the version number 68and immediately exits. 69 70Interactive Commands 71~~~~~~~~~~~~~~~~~~~~ 72 73``host`` [server] 74 Look up information for host using the current default server or 75 using server, if specified. If host is an Internet address and the 76 query type is A or PTR, the name of the host is returned. If host is 77 a name and does not have a trailing period, the search list is used 78 to qualify the name. 79 80 To look up a host not in the current domain, append a period to the 81 name. 82 83``server`` domain | ``lserver`` domain 84 Change the default server to domain; ``lserver`` uses the initial 85 server to look up information about domain, while ``server`` uses the 86 current default server. If an authoritative answer can't be found, 87 the names of servers that might have the answer are returned. 88 89``root`` 90 not implemented 91 92``finger`` 93 not implemented 94 95``ls`` 96 not implemented 97 98``view`` 99 not implemented 100 101``help`` 102 not implemented 103 104``?`` 105 not implemented 106 107``exit`` 108 Exits the program. 109 110``set`` keyword[=value] 111 This command is used to change state information that affects the 112 lookups. Valid keywords are: 113 114 ``all`` 115 Prints the current values of the frequently used options to 116 ``set``. Information about the current default server and host is 117 also printed. 118 119 ``class=``\ value 120 Change the query class to one of: 121 122 ``IN`` 123 the Internet class 124 125 ``CH`` 126 the Chaos class 127 128 ``HS`` 129 the Hesiod class 130 131 ``ANY`` 132 wildcard 133 134 The class specifies the protocol group of the information. 135 136 (Default = IN; abbreviation = cl) 137 138 ``nodebug`` 139 Turn on or off the display of the full response packet and any 140 intermediate response packets when searching. 141 142 (Default = nodebug; abbreviation = [no]deb) 143 144 ``nod2`` 145 Turn debugging mode on or off. This displays more about what 146 nslookup is doing. 147 148 (Default = nod2) 149 150 ``domain=``\ name 151 Sets the search list to name. 152 153 ``nosearch`` 154 If the lookup request contains at least one period but doesn't end 155 with a trailing period, append the domain names in the domain 156 search list to the request until an answer is received. 157 158 (Default = search) 159 160 ``port=``\ value 161 Change the default TCP/UDP name server port to value. 162 163 (Default = 53; abbreviation = po) 164 165 ``querytype=``\ value | ``type=``\ value 166 Change the type of the information query. 167 168 (Default = A and then AAAA; abbreviations = q, ty) 169 170 **Note:** It is only possible to specify one query type, only the default 171 behavior looks up both when an alternative is not specified. 172 173 ``norecurse`` 174 Tell the name server to query other servers if it does not have 175 the information. 176 177 (Default = recurse; abbreviation = [no]rec) 178 179 ``ndots=``\ number 180 Set the number of dots (label separators) in a domain that will 181 disable searching. Absolute names always stop searching. 182 183 ``retry=``\ number 184 Set the number of retries to number. 185 186 ``timeout=``\ number 187 Change the initial timeout interval for waiting for a reply to 188 number seconds. 189 190 ``novc`` 191 Always use a virtual circuit when sending requests to the server. 192 193 (Default = novc) 194 195 ``nofail`` 196 Try the next nameserver if a nameserver responds with SERVFAIL or 197 a referral (nofail) or terminate query (fail) on such a response. 198 199 (Default = nofail) 200 201Return Values 202~~~~~~~~~~~~~ 203 204``nslookup`` returns with an exit status of 1 if any query failed, and 0 205otherwise. 206 207IDN Support 208~~~~~~~~~~~ 209 210If ``nslookup`` has been built with IDN (internationalized domain name) 211support, it can accept and display non-ASCII domain names. ``nslookup`` 212appropriately converts character encoding of domain name before sending 213a request to DNS server or displaying a reply from the server. If you'd 214like to turn off the IDN support for some reason, define the IDN_DISABLE 215environment variable. The IDN support is disabled if the variable is set 216when ``nslookup`` runs or when the standard output is not a tty. 217 218Files 219~~~~~ 220 221``/etc/resolv.conf`` 222 223See Also 224~~~~~~~~ 225 226:manpage:`dig(1)`, :manpage:`host(1)`, :manpage:`named(8)`. 227