1.\" $OpenBSD: nslookup.1,v 1.1 2020/02/07 09:58:52 florian Exp $ 2.\" 3.\" Copyright (C) 2004-2007, 2010, 2013-2016, 2018 Internet Systems Consortium, Inc. ("ISC") 4.\" 5.\" Permission to use, copy, modify, and/or distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11.\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15.\" PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: February 7 2020 $ 18.Dt NSLOOKUP 1 19.Os 20.Sh NAME 21.Nm nslookup 22.Nd query Internet name servers interactively 23.Sh SYNOPSIS 24.Nm 25.Op Fl option 26.Op Ar name | - 27.Op Ar server 28.Sh DESCRIPTION 29The 30.Nm 31command queries Internet domain name servers. 32It has two modes: interactive and non-interactive. 33Interactive mode allows the user to query name servers for information about 34various hosts and domains or to print a list of hosts in a domain. 35Non-interactive mode is used to print just the name and requested information 36for a host or domain. 37.Pp 38Interactive mode is entered in the following cases: 39.Bl -enum 40.It 41when no arguments are given (the default name server will be used) 42.It 43when the first argument is a hyphen (-) and the second argument is 44the host name or Internet address of a name server. 45.El 46.Pp 47Non-interactive mode is used when the name or Internet address of the 48host to be looked up is given as the first argument. 49The optional second 50argument specifies the host name or address of a name server. 51.Pp 52Options can also be specified on the command line if they precede the 53arguments and are prefixed with a hyphen. 54For example, to change the default query type to host information, and the 55initial timeout to 10 seconds, type: 56.Bd -literal -offset indent 57nslookup -query=hinfo -timeout=10 58.Ed 59.Pp 60The 61.Fl version 62option causes 63.Nm 64to print the version 65number and immediately exits. 66.Sh INTERACTIVE COMMANDS 67.Bl -tag -width Ds -compact 68.It Ic exit 69Exit the program. 70.Pp 71.It Ic host Op Ar server 72Look up information for host using the current default server or 73using server, if specified. 74If host is an Internet address and the query type is A or PTR, the name of the 75host is returned. 76If host is a name and does not have a trailing period, the search list is used 77to qualify the name. 78.Pp 79To look up a host not in the current domain, append a period to the name. 80.Pp 81.It Ic lserver Ar domain 82.It Ic server Ar domain 83Change the default server to 84.Ar domain ; 85.Ic lserver 86uses the initial server to look up information about 87.Cm domain , 88while 89.Ic server 90uses the current default server. 91If an authoritative answer can't be found, the names of servers that might have 92the answer are returned. 93.Pp 94.It Ic set Cm keyword Ns = Ns Ar value 95This command is used to change state information that affects the lookups. 96Some keywords may be abbreviated, as shown in parentheses. 97Valid keywords are: 98.Bl -tag -width Ds 99.It Cm all 100Prints the current values of the frequently used options to 101.Ic set . 102Information about the current default server and host is also printed. 103.It Cm class Ns = Ns Ar value 104.Pq Cm cl 105Change the query class to one of: 106.Pp 107.Bl -tag -width Ds -compact 108.It Cm ANY 109wildcard 110.It Cm CH 111the Chaos class 112.It Cm HS 113the Hesiod class 114.It Cm IN 115the Internet class 116.El 117.Pp 118The class specifies the protocol group of the information. 119The default is 120.Cm IN . 121.It Xo 122.Op Cm no Ns 123.Cm d2 124.Xc 125Turn debugging mode on or off. 126This displays more about what nslookup is doing. 127The default is 128.Cm nod2 . 129.It Xo 130.Op Cm no Ns 131.Cm debug 132.Xc 133.Pq Cm nodeb 134Turn on or off the display of the full response packet and any intermediate 135response packets when searching. 136The default is 137.Cm nodebug . 138.It Cm domain Ns = Ns Ar name 139Sets the search list to 140.Ar name . 141.It Xo 142.Op Cm no Ns 143.Cm fail 144.Xc 145Try the next name server if a name server responds with SERVFAIL or a referral 146.Pq Cm nofail 147or terminate query 148.Pq Cm fail 149on such a response. 150The default is 151.Cm nofail . 152.It Cm ndots Ns = Ns Ar number 153Set the number of dots (label separators) in a domain that will disable 154searching. 155Absolute names always stop searching. 156.It Cm port Ns = Ns Ar value 157.Pq Cm po 158Change the default TCP/UDP name server port to 159.Ar value . 160The default is port 53. 161.It Oo Cm query Oc Ns Cm type Ns = Ns Ar value 162.Pq Cm q , ty 163Change the type of the information query. 164The default is 165.Sq A . 166.It Xo 167.Op Cm no Ns 168.Cm recurse 169.Xc 170.Pq Cm rec 171Tell the name server to query other servers if it does not have the information. 172The default is 173.Cm recurse . 174.It Cm retry Ns = Ns Ar number 175Set the number of retries to number. 176.It Xo 177.Op Cm no Ns 178.Cm search 179.Xc 180If the lookup request contains at least one period but doesn't end with a 181trailing period, append the domain names in the domain search list to the 182request until an answer is received. 183The default is 184.Cm search . 185.It Cm timeout Ns = Ns Ar number 186Change the initial timeout interval for waiting for a 187reply to number seconds. 188.It Xo 189.Op Cm no Ns 190.Cm vc 191.Xc 192Always use a virtual circuit when sending requests to the server. 193The default is 194.Cm novc . 195.El 196.Pp 197.It Ic ?\& 198not implemented 199.It Ic finger 200not implemented 201.It Ic help 202not implemented 203.It Ic ls 204not implemented 205.It Ic root 206not implemented 207.It Ic view 208not implemented 209.El 210.Sh FILES 211.Pa /etc/resolv.conf 212.Sh EXIT STATUS 213The 214.Nm 215command returns with an exit status of 1 if any query failed, and 0 otherwise. 216.Sh SEE ALSO 217.Xr dig 1 , 218.Xr host 1 219.Sh AUTHORS 220.An -nosplit 221.An Internet Systems Consortium, Inc . 222