lwresd.html revision 731cc132f22dbc9e0ecd7035dce314a61076d31b
1211N/A<!--
1211N/A - Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
1211N/A - Copyright (C) 2000, 2001 Internet Software Consortium.
1211N/A -
1211N/A - Permission to use, copy, modify, and distribute this software for any
1211N/A - purpose with or without fee is hereby granted, provided that the above
1211N/A - copyright notice and this permission notice appear in all copies.
1211N/A -
1211N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1211N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1211N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1211N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1211N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1211N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1211N/A - PERFORMANCE OF THIS SOFTWARE.
1211N/A-->
1211N/A<!-- $Id: lwresd.html,v 1.24 2008/09/25 04:45:04 tbox Exp $ -->
1211N/A<html>
1211N/A<head>
1211N/A<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
1211N/A<title>lwresd</title>
1211N/A<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
1211N/A</head>
1211N/A<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
3231N/A<a name="id2476275"></a><div class="titlepage"></div>
5289N/A<div class="refnamediv">
1211N/A<h2>Name</h2>
1211N/A<p><span class="application">lwresd</span> &#8212; lightweight resolver daemon</p>
2086N/A</div>
1211N/A<div class="refsynopsisdiv">
1211N/A<h2>Synopsis</h2>
1211N/A<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>
1224N/A</div>
1224N/A<div class="refsect1" lang="en">
1224N/A<a name="id2543464"></a><h2>DESCRIPTION</h2>
1211N/A<p><span><strong class="command">lwresd</strong></span>
1211N/A is the daemon providing name lookup
1224N/A services to clients that use the BIND 9 lightweight resolver
1224N/A library. It is essentially a stripped-down, caching-only name
1211N/A server that answers queries using the BIND 9 lightweight
1211N/A resolver protocol rather than the DNS protocol.
1224N/A </p>
4134N/A<p><span><strong class="command">lwresd</strong></span>
1211N/A listens for resolver queries on a
2086N/A UDP port on the IPv4 loopback interface, 127.0.0.1. This
1211N/A means that <span><strong class="command">lwresd</strong></span> can only be used by
3538N/A processes running on the local machine. By default UDP port
1211N/A number 921 is used for lightweight resolver requests and
1211N/A responses.
1211N/A </p>
1211N/A<p>
1211N/A Incoming lightweight resolver requests are decoded by the
1211N/A server which then resolves them using the DNS protocol. When
1211N/A the DNS lookup completes, <span><strong class="command">lwresd</strong></span> encodes
1211N/A the answers in the lightweight resolver format and returns
1211N/A them to the client that made the request.
1211N/A </p>
1211N/A<p>
1211N/A If <code class="filename">/etc/resolv.conf</code> contains any
1211N/A <code class="option">nameserver</code> entries, <span><strong class="command">lwresd</strong></span>
1211N/A sends recursive DNS queries to those servers. This is similar
1211N/A to the use of forwarders in a caching name server. If no
1211N/A <code class="option">nameserver</code> entries are present, or if
1211N/A forwarding fails, <span><strong class="command">lwresd</strong></span> resolves the
1224N/A queries autonomously starting at the root name servers, using
1224N/A a built-in list of root server hints.
1211N/A </p>
1211N/A</div>
1211N/A<div class="refsect1" lang="en">
1211N/A<a name="id2543511"></a><h2>OPTIONS</h2>
1211N/A<div class="variablelist"><dl>
1211N/A<dt><span class="term">-4</span></dt>
1211N/A<dd><p>
1211N/A Use IPv4 only even if the host machine is capable of IPv6.
1211N/A <code class="option">-4</code> and <code class="option">-6</code> are mutually
1224N/A exclusive.
1224N/A </p></dd>
1211N/A<dt><span class="term">-6</span></dt>
1211N/A<dd><p>
1211N/A Use IPv6 only even if the host machine is capable of IPv4.
1211N/A <code class="option">-4</code> and <code class="option">-6</code> are mutually
1211N/A exclusive.
1211N/A </p></dd>
1211N/A<dt><span class="term">-c <em class="replaceable"><code>config-file</code></em></span></dt>
1211N/A<dd><p>
1211N/A Use <em class="replaceable"><code>config-file</code></em> as the
1211N/A configuration file instead of the default,
1211N/A <code class="filename">/etc/lwresd.conf</code>.
1211N/A
1211N/A <code class="option">-c</code> can not be used with <code class="option">-C</code>.
1211N/A </p></dd>
1211N/A<dt><span class="term">-C <em class="replaceable"><code>config-file</code></em></span></dt>
1211N/A<dd><p>
1211N/A Use <em class="replaceable"><code>config-file</code></em> as the
3538N/A configuration file instead of the default,
1211N/A <code class="filename">/etc/resolv.conf</code>.
1211N/A <code class="option">-C</code> can not be used with <code class="option">-c</code>.
1211N/A </p></dd>
1211N/A<dt><span class="term">-d <em class="replaceable"><code>debug-level</code></em></span></dt>
1211N/A<dd><p>
1211N/A Set the daemon's debug level to <em class="replaceable"><code>debug-level</code></em>.
1211N/A Debugging traces from <span><strong class="command">lwresd</strong></span> become
1211N/A more verbose as the debug level increases.
1211N/A </p></dd>
1211N/A<dt><span class="term">-f</span></dt>
1211N/A<dd><p>
2086N/A Run the server in the foreground (i.e. do not daemonize).
2086N/A </p></dd>
1211N/A<dt><span class="term">-g</span></dt>
2086N/A<dd><p>
1211N/A Run the server in the foreground and force all logging
1211N/A to <code class="filename">stderr</code>.
1211N/A </p></dd>
1224N/A<dt><span class="term">-i <em class="replaceable"><code>pid-file</code></em></span></dt>
1224N/A<dd><p>
1224N/A Use <em class="replaceable"><code>pid-file</code></em> as the
1224N/A PID file instead of the default,
1224N/A <code class="filename">/var/run/lwresd.pid</code>.
1224N/A </p></dd>
1211N/A<dt><span class="term">-m <em class="replaceable"><code>flag</code></em></span></dt>
1224N/A<dd><p>
1224N/A Turn on memory usage debugging flags. Possible flags are
1224N/A <em class="replaceable"><code>usage</code></em>,
1224N/A <em class="replaceable"><code>trace</code></em>,
1224N/A <em class="replaceable"><code>record</code></em>,
1224N/A <em class="replaceable"><code>size</code></em>, and
1756N/A <em class="replaceable"><code>mctx</code></em>.
1224N/A These correspond to the ISC_MEM_DEBUGXXXX flags described in
1756N/A <code class="filename">&lt;isc/mem.h&gt;</code>.
1756N/A </p></dd>
1224N/A<dt><span class="term">-n <em class="replaceable"><code>#cpus</code></em></span></dt>
1224N/A<dd><p>
1224N/A Create <em class="replaceable"><code>#cpus</code></em> worker threads
1224N/A to take advantage of multiple CPUs. If not specified,
2086N/A <span><strong class="command">lwresd</strong></span> will try to determine the
1224N/A number of CPUs present and create one thread per CPU.
2086N/A If it is unable to determine the number of CPUs, a
1224N/A single worker thread will be created.
1756N/A </p></dd>
1756N/A<dt><span class="term">-P <em class="replaceable"><code>port</code></em></span></dt>
1756N/A<dd><p>
1756N/A Listen for lightweight resolver queries on port
1756N/A <em class="replaceable"><code>port</code></em>. If
1756N/A not specified, the default is port 921.
1756N/A </p></dd>
1756N/A<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
1756N/A<dd><p>
1756N/A Send DNS lookups to port <em class="replaceable"><code>port</code></em>. If not
1756N/A specified, the default is port 53. This provides a
1756N/A way of testing the lightweight resolver daemon with a
1756N/A name server that listens for queries on a non-standard
1756N/A port number.
1756N/A </p></dd>
1756N/A<dt><span class="term">-s</span></dt>
1756N/A<dd>
1224N/A<p>
1224N/A Write memory usage statistics to <code class="filename">stdout</code>
1756N/A on exit.
1756N/A </p>
1756N/A<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1756N/A<h3 class="title">Note</h3>
1756N/A<p>
1756N/A This option is mainly of interest to BIND 9 developers
1756N/A and may be removed or changed in a future release.
1224N/A </p>
1224N/A</div>
1224N/A</dd>
1224N/A<dt><span class="term">-t <em class="replaceable"><code>directory</code></em></span></dt>
1224N/A<dd>
1224N/A<p>Chroot
1224N/A to <em class="replaceable"><code>directory</code></em> after
1224N/A processing the command line arguments, but before
1224N/A reading the configuration file.
1224N/A </p>
1224N/A<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1224N/A<h3 class="title">Warning</h3>
1224N/A<p>
1224N/A This option should be used in conjunction with the
1224N/A <code class="option">-u</code> option, as chrooting a process
1224N/A running as root doesn't enhance security on most
1224N/A systems; the way <code class="function">chroot(2)</code> is
1224N/A defined allows a process with root privileges to
1224N/A escape a chroot jail.
1224N/A </p>
1224N/A</div>
1224N/A</dd>
1224N/A<dt><span class="term">-u <em class="replaceable"><code>user</code></em></span></dt>
1224N/A<dd><p>Setuid
1224N/A to <em class="replaceable"><code>user</code></em> after completing
1224N/A privileged operations, such as creating sockets that
1224N/A listen on privileged ports.
1224N/A </p></dd>
1224N/A<dt><span class="term">-v</span></dt>
1224N/A<dd><p>
1224N/A Report the version number and exit.
1224N/A </p></dd>
1224N/A</dl></div>
1224N/A</div>
1224N/A<div class="refsect1" lang="en">
1224N/A<a name="id2543928"></a><h2>FILES</h2>
1224N/A<div class="variablelist"><dl>
1224N/A<dt><span class="term"><code class="filename">/etc/resolv.conf</code></span></dt>
4134N/A<dd><p>
4134N/A The default configuration file.
4134N/A </p></dd>
4134N/A<dt><span class="term"><code class="filename">/var/run/lwresd.pid</code></span></dt>
1224N/A<dd><p>
1224N/A The default process-id file.
1224N/A </p></dd>
1224N/A</dl></div>
1224N/A</div>
1224N/A<div class="refsect1" lang="en">
1224N/A<a name="id2543968"></a><h2>SEE ALSO</h2>
1224N/A<p><span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
1224N/A <span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
1224N/A <span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
1224N/A </p>
1224N/A</div>
1224N/A<div class="refsect1" lang="en">
1224N/A<a name="id2544002"></a><h2>AUTHOR</h2>
1224N/A<p><span class="corpauthor">Internet Systems Consortium</span>
1224N/A </p>
1224N/A</div>
1224N/A</div></body>
1224N/A</html>
1224N/A