Bv9ARM.ch05.html revision 28b3569d6248168e6c00caab951521cc8141a49d
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
724df78acd95dc0f313bc2b80a099f7ecd48b620Tinderbox User - Copyright (C) 2000-2003 Internet Software Consortium.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - Permission to use, copy, modify, and distribute this software for any
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - purpose with or without fee is hereby granted, provided that the above
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - copyright notice and this permission notice appear in all copies.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews - PERFORMANCE OF THIS SOFTWARE.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<!-- $Id: Bv9ARM.ch05.html,v 1.69 2008/04/01 01:11:50 tbox Exp $ -->
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<title>Chapter�5.�The BIND 9 Lightweight Resolver</title>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt<link rel="prev" href="Bv9ARM.ch04.html" title="Chapter�4.�Advanced DNS Features">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<link rel="next" href="Bv9ARM.ch06.html" title="Chapter�6.�BIND 9 Configuration Reference">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<table width="100%" summary="Navigation header">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<tr><th colspan="3" align="center">Chapter�5.�The <acronym class="acronym">BIND</acronym> 9 Lightweight Resolver</th></tr>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<a accesskey="p" href="Bv9ARM.ch04.html">Prev</a>�</td>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch06.html">Next</a>
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt<div class="titlepage"><div><div><h2 class="title">
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt<a name="Bv9ARM.ch05"></a>Chapter�5.�The <acronym class="acronym">BIND</acronym> 9 Lightweight Resolver</h2></div></div></div>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<dt><span class="sect1"><a href="Bv9ARM.ch05.html#id2572253">The Lightweight Resolver Library</a></span></dt>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<dt><span class="sect1"><a href="Bv9ARM.ch05.html#lwresd">Running a Resolver Daemon</a></span></dt>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<a name="id2572253"></a>The Lightweight Resolver Library</h2></div></div></div>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews Traditionally applications have been linked with a stub resolver
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews library that sends recursive DNS queries to a local caching name
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews IPv6 once introduced new complexity into the resolution process,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews such as following A6 chains and DNAME records, and simultaneous
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews lookup of IPv4 and IPv6 addresses. Though most of the complexity was
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews then removed, these are hard or impossible
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews to implement in a traditional stub resolver.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <acronym class="acronym">BIND</acronym> 9 therefore can also provide resolution
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews services to local clients
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews using a combination of a lightweight resolver library and a resolver
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews daemon process running on the local host. These communicate using
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews a simple UDP-based protocol, the "lightweight resolver protocol"
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews that is distinct from and simpler than the full DNS protocol.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<div class="titlepage"><div><div><h2 class="title" style="clear: both">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<a name="lwresd"></a>Running a Resolver Daemon</h2></div></div></div>
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt To use the lightweight resolver interface, the system must
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews run the resolver daemon <span><strong class="command">lwresd</strong></span> or a
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews name server configured with a <span><strong class="command">lwres</strong></span>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews By default, applications using the lightweight resolver library will
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews UDP requests to the IPv4 loopback address (127.0.0.1) on port 921.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews address can be overridden by <span><strong class="command">lwserver</strong></span>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <code class="filename">/etc/resolv.conf</code>.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews The daemon currently only looks in the DNS, but in the future
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews it may use other sources such as <code class="filename">/etc/hosts</code>,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews The <span><strong class="command">lwresd</strong></span> daemon is essentially a
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews caching-only name server that responds to requests using the
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews resolver protocol rather than the DNS protocol. Because it needs
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews to run on each host, it is designed to require no or minimal
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews configuration.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews Unless configured otherwise, it uses the name servers listed on
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <span><strong class="command">nameserver</strong></span> lines in <code class="filename">/etc/resolv.conf</code>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews as forwarders, but is also capable of doing the resolution
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews autonomously if
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews none are specified.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews The <span><strong class="command">lwresd</strong></span> daemon may also be
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews configured with a
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <code class="filename">named.conf</code> style configuration file,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <code class="filename">/etc/lwresd.conf</code> by default. A name
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews server may also
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews be configured to act as a lightweight resolver daemon using the
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <span><strong class="command">lwres</strong></span> statement in <code class="filename">named.conf</code>.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<table width="100%" summary="Navigation footer">
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<a accesskey="p" href="Bv9ARM.ch04.html">Prev</a>�</td>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<td width="40%" align="right">�<a accesskey="n" href="Bv9ARM.ch06.html">Next</a>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<td width="40%" align="left" valign="top">Chapter�4.�Advanced DNS Features�</td>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews<td width="40%" align="right" valign="top">�Chapter�6.�<acronym class="acronym">BIND</acronym> 9 Configuration Reference</td>