lwresd.docbook revision 186462
1<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2               "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3	       [<!ENTITY mdash "&#8212;">]>
4<!--
5 - Copyright (C) 2004, 2005, 2007, 2008  Internet Systems Consortium, Inc. ("ISC")
6 - Copyright (C) 2000, 2001  Internet Software Consortium.
7 -
8 - Permission to use, copy, modify, and/or distribute this software for any
9 - purpose with or without fee is hereby granted, provided that the above
10 - copyright notice and this permission notice appear in all copies.
11 -
12 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14 - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18 - PERFORMANCE OF THIS SOFTWARE.
19-->
20
21<!-- $Id: lwresd.docbook,v 1.7.18.10 2008/10/16 23:46:00 tbox Exp $ -->
22<refentry>
23  <refentryinfo>
24    <date>June 30, 2000</date>
25  </refentryinfo>
26
27  <refmeta>
28    <refentrytitle><application>lwresd</application></refentrytitle>
29    <manvolnum>8</manvolnum>
30    <refmiscinfo>BIND9</refmiscinfo>
31  </refmeta>
32
33  <refnamediv>
34    <refname><application>lwresd</application></refname>
35    <refpurpose>lightweight resolver daemon</refpurpose>
36  </refnamediv>
37
38  <docinfo>
39    <copyright>
40      <year>2004</year>
41      <year>2005</year>
42      <year>2007</year>
43      <year>2008</year>
44      <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
45    </copyright>
46    <copyright>
47      <year>2000</year>
48      <year>2001</year>
49      <holder>Internet Software Consortium.</holder>
50    </copyright>
51  </docinfo>
52
53  <refsynopsisdiv>
54    <cmdsynopsis>
55      <command>lwresd</command>
56      <arg><option>-c <replaceable class="parameter">config-file</replaceable></option></arg>
57      <arg><option>-C <replaceable class="parameter">config-file</replaceable></option></arg>
58      <arg><option>-d <replaceable class="parameter">debug-level</replaceable></option></arg>
59      <arg><option>-f</option></arg>
60      <arg><option>-g</option></arg>
61      <arg><option>-i <replaceable class="parameter">pid-file</replaceable></option></arg>
62      <arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
63      <arg><option>-n <replaceable class="parameter">#cpus</replaceable></option></arg>
64      <arg><option>-P <replaceable class="parameter">port</replaceable></option></arg>
65      <arg><option>-p <replaceable class="parameter">port</replaceable></option></arg>
66      <arg><option>-s</option></arg>
67      <arg><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
68      <arg><option>-u <replaceable class="parameter">user</replaceable></option></arg>
69      <arg><option>-v</option></arg>
70      <arg><option>-4</option></arg>
71      <arg><option>-6</option></arg>
72    </cmdsynopsis>
73  </refsynopsisdiv>
74
75  <refsect1>
76    <title>DESCRIPTION</title>
77
78    <para><command>lwresd</command>
79      is the daemon providing name lookup
80      services to clients that use the BIND 9 lightweight resolver
81      library.  It is essentially a stripped-down, caching-only name
82      server that answers queries using the BIND 9 lightweight
83      resolver protocol rather than the DNS protocol.
84    </para>
85
86    <para><command>lwresd</command> 
87      listens for resolver queries on a
88      UDP port on the IPv4 loopback interface, 127.0.0.1.  This
89      means that <command>lwresd</command> can only be used by
90      processes running on the local machine.  By default UDP port
91      number 921 is used for lightweight resolver requests and
92      responses.
93    </para>
94    <para>
95      Incoming lightweight resolver requests are decoded by the
96      server which then resolves them using the DNS protocol.  When
97      the DNS lookup completes, <command>lwresd</command> encodes
98      the answers in the lightweight resolver format and returns
99      them to the client that made the request.
100    </para>
101    <para>
102      If <filename>/etc/resolv.conf</filename> contains any
103      <option>nameserver</option> entries, <command>lwresd</command>
104      sends recursive DNS queries to those servers.  This is similar
105      to the use of forwarders in a caching name server.  If no
106      <option>nameserver</option> entries are present, or if
107      forwarding fails, <command>lwresd</command> resolves the
108      queries autonomously starting at the root name servers, using
109      a built-in list of root server hints.
110    </para>
111  </refsect1>
112
113  <refsect1>
114    <title>OPTIONS</title>
115
116    <variablelist>
117
118      <varlistentry>
119        <term>-4</term>
120        <listitem>
121          <para>
122            Use IPv4 only even if the host machine is capable of IPv6.
123            <option>-4</option> and <option>-6</option> are mutually
124            exclusive.
125          </para>
126        </listitem>
127      </varlistentry>
128
129      <varlistentry>
130        <term>-6</term>
131        <listitem>
132          <para>
133            Use IPv6 only even if the host machine is capable of IPv4.
134            <option>-4</option> and <option>-6</option> are mutually
135            exclusive.
136          </para>
137        </listitem>
138      </varlistentry>
139
140      <!-- this is in source but not mentioned? does this matter? -->
141      <varlistentry>
142        <term>-c <replaceable class="parameter">config-file</replaceable></term>
143        <listitem>
144          <para>
145            Use <replaceable class="parameter">config-file</replaceable> as the
146            configuration file instead of the default,
147            <filename>/etc/lwresd.conf</filename>.
148	    <!-- Should this be an absolute path name? -->
149	    <option>-c</option> can not be used with <option>-C</option>.
150          </para>
151        </listitem>
152      </varlistentry>
153
154      <varlistentry>
155        <term>-C <replaceable class="parameter">config-file</replaceable></term>
156        <listitem>
157          <para>
158            Use <replaceable class="parameter">config-file</replaceable> as the
159            configuration file instead of the default,
160            <filename>/etc/resolv.conf</filename>.
161	    <option>-C</option> can not be used with <option>-c</option>.
162          </para>
163        </listitem>
164      </varlistentry>
165
166      <varlistentry>
167        <term>-d <replaceable class="parameter">debug-level</replaceable></term>
168        <listitem>
169          <para>
170            Set the daemon's debug level to <replaceable class="parameter">debug-level</replaceable>.
171            Debugging traces from <command>lwresd</command> become
172            		more verbose as the debug level increases.
173          </para>
174        </listitem>
175      </varlistentry>
176
177      <varlistentry>
178        <term>-f</term>
179        <listitem>
180          <para>
181            Run the server in the foreground (i.e. do not daemonize).
182          </para>
183        </listitem>
184      </varlistentry>
185
186      <varlistentry>
187        <term>-g</term>
188        <listitem>
189          <para>
190            Run the server in the foreground and force all logging
191            to <filename>stderr</filename>.
192          </para>
193        </listitem>
194      </varlistentry>
195
196      <varlistentry>
197        <term>-i <replaceable class="parameter">pid-file</replaceable></term>
198        <listitem>
199          <para>
200            Use <replaceable class="parameter">pid-file</replaceable> as the
201            PID file instead of the default,
202            <filename>/var/run/lwresd.pid</filename>.
203          </para>
204        </listitem>
205      </varlistentry>
206
207      <varlistentry>
208        <term>-m <replaceable class="parameter">flag</replaceable></term>
209        <listitem>
210          <para>
211            Turn on memory usage debugging flags.  Possible flags are
212            <replaceable class="parameter">usage</replaceable>,
213            <replaceable class="parameter">trace</replaceable>,
214            <replaceable class="parameter">record</replaceable>,
215            <replaceable class="parameter">size</replaceable>, and
216            <replaceable class="parameter">mctx</replaceable>.  
217            These correspond to the ISC_MEM_DEBUGXXXX flags described in
218            <filename>&lt;isc/mem.h&gt;</filename>.
219          </para>
220        </listitem>
221      </varlistentry>
222
223      <varlistentry>
224        <term>-n <replaceable class="parameter">#cpus</replaceable></term>
225        <listitem>
226          <para>
227            Create <replaceable class="parameter">#cpus</replaceable> worker threads
228            to take advantage of multiple CPUs.  If not specified,
229            <command>lwresd</command> will try to determine the
230            number of CPUs present and create one thread per CPU.
231            If it is unable to determine the number of CPUs, a
232            single worker thread will be created.
233          </para>
234        </listitem>
235      </varlistentry>
236
237      <varlistentry>
238        <term>-P <replaceable class="parameter">port</replaceable></term>
239        <listitem>
240          <para>
241            Listen for lightweight resolver queries on port
242            <replaceable class="parameter">port</replaceable>.  If
243            		not specified, the default is port 921.
244          </para>
245        </listitem>
246      </varlistentry>
247
248      <varlistentry>
249        <term>-p <replaceable class="parameter">port</replaceable></term>
250        <listitem>
251          <para>
252            Send DNS lookups to port <replaceable class="parameter">port</replaceable>.  If not
253            specified, the default is port 53.  This provides a
254            way of testing the lightweight resolver daemon with a
255            name server that listens for queries on a non-standard
256            port number.
257          </para>
258        </listitem>
259      </varlistentry>
260
261      <varlistentry>
262        <term>-s</term>
263        <listitem>
264          <para>
265            Write memory usage statistics to <filename>stdout</filename>
266            on exit.
267          </para>
268          <note>
269            <para>
270              This option is mainly of interest to BIND 9 developers
271              and may be removed or changed in a future release.
272            </para>
273          </note>
274        </listitem>
275      </varlistentry>
276
277      <varlistentry>
278        <term>-t <replaceable class="parameter">directory</replaceable></term>
279        <listitem>
280          <para>Chroot
281	    to <replaceable class="parameter">directory</replaceable> after
282            processing the command line arguments, but before
283            reading the configuration file.
284          </para>
285          <warning>
286            <para>
287              This option should be used in conjunction with the
288              <option>-u</option> option, as chrooting a process
289              running as root doesn't enhance security on most
290              systems; the way <function>chroot(2)</function> is
291              defined allows a process with root privileges to
292              escape a chroot jail.
293            </para>
294          </warning>
295        </listitem>
296      </varlistentry>
297
298      <varlistentry>
299        <term>-u <replaceable class="parameter">user</replaceable></term>
300        <listitem>
301          <para>Setuid
302	    to <replaceable class="parameter">user</replaceable> after completing
303            privileged operations, such as creating sockets that
304            listen on privileged ports.
305          </para>
306        </listitem>
307      </varlistentry>
308
309      <varlistentry>
310        <term>-v</term>
311        <listitem>
312          <para>
313            Report the version number and exit.
314          </para>
315        </listitem>
316      </varlistentry>
317
318    </variablelist>
319
320  </refsect1>
321
322  <refsect1>
323    <title>FILES</title>
324
325    <variablelist>
326
327      <varlistentry>
328        <term><filename>/etc/resolv.conf</filename></term>
329        <listitem>
330          <para>
331            The default configuration file.
332          </para>
333        </listitem>
334      </varlistentry>
335
336      <varlistentry>
337        <term><filename>/var/run/lwresd.pid</filename></term>
338        <listitem>
339          <para>
340            The default process-id file.
341          </para>
342        </listitem>
343      </varlistentry>
344
345    </variablelist>
346
347  </refsect1>
348
349  <refsect1>
350    <title>SEE ALSO</title>
351    <para><citerefentry>
352        <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
353      </citerefentry>,
354      <citerefentry>
355        <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
356      </citerefentry>,
357      <citerefentry>
358        <refentrytitle>resolver</refentrytitle><manvolnum>5</manvolnum>
359      </citerefentry>.
360    </para>
361  </refsect1>
362
363  <refsect1>
364    <title>AUTHOR</title>
365    <para><corpauthor>Internet Systems Consortium</corpauthor>
366    </para>
367  </refsect1>
368
369</refentry><!--
370 - Local variables:
371 - mode: sgml
372 - End:
373-->
374