d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
9700e6d72c3ba0d0c567969ab97d9eff202656d4Tinderbox User - Copyright (C) 2000, 2001, 2004, 2005, 2007-2009, 2014-2017 Internet Systems Consortium, Inc. ("ISC")
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - This Source Code Form is subject to the terms of the Mozilla Public
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - License, v. 2.0. If a copy of the MPL was not distributed with this
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - file, You can obtain one at http://mozilla.org/MPL/2.0/.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
9a5087bf58f651bfff841192aba5afd06760d6ceTinderbox User<a name="man.lwresd"></a><div class="titlepage"></div>
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User — lightweight resolver daemon
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-c <em class="replaceable"><code>config-file</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-C <em class="replaceable"><code>config-file</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-d <em class="replaceable"><code>debug-level</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-i <em class="replaceable"><code>pid-file</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-m <em class="replaceable"><code>flag</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-n <em class="replaceable"><code>#cpus</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-P <em class="replaceable"><code>port</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-p <em class="replaceable"><code>port</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User [<code class="option">-u <em class="replaceable"><code>user</code></em></code>]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <p><span class="command"><strong>lwresd</strong></span>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein is the daemon providing name lookup
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein services to clients that use the BIND 9 lightweight resolver
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein library. It is essentially a stripped-down, caching-only name
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein server that answers queries using the BIND 9 lightweight
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein resolver protocol rather than the DNS protocol.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <p><span class="command"><strong>lwresd</strong></span>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein listens for resolver queries on a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein UDP port on the IPv4 loopback interface, 127.0.0.1. This
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User means that <span class="command"><strong>lwresd</strong></span> can only be used by
9fbbfb5757a1e3e86d7dea62c4e63ffc2303ca2bAutomatic Updater processes running on the local machine. By default, UDP port
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein number 921 is used for lightweight resolver requests and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Incoming lightweight resolver requests are decoded by the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein server which then resolves them using the DNS protocol. When
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User the DNS lookup completes, <span class="command"><strong>lwresd</strong></span> encodes
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein the answers in the lightweight resolver format and returns
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein them to the client that made the request.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein If <code class="filename">/etc/resolv.conf</code> contains any
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User <code class="option">nameserver</code> entries, <span class="command"><strong>lwresd</strong></span>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein sends recursive DNS queries to those servers. This is similar
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to the use of forwarders in a caching name server. If no
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="option">nameserver</code> entries are present, or if
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User forwarding fails, <span class="command"><strong>lwresd</strong></span> resolves the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein queries autonomously starting at the root name servers, using
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein a built-in list of root server hints.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <div class="variablelist"><dl class="variablelist">
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews Use IPv4 only even if the host machine is capable of IPv6.
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <code class="option">-4</code> and <code class="option">-6</code> are mutually
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews Use IPv6 only even if the host machine is capable of IPv4.
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <code class="option">-4</code> and <code class="option">-6</code> are mutually
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews<dt><span class="term">-c <em class="replaceable"><code>config-file</code></em></span></dt>
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews Use <em class="replaceable"><code>config-file</code></em> as the
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews configuration file instead of the default,
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <code class="filename">/etc/lwresd.conf</code>.
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater <code class="option">-c</code> can not be used with <code class="option">-C</code>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term">-C <em class="replaceable"><code>config-file</code></em></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Use <em class="replaceable"><code>config-file</code></em> as the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein configuration file instead of the default,
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater <code class="option">-C</code> can not be used with <code class="option">-c</code>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term">-d <em class="replaceable"><code>debug-level</code></em></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Set the daemon's debug level to <em class="replaceable"><code>debug-level</code></em>.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User Debugging traces from <span class="command"><strong>lwresd</strong></span> become
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein more verbose as the debug level increases.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run the server in the foreground (i.e. do not daemonize).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run the server in the foreground and force all logging
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews<dt><span class="term">-i <em class="replaceable"><code>pid-file</code></em></span></dt>
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews Use <em class="replaceable"><code>pid-file</code></em> as the
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews PID file instead of the default,
18fa75b694d056da4be3ebfc2185d007d4882752Automatic Updater <code class="filename">/var/run/lwresd/lwresd.pid</code>.
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews<dt><span class="term">-m <em class="replaceable"><code>flag</code></em></span></dt>
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews Turn on memory usage debugging flags. Possible flags are
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <em class="replaceable"><code>usage</code></em>,
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <em class="replaceable"><code>trace</code></em>,
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <em class="replaceable"><code>record</code></em>,
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <em class="replaceable"><code>size</code></em>, and
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox User <em class="replaceable"><code>mctx</code></em>.
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews These correspond to the ISC_MEM_DEBUGXXXX flags described in
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews <code class="filename"><isc/mem.h></code>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term">-n <em class="replaceable"><code>#cpus</code></em></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Create <em class="replaceable"><code>#cpus</code></em> worker threads
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to take advantage of multiple CPUs. If not specified,
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User <span class="command"><strong>lwresd</strong></span> will try to determine the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein number of CPUs present and create one thread per CPU.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein If it is unable to determine the number of CPUs, a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein single worker thread will be created.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term">-P <em class="replaceable"><code>port</code></em></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Listen for lightweight resolver queries on port
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <em class="replaceable"><code>port</code></em>. If
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein not specified, the default is port 921.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Send DNS lookups to port <em class="replaceable"><code>port</code></em>. If not
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein specified, the default is port 53. This provides a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein way of testing the lightweight resolver daemon with a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein name server that listens for queries on a non-standard
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein port number.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Write memory usage statistics to <code class="filename">stdout</code>
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein This option is mainly of interest to BIND 9 developers
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein and may be removed or changed in a future release.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term">-t <em class="replaceable"><code>directory</code></em></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to <em class="replaceable"><code>directory</code></em> after
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein processing the command line arguments, but before
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein reading the configuration file.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein This option should be used in conjunction with the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="option">-u</code> option, as chrooting a process
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein running as root doesn't enhance security on most
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews systems; the way <code class="function">chroot(2)</code> is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein defined allows a process with root privileges to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein escape a chroot jail.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term">-u <em class="replaceable"><code>user</code></em></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to <em class="replaceable"><code>user</code></em> after completing
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein privileged operations, such as creating sockets that
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein listen on privileged ports.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Report the version number and exit.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <div class="variablelist"><dl class="variablelist">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="filename">/etc/resolv.conf</code></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein The default configuration file.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="filename">/var/run/lwresd.pid</code></span></dt>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein The default process-id file.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <span class="refentrytitle">resolver</span>(5)