nslookup.html revision d71e2e0c61df16ff37c9934c371a4a60c08974f7
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - Permission to use, copy, modify, and distribute this software for any
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - purpose with or without fee is hereby granted, provided that the above
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - copyright notice and this permission notice appear in all copies.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi - PERFORMANCE OF THIS SOFTWARE.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<!-- $Id: nslookup.html,v 1.20 2007/05/09 03:33:50 marka Exp $ -->
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<a name="id2476276"></a><div class="titlepage"></div>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<p>nslookup — query Internet name servers interactively</p>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<div class="cmdsynopsis"><p><code class="command">nslookup</code> [<code class="option">-option</code>] [name | -] [server]</p></div>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<a name="id2543355"></a><h2>DESCRIPTION</h2>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<p><span><strong class="command">Nslookup</strong></span>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi is a program to query Internet domain name servers. <span><strong class="command">Nslookup</strong></span>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi has two modes: interactive and non-interactive. Interactive mode allows
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the user to query name servers for information about various hosts and
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi domains or to print a list of hosts in a domain. Non-interactive mode
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi used to print just the name and requested information for a host or
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Interactive mode is entered in the following cases:
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi when no arguments are given (the default name server will be used)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi when the first argument is a hyphen (-) and the second argument is
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the host name or Internet address of a name server.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Non-interactive mode is used when the name or Internet address of the
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi host to be looked up is given as the first argument. The optional second
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi argument specifies the host name or address of a name server.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Options can also be specified on the command line if they precede the
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi arguments and are prefixed with a hyphen. For example, to
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi change the default query type to host information, and the initial
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi timeout to 10 seconds, type:
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<div class="informalexample"><pre class="programlisting">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchinslookup -query=hinfo -timeout=10
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<a name="id2543413"></a><h2>INTERACTIVE COMMANDS</h2>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">host</code> [<span class="optional">server</span>]</span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Look up information for host using the current default server or
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi using server, if specified. If host is an Internet address and
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the query type is A or PTR, the name of the host is returned.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi If host is a name and does not have a trailing period, the
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi search list is used to qualify the name.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi To look up a host not in the current domain, append a period to
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">server</code> <em class="replaceable"><code>domain</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">lserver</code> <em class="replaceable"><code>domain</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Change the default server to <em class="replaceable"><code>domain</code></em>; <code class="constant">lserver</code> uses the initial
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi server to look up information about <em class="replaceable"><code>domain</code></em>, while <code class="constant">server</code> uses
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the current default server. If an authoritative answer can't be
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi found, the names of servers that might have the answer are
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">root</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi not implemented
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">finger</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi not implemented
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">ls</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi not implemented
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">view</code></span></dt>
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi not implemented
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi<dt><span class="term"><code class="constant">help</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi not implemented
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">?</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi not implemented
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">exit</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Exits the program.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">set</code>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <em class="replaceable"><code>keyword[<span class="optional">=value</span>]</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi This command is used to change state information that affects
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the lookups. Valid keywords are:
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">all</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Prints the current values of the frequently used
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi options to <span><strong class="command">set</strong></span>.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Information about the current default
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi server and host is also printed.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">class=</code><em class="replaceable"><code>value</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Change the query class to one of:
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">IN</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the Internet class
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">CH</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the Chaos class
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">HS</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi the Hesiod class
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">ANY</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi The class specifies the protocol group of the information.
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi (Default = IN; abbreviation = cl)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <em class="replaceable"><code>[<span class="optional">no</span>]</code></em>debug</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Turn on or off the display of the full response packet and
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi any intermediate response packets when searching.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = nodebug; abbreviation = [<span class="optional">no</span>]deb)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <em class="replaceable"><code>[<span class="optional">no</span>]</code></em>d2</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Turn debugging mode on or off. This displays more about
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi about what nslookup is doing.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = nod2)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">domain=</code><em class="replaceable"><code>name</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Sets the search list to <em class="replaceable"><code>name</code></em>.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <em class="replaceable"><code>[<span class="optional">no</span>]</code></em>search</code></span></dt>
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi If the lookup request contains at least one period but
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi doesn't end with a trailing period, append the domain
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi names in the domain search list to the request until an
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi answer is received.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = search)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">port=</code><em class="replaceable"><code>value</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Change the default TCP/UDP name server port to <em class="replaceable"><code>value</code></em>.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = 53; abbreviation = po)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">querytype=</code><em class="replaceable"><code>value</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">type=</code><em class="replaceable"><code>value</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Change the type of the information query.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = A; abbreviations = q, ty)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <em class="replaceable"><code>[<span class="optional">no</span>]</code></em>recurse</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Tell the name server to query other servers if it does not
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = recurse; abbreviation = [no]rec)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">retry=</code><em class="replaceable"><code>number</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Set the number of retries to number.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">timeout=</code><em class="replaceable"><code>number</code></em></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Change the initial timeout interval for waiting for a
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi reply to number seconds.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">
c124a83e09115de88ecccd4f689983f42a1d53bdRobert Mustacchi <em class="replaceable"><code>[<span class="optional">no</span>]</code></em>vc</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Always use a virtual circuit when sending requests to the
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = novc)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<dt><span class="term"><code class="constant">
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <em class="replaceable"><code>[<span class="optional">no</span>]</code></em>fail</code></span></dt>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Try the next nameserver if a nameserver responds with
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi SERVFAIL or a referral (nofail) or terminate query
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (fail) on such a response.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi (Default = nofail)
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<p><code class="filename">/etc/resolv.conf</code>
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi<p><span class="citerefentry"><span class="refentrytitle">dig</span>(1)</span>,
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <span class="citerefentry"><span class="refentrytitle">host</span>(1)</span>,
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>.
75eba5b6d79ed4d2ce3daf7b2806306b6b69a938Robert Mustacchi Andrew Cherenson