lwresd.html revision 234010
1187063Srwatson<!--
2187063Srwatson - Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
3187063Srwatson - Copyright (C) 2000, 2001 Internet Software Consortium.
4187063Srwatson - 
5187063Srwatson - Permission to use, copy, modify, and/or distribute this software for any
6187063Srwatson - purpose with or without fee is hereby granted, provided that the above
7187063Srwatson - copyright notice and this permission notice appear in all copies.
8187063Srwatson - 
9187063Srwatson - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10187063Srwatson - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11187063Srwatson - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12187063Srwatson - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13187063Srwatson - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14187063Srwatson - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15187063Srwatson - PERFORMANCE OF THIS SOFTWARE.
16187063Srwatson-->
17187063Srwatson<!-- $Id$ -->
18187063Srwatson<html>
19187063Srwatson<head>
20187063Srwatson<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21187063Srwatson<title>lwresd</title>
22187063Srwatson<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
23187063Srwatson</head>
24187063Srwatson<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
25187063Srwatson<a name="id2476274"></a><div class="titlepage"></div>
26187063Srwatson<div class="refnamediv">
27187063Srwatson<h2>Name</h2>
28187063Srwatson<p><span class="application">lwresd</span> &#8212; lightweight resolver daemon</p>
29187063Srwatson</div>
30187063Srwatson<div class="refsynopsisdiv">
31187063Srwatson<h2>Synopsis</h2>
32187063Srwatson<div class="cmdsynopsis"><p><code class="command">lwresd</code>  [<code class="option">-c <em class="replaceable"><code>config-file</code></em></code>] [<code class="option">-C <em class="replaceable"><code>config-file</code></em></code>] [<code class="option">-d <em class="replaceable"><code>debug-level</code></em></code>] [<code class="option">-f</code>] [<code class="option">-g</code>] [<code class="option">-i <em class="replaceable"><code>pid-file</code></em></code>] [<code class="option">-m <em class="replaceable"><code>flag</code></em></code>] [<code class="option">-n <em class="replaceable"><code>#cpus</code></em></code>] [<code class="option">-P <em class="replaceable"><code>port</code></em></code>] [<code class="option">-p <em class="replaceable"><code>port</code></em></code>] [<code class="option">-s</code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-u <em class="replaceable"><code>user</code></em></code>] [<code class="option">-v</code>] [<code class="option">-4</code>] [<code class="option">-6</code>]</p></div>
33187063Srwatson</div>
34187063Srwatson<div class="refsect1" lang="en">
35187063Srwatson<a name="id2543469"></a><h2>DESCRIPTION</h2>
36187063Srwatson<p><span><strong class="command">lwresd</strong></span>
37187063Srwatson      is the daemon providing name lookup
38187063Srwatson      services to clients that use the BIND 9 lightweight resolver
39187063Srwatson      library.  It is essentially a stripped-down, caching-only name
40187063Srwatson      server that answers queries using the BIND 9 lightweight
41187063Srwatson      resolver protocol rather than the DNS protocol.
42187063Srwatson    </p>
43187063Srwatson<p><span><strong class="command">lwresd</strong></span> 
44187063Srwatson      listens for resolver queries on a
45187063Srwatson      UDP port on the IPv4 loopback interface, 127.0.0.1.  This
46187063Srwatson      means that <span><strong class="command">lwresd</strong></span> can only be used by
47187063Srwatson      processes running on the local machine.  By default, UDP port
48187063Srwatson      number 921 is used for lightweight resolver requests and
49187063Srwatson      responses.
50187063Srwatson    </p>
51187063Srwatson<p>
52187063Srwatson      Incoming lightweight resolver requests are decoded by the
53187063Srwatson      server which then resolves them using the DNS protocol.  When
54187063Srwatson      the DNS lookup completes, <span><strong class="command">lwresd</strong></span> encodes
55187063Srwatson      the answers in the lightweight resolver format and returns
56187063Srwatson      them to the client that made the request.
57187063Srwatson    </p>
58187063Srwatson<p>
59187063Srwatson      If <code class="filename">/etc/resolv.conf</code> contains any
60187063Srwatson      <code class="option">nameserver</code> entries, <span><strong class="command">lwresd</strong></span>
61187063Srwatson      sends recursive DNS queries to those servers.  This is similar
62187063Srwatson      to the use of forwarders in a caching name server.  If no
63187063Srwatson      <code class="option">nameserver</code> entries are present, or if
64187063Srwatson      forwarding fails, <span><strong class="command">lwresd</strong></span> resolves the
65187063Srwatson      queries autonomously starting at the root name servers, using
66187063Srwatson      a built-in list of root server hints.
67187063Srwatson    </p>
68187063Srwatson</div>
69187063Srwatson<div class="refsect1" lang="en">
70187063Srwatson<a name="id2543516"></a><h2>OPTIONS</h2>
71187063Srwatson<div class="variablelist"><dl>
72187063Srwatson<dt><span class="term">-4</span></dt>
73187063Srwatson<dd><p>
74187063Srwatson            Use IPv4 only even if the host machine is capable of IPv6.
75187063Srwatson            <code class="option">-4</code> and <code class="option">-6</code> are mutually
76187063Srwatson            exclusive.
77187063Srwatson          </p></dd>
78187063Srwatson<dt><span class="term">-6</span></dt>
79187063Srwatson<dd><p>
80187063Srwatson            Use IPv6 only even if the host machine is capable of IPv4.
81187063Srwatson            <code class="option">-4</code> and <code class="option">-6</code> are mutually
82187063Srwatson            exclusive.
83187063Srwatson          </p></dd>
84187063Srwatson<dt><span class="term">-c <em class="replaceable"><code>config-file</code></em></span></dt>
85187063Srwatson<dd><p>
86187063Srwatson            Use <em class="replaceable"><code>config-file</code></em> as the
87187063Srwatson            configuration file instead of the default,
88187063Srwatson            <code class="filename">/etc/lwresd.conf</code>.
89187063Srwatson	    
90187063Srwatson	    <code class="option">-c</code> can not be used with <code class="option">-C</code>.
91187063Srwatson          </p></dd>
92187063Srwatson<dt><span class="term">-C <em class="replaceable"><code>config-file</code></em></span></dt>
93187063Srwatson<dd><p>
94            Use <em class="replaceable"><code>config-file</code></em> as the
95            configuration file instead of the default,
96            <code class="filename">/etc/resolv.conf</code>.
97	    <code class="option">-C</code> can not be used with <code class="option">-c</code>.
98          </p></dd>
99<dt><span class="term">-d <em class="replaceable"><code>debug-level</code></em></span></dt>
100<dd><p>
101            Set the daemon's debug level to <em class="replaceable"><code>debug-level</code></em>.
102            Debugging traces from <span><strong class="command">lwresd</strong></span> become
103            		more verbose as the debug level increases.
104          </p></dd>
105<dt><span class="term">-f</span></dt>
106<dd><p>
107            Run the server in the foreground (i.e. do not daemonize).
108          </p></dd>
109<dt><span class="term">-g</span></dt>
110<dd><p>
111            Run the server in the foreground and force all logging
112            to <code class="filename">stderr</code>.
113          </p></dd>
114<dt><span class="term">-i <em class="replaceable"><code>pid-file</code></em></span></dt>
115<dd><p>
116            Use <em class="replaceable"><code>pid-file</code></em> as the
117            PID file instead of the default,
118            <code class="filename">/var/run/lwresd/lwresd.pid</code>.
119          </p></dd>
120<dt><span class="term">-m <em class="replaceable"><code>flag</code></em></span></dt>
121<dd><p>
122            Turn on memory usage debugging flags.  Possible flags are
123            <em class="replaceable"><code>usage</code></em>,
124            <em class="replaceable"><code>trace</code></em>,
125            <em class="replaceable"><code>record</code></em>,
126            <em class="replaceable"><code>size</code></em>, and
127            <em class="replaceable"><code>mctx</code></em>.  
128            These correspond to the ISC_MEM_DEBUGXXXX flags described in
129            <code class="filename">&lt;isc/mem.h&gt;</code>.
130          </p></dd>
131<dt><span class="term">-n <em class="replaceable"><code>#cpus</code></em></span></dt>
132<dd><p>
133            Create <em class="replaceable"><code>#cpus</code></em> worker threads
134            to take advantage of multiple CPUs.  If not specified,
135            <span><strong class="command">lwresd</strong></span> will try to determine the
136            number of CPUs present and create one thread per CPU.
137            If it is unable to determine the number of CPUs, a
138            single worker thread will be created.
139          </p></dd>
140<dt><span class="term">-P <em class="replaceable"><code>port</code></em></span></dt>
141<dd><p>
142            Listen for lightweight resolver queries on port
143            <em class="replaceable"><code>port</code></em>.  If
144            		not specified, the default is port 921.
145          </p></dd>
146<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
147<dd><p>
148            Send DNS lookups to port <em class="replaceable"><code>port</code></em>.  If not
149            specified, the default is port 53.  This provides a
150            way of testing the lightweight resolver daemon with a
151            name server that listens for queries on a non-standard
152            port number.
153          </p></dd>
154<dt><span class="term">-s</span></dt>
155<dd>
156<p>
157            Write memory usage statistics to <code class="filename">stdout</code>
158            on exit.
159          </p>
160<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
161<h3 class="title">Note</h3>
162<p>
163              This option is mainly of interest to BIND 9 developers
164              and may be removed or changed in a future release.
165            </p>
166</div>
167</dd>
168<dt><span class="term">-t <em class="replaceable"><code>directory</code></em></span></dt>
169<dd>
170<p>Chroot
171	    to <em class="replaceable"><code>directory</code></em> after
172            processing the command line arguments, but before
173            reading the configuration file.
174          </p>
175<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
176<h3 class="title">Warning</h3>
177<p>
178              This option should be used in conjunction with the
179              <code class="option">-u</code> option, as chrooting a process
180              running as root doesn't enhance security on most
181              systems; the way <code class="function">chroot(2)</code> is
182              defined allows a process with root privileges to
183              escape a chroot jail.
184            </p>
185</div>
186</dd>
187<dt><span class="term">-u <em class="replaceable"><code>user</code></em></span></dt>
188<dd><p>Setuid
189	    to <em class="replaceable"><code>user</code></em> after completing
190            privileged operations, such as creating sockets that
191            listen on privileged ports.
192          </p></dd>
193<dt><span class="term">-v</span></dt>
194<dd><p>
195            Report the version number and exit.
196          </p></dd>
197</dl></div>
198</div>
199<div class="refsect1" lang="en">
200<a name="id2543933"></a><h2>FILES</h2>
201<div class="variablelist"><dl>
202<dt><span class="term"><code class="filename">/etc/resolv.conf</code></span></dt>
203<dd><p>
204            The default configuration file.
205          </p></dd>
206<dt><span class="term"><code class="filename">/var/run/lwresd.pid</code></span></dt>
207<dd><p>
208            The default process-id file.
209          </p></dd>
210</dl></div>
211</div>
212<div class="refsect1" lang="en">
213<a name="id2543973"></a><h2>SEE ALSO</h2>
214<p><span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
215      <span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
216      <span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
217    </p>
218</div>
219<div class="refsect1" lang="en">
220<a name="id2544007"></a><h2>AUTHOR</h2>
221<p><span class="corpauthor">Internet Systems Consortium</span>
222    </p>
223</div>
224</div></body>
225</html>
226