lwresd.html revision 75c0816e8295e180f4bc7f10db3d0d880383bc1c
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<!--
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
c7ef13f6c9ef4436bc804b150e0a93307b11fa27Tinderbox User - Copyright (C) 2000, 2001 Internet Software Consortium.
c7ef13f6c9ef4436bc804b150e0a93307b11fa27Tinderbox User -
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater - Permission to use, copy, modify, and distribute this software for any
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater - purpose with or without fee is hereby granted, provided that the above
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater - copyright notice and this permission notice appear in all copies.
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User -
fe84edc17e0d582cf7b4270f8df9d4742a107b1cAutomatic Updater - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bed0874e1a09e810575328c4bfc346a47514b69fMark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
b253dcf9668f95e141bce9556dc88e30d3305a1dTinderbox User - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User - PERFORMANCE OF THIS SOFTWARE.
e20309353e6246485c521278131d3fced73d7957Tinderbox User-->
e20309353e6246485c521278131d3fced73d7957Tinderbox User<!-- $Id: lwresd.html,v 1.13 2005/05/13 03:14:05 marka Exp $ -->
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<html>
6c910bd5e4a85a56e3a61fdf7b237a45bb2553eeTinderbox User<head>
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<title>lwresd</title>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
e20309353e6246485c521278131d3fced73d7957Tinderbox User</head>
e20309353e6246485c521278131d3fced73d7957Tinderbox User<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<a name="id2456836"></a><div class="titlepage"></div>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<div class="refnamediv">
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<h2>Name</h2>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<p><span class="application">lwresd</span> &#8212; lightweight resolver daemon</p>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson</div>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<div class="refsynopsisdiv">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<h2>Synopsis</h2>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<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>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater</div>
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<div class="refsect1" lang="en">
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User<a name="id2514261"></a><h2>DESCRIPTION</h2>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt<p><span><strong class="command">lwresd</strong></span>
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater is the daemon providing name lookup
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater services to clients that use the BIND 9 lightweight resolver
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt library. It is essentially a stripped-down, caching-only name
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater server that answers queries using the BIND 9 lightweight
e6fc17ec5ad5ba1c4bf5730b2b97c82d1f2b8f3cMark Andrews resolver protocol rather than the DNS protocol.
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater </p>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt<p><span><strong class="command">lwresd</strong></span>
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater listens for resolver queries on a
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updater UDP port on the IPv4 loopback interface, 127.0.0.1. This
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt means that <span><strong class="command">lwresd</strong></span> can only be used by
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User processes running on the local machine. By default UDP port
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater number 921 is used for lightweight resolver requests and
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater responses.
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater </p>
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater<p>
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater Incoming lightweight resolver requests are decoded by the
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater server which then resolves them using the DNS protocol. When
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater the DNS lookup completes, <span><strong class="command">lwresd</strong></span> encodes
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater the answers in the lightweight resolver format and returns
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater them to the client that made the request.
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews </p>
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews<p>
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews If <code class="filename">/etc/resolv.conf</code> contains any
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User <code class="option">nameserver</code> entries, <span><strong class="command">lwresd</strong></span>
e20309353e6246485c521278131d3fced73d7957Tinderbox User sends recursive DNS queries to those servers. This is similar
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews to the use of forwarders in a caching name server. If no
e5a3fb2b751598fdbcf2cde07a47202aaab93081Tinderbox User <code class="option">nameserver</code> entries are present, or if
e20309353e6246485c521278131d3fced73d7957Tinderbox User forwarding fails, <span><strong class="command">lwresd</strong></span> resolves the
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews queries autonomously starting at the root name servers, using
a80993946f29ff39df38818ee9b2e58a4e46cb7eTinderbox User a built-in list of root server hints.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews </p>
c59750de3ea3c7d5890000fb4606e8f5835a52aaTinderbox User</div>
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater<div class="refsect1" lang="en">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<a name="id2514308"></a><h2>OPTIONS</h2>
ec7751119a08c6a7250f3187beed69a8b836d349Tinderbox User<div class="variablelist"><dl>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dt><span class="term">-C <em class="replaceable"><code>config-file</code></em></span></dt>
114f7780384371121918624ae2c80ecfce545683Tinderbox User<dd><p>
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic Updater Use <em class="replaceable"><code>config-file</code></em> as the
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews configuration file instead of the default,
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <code class="filename">/etc/resolv.conf</code>.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson </p></dd>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<dt><span class="term">-d <em class="replaceable"><code>debug-level</code></em></span></dt>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<dd><p>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews Set the daemon's debug level to <em class="replaceable"><code>debug-level</code></em>.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater Debugging traces from <span><strong class="command">lwresd</strong></span> become
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson more verbose as the debug level increases.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater </p></dd>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<dt><span class="term">-f</span></dt>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<dd><p>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater Run the server in the foreground (i.e. do not daemonize).
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User </p></dd>
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews<dt><span class="term">-g</span></dt>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews<dd><p>
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User Run the server in the foreground and force all logging
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User to <code class="filename">stderr</code>.
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews </p></dd>
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont<dt><span class="term">-n <em class="replaceable"><code>#cpus</code></em></span></dt>
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User<dd><p>
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User Create <em class="replaceable"><code>#cpus</code></em> worker threads
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont to take advantage of multiple CPUs. If not specified,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <span><strong class="command">lwresd</strong></span> will try to determine the
2ba8f584b97cbab864570e38fd26b8cb90961428Tinderbox User number of CPUs present and create one thread per CPU.
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User If it is unable to determine the number of CPUs, a
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews single worker thread will be created.
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews </p></dd>
bed0874e1a09e810575328c4bfc346a47514b69fMark Andrews<dt><span class="term">-P <em class="replaceable"><code>port</code></em></span></dt>
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic Updater<dd><p>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews Listen for lightweight resolver queries on port
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <em class="replaceable"><code>port</code></em>. If
2ba8f584b97cbab864570e38fd26b8cb90961428Tinderbox User not specified, the default is port 921.
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater </p></dd>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<dd><p>
a01aa536188bb3535dfc1107a623e6355a8e6b7cMark Andrews Send DNS lookups to port <em class="replaceable"><code>port</code></em>. If not
89623368b8f662d458d9964b923050f33c5f75b0Tinderbox User specified, the default is port 53. This provides a
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews way of testing the lightweight resolver daemon with a
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews name server that listens for queries on a non-standard
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews port number.
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews </p></dd>
01a5c5503482fb3ba52088bf0178a7213273bf96Mark Andrews<dt><span class="term">-s</span></dt>
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews<dd>
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews<p>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater Write memory usage statistics to <code class="filename">stdout</code>
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater on exit.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater </p>
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<h3 class="title">Note</h3>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<p>
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater This option is mainly of interest to BIND 9 developers
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater and may be removed or changed in a future release.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater </p>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson</div>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater</dd>
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews<dt><span class="term">-t <em class="replaceable"><code>directory</code></em></span></dt>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<dd>
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater<p><code class="function">chroot()</code>
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater to <em class="replaceable"><code>directory</code></em> after
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater processing the command line arguments, but before
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater reading the configuration file.
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater </p>
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<h3 class="title">Warning</h3>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<p>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater This option should be used in conjunction with the
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User <code class="option">-u</code> option, as chrooting a process
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User running as root doesn't enhance security on most
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User systems; the way <code class="function">chroot()</code> is
c7ef13f6c9ef4436bc804b150e0a93307b11fa27Tinderbox User defined allows a process with root privileges to
c7ef13f6c9ef4436bc804b150e0a93307b11fa27Tinderbox User escape a chroot jail.
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User </p>
f132a836c4e386b1af045dd8fe7106ae61b90bffAutomatic Updater</div>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater</dd>
c6a0f4ae1d7183a16ffb196b86b647f870694796Automatic Updater<dt><span class="term">-u <em class="replaceable"><code>user</code></em></span></dt>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater<dd><p><code class="function">setuid()</code>
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User to <em class="replaceable"><code>user</code></em> after completing
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User privileged operations, such as creating sockets that
269519eeb959d905ed125f96426e01d725c3b597Tinderbox User listen on privileged ports.
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater </p></dd>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term">-v</span></dt>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater<dd><p>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater Report the version number and exit.
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater </p></dd>
6a9d2121152c94cb9e35832126c3f2e4d18d81edTinderbox User</dl></div>
e85565067cf73f8cc21ee29b11761659f1d47ee9Automatic Updater</div>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div class="refsect1" lang="en">
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater<a name="id2514640"></a><h2>FILES</h2>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div class="variablelist"><dl>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dt><span class="term"><code class="filename">/etc/resolv.conf</code></span></dt>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<dd><p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater The default configuration file.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p></dd>
7f79131f9a8e804b93c57f3c679065cce878b726Automatic Updater<dt><span class="term"><code class="filename">/var/run/lwresd.pid</code></span></dt>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<dd><p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater The default process-id file.
3f616e6f846be57b1717c6beaba0f74de9d5a7c6Automatic Updater </p></dd>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater</dl></div>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater</div>
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater<div class="refsect1" lang="en">
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<a name="id2514679"></a><h2>SEE ALSO</h2>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<p><span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater <span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p>
5ecad47f69b3fd945472ab2900a9ff826a7ce2f6Automatic Updater</div>
dbd021853bb1cd6ab128e8da8865f5965030aedcTinderbox User<div class="refsect1" lang="en">
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<a name="id2514713"></a><h2>AUTHOR</h2>
6a9d2121152c94cb9e35832126c3f2e4d18d81edTinderbox User<p><span class="corpauthor">Internet Systems Consortium</span>
6a9d2121152c94cb9e35832126c3f2e4d18d81edTinderbox User </p>
7262eb86f2b465822206122921e2f357218f0cfdAutomatic Updater</div>
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrews</div></body>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater</html>
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater