lwresd.html revision 153816
1243730Srwatson<!--
2243730Srwatson - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
3243730Srwatson - Copyright (C) 2000, 2001 Internet Software Consortium.
4243730Srwatson - 
5243730Srwatson - Permission to use, copy, modify, and distribute this software for any
6243730Srwatson - purpose with or without fee is hereby granted, provided that the above
7243730Srwatson - copyright notice and this permission notice appear in all copies.
8243730Srwatson - 
9243730Srwatson - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10243730Srwatson - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11243730Srwatson - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12243730Srwatson - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13243730Srwatson - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14243730Srwatson - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15243730Srwatson - PERFORMANCE OF THIS SOFTWARE.
16243730Srwatson-->
17243730Srwatson<!-- $Id: lwresd.html,v 1.4.2.1.4.8 2005/10/13 02:33:47 marka Exp $ -->
18243730Srwatson<html>
19243730Srwatson<head>
20243730Srwatson<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21243730Srwatson<title>lwresd</title>
22243730Srwatson<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
23243730Srwatson</head>
24243730Srwatson<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
25243730Srwatson<a name="id2463721"></a><div class="titlepage"></div>
26243730Srwatson<div class="refnamediv">
27243730Srwatson<h2>Name</h2>
28243730Srwatson<p><span class="application">lwresd</span> &#8212; lightweight resolver daemon</p>
29243730Srwatson</div>
30243734Srwatson<div class="refsynopsisdiv">
31243730Srwatson<h2>Synopsis</h2>
32243730Srwatson<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">-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">-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>]</p></div>
33243730Srwatson</div>
34243730Srwatson<div class="refsect1" lang="en">
35243730Srwatson<a name="id2525920"></a><h2>DESCRIPTION</h2>
36243730Srwatson<p>
37243730Srwatson	<span><strong class="command">lwresd</strong></span> is the daemon providing name lookup
38243730Srwatson	services to clients that use the BIND 9 lightweight resolver
39243730Srwatson	library.  It is essentially a stripped-down, caching-only name
40243730Srwatson	server that answers queries using the BIND 9 lightweight
41243730Srwatson	resolver protocol rather than the DNS protocol.
42243730Srwatson    </p>
43243730Srwatson<p>
44243730Srwatson	<span><strong class="command">lwresd</strong></span> listens for resolver queries on a
45243730Srwatson	UDP port on the IPv4 loopback interface, 127.0.0.1.  This
46243730Srwatson	means that <span><strong class="command">lwresd</strong></span> can only be used by
47243730Srwatson	processes running on the local machine.  By default UDP port
48243730Srwatson	number 921 is used for lightweight resolver requests and
49243730Srwatson	responses.
50243730Srwatson    </p>
51243730Srwatson<p>
52243730Srwatson	Incoming lightweight resolver requests are decoded by the
53243730Srwatson	server which then resolves them using the DNS protocol.  When
54243730Srwatson	the DNS lookup completes, <span><strong class="command">lwresd</strong></span> encodes
55243730Srwatson	the answers in the lightweight resolver format and returns
56243730Srwatson	them to the client that made the request.
57243730Srwatson    </p>
58243730Srwatson<p>
59243730Srwatson	If <code class="filename">/etc/resolv.conf</code> contains any
60243730Srwatson	<code class="option">nameserver</code> entries, <span><strong class="command">lwresd</strong></span>
61243734Srwatson	sends recursive DNS queries to those servers.  This is similar
62243730Srwatson	to the use of forwarders in a caching name server.  If no
63243730Srwatson	<code class="option">nameserver</code> entries are present, or if
64243730Srwatson	forwarding fails, <span><strong class="command">lwresd</strong></span> resolves the
65243730Srwatson	queries autonomously starting at the root name servers, using
66243730Srwatson	a built-in list of root server hints.
67243730Srwatson    </p>
68243730Srwatson</div>
69243730Srwatson<div class="refsect1" lang="en">
70243730Srwatson<a name="id2525969"></a><h2>OPTIONS</h2>
71243730Srwatson<div class="variablelist"><dl>
72243730Srwatson<dt><span class="term">-C <em class="replaceable"><code>config-file</code></em></span></dt>
73243730Srwatson<dd><p>
74243730Srwatson		Use <em class="replaceable"><code>config-file</code></em> as the
75243730Srwatson		configuration file instead of the default,
76243730Srwatson		<code class="filename">/etc/resolv.conf</code>.
77243730Srwatson          </p></dd>
78243730Srwatson<dt><span class="term">-d <em class="replaceable"><code>debug-level</code></em></span></dt>
79243730Srwatson<dd><p>
80243730Srwatson		Set the daemon's debug level to <em class="replaceable"><code>debug-level</code></em>.
81243730Srwatson		Debugging traces from <span><strong class="command">lwresd</strong></span> become
82243730Srwatson		more verbose as the debug level increases.
83243730Srwatson          </p></dd>
84243730Srwatson<dt><span class="term">-f</span></dt>
85243730Srwatson<dd><p>
86243730Srwatson		Run the server in the foreground (i.e. do not daemonize).
87243730Srwatson          </p></dd>
88243730Srwatson<dt><span class="term">-g</span></dt>
89243730Srwatson<dd><p>
90243730Srwatson		Run the server in the foreground and force all logging
91243730Srwatson		to <code class="filename">stderr</code>.
92243730Srwatson          </p></dd>
93243730Srwatson<dt><span class="term">-n <em class="replaceable"><code>#cpus</code></em></span></dt>
94243730Srwatson<dd><p>
95243730Srwatson		Create <em class="replaceable"><code>#cpus</code></em> worker threads
96243730Srwatson		to take advantage of multiple CPUs.  If not specified,
97243730Srwatson		<span><strong class="command">lwresd</strong></span> will try to determine the
98243730Srwatson		number of CPUs present and create one thread per CPU.
99243730Srwatson		If it is unable to determine the number of CPUs, a
100243730Srwatson		single worker thread will be created.
101243730Srwatson          </p></dd>
102243730Srwatson<dt><span class="term">-P <em class="replaceable"><code>port</code></em></span></dt>
103243730Srwatson<dd><p>
104243730Srwatson		Listen for lightweight resolver queries on port
105243730Srwatson		<em class="replaceable"><code>port</code></em>.  If
106243730Srwatson		not specified, the default is port 921.
107243730Srwatson          </p></dd>
108243730Srwatson<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
109243730Srwatson<dd><p>
110243730Srwatson		Send DNS lookups to port <em class="replaceable"><code>port</code></em>.  If not
111243730Srwatson		specified, the default is port 53.  This provides a
112243730Srwatson		way of testing the lightweight resolver daemon with a
113243730Srwatson		name server that listens for queries on a non-standard
114243730Srwatson		port number.
115243730Srwatson          </p></dd>
116243730Srwatson<dt><span class="term">-s</span></dt>
117243730Srwatson<dd>
118243730Srwatson<p>
119243730Srwatson		Write memory usage statistics to <code class="filename">stdout</code>
120243730Srwatson		on exit.
121243730Srwatson          </p>
122243730Srwatson<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
123243730Srwatson<h3 class="title">Note</h3>
124243730Srwatson<p>
125243730Srwatson		This option is mainly of interest to BIND 9 developers
126243730Srwatson		and may be removed or changed in a future release.
127243730Srwatson	    </p>
128243730Srwatson</div>
129243730Srwatson</dd>
130243730Srwatson<dt><span class="term">-t <em class="replaceable"><code>directory</code></em></span></dt>
131243730Srwatson<dd>
132243730Srwatson<p>
133243730Srwatson		<code class="function">chroot()</code> to <em class="replaceable"><code>directory</code></em> after
134243730Srwatson		processing the command line arguments, but before
135243730Srwatson		reading the configuration file.
136243730Srwatson          </p>
137243730Srwatson<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
138243730Srwatson<h3 class="title">Warning</h3>
139243730Srwatson<p>
140243730Srwatson		This option should be used in conjunction with the
141243730Srwatson		<code class="option">-u</code> option, as chrooting a process
142243730Srwatson		running as root doesn't enhance security on most
143243730Srwatson		systems; the way <code class="function">chroot()</code> is
144243730Srwatson		defined allows a process with root privileges to
145243730Srwatson		escape a chroot jail.
146243730Srwatson	    </p>
147243730Srwatson</div>
148243730Srwatson</dd>
149243730Srwatson<dt><span class="term">-u <em class="replaceable"><code>user</code></em></span></dt>
150243730Srwatson<dd><p>
151243730Srwatson		<code class="function">setuid()</code> to <em class="replaceable"><code>user</code></em> after completing
152243730Srwatson		privileged operations, such as creating sockets that
153243730Srwatson		listen on privileged ports.
154243730Srwatson          </p></dd>
155243730Srwatson<dt><span class="term">-v</span></dt>
156243730Srwatson<dd><p>
157243730Srwatson		Report the version number and exit.
158243730Srwatson          </p></dd>
159243730Srwatson</dl></div>
160243730Srwatson</div>
161243730Srwatson<div class="refsect1" lang="en">
162243730Srwatson<a name="id2526237"></a><h2>FILES</h2>
163243730Srwatson<div class="variablelist"><dl>
164243730Srwatson<dt><span class="term"><code class="filename">/etc/resolv.conf</code></span></dt>
165243730Srwatson<dd><p>
166243730Srwatson		The default configuration file.
167243730Srwatson          </p></dd>
168243730Srwatson<dt><span class="term"><code class="filename">/var/run/lwresd.pid</code></span></dt>
169243730Srwatson<dd><p>
170243730Srwatson		The default process-id file.
171243730Srwatson          </p></dd>
172243730Srwatson</dl></div>
173243730Srwatson</div>
174243730Srwatson<div class="refsect1" lang="en">
175243730Srwatson<a name="id2526277"></a><h2>SEE ALSO</h2>
176243730Srwatson<p>
177243730Srwatson	<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
178243730Srwatson	<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
179243730Srwatson	<span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
180243730Srwatson    </p>
181243730Srwatson</div>
182243730Srwatson<div class="refsect1" lang="en">
183243730Srwatson<a name="id2526315"></a><h2>AUTHOR</h2>
184243730Srwatson<p>
185243730Srwatson	<span class="corpauthor">Internet Systems Consortium</span>
186243730Srwatson    </p>
187243730Srwatson</div>
188243730Srwatson</div></body>
189243730Srwatson</html>
190243730Srwatson