Bv9ARM.ch05.html revision 3acf5eb97cebc2ba868e6ac4a4e01e6d1be0c892
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<!--
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington - Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - Copyright (C) 2000-2003 Internet Software Consortium.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff -
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff - Permission to use, copy, modify, and/or distribute this software for any
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff - purpose with or without fee is hereby granted, provided that the above
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence -
15a44745412679c30a6d022733925af70a38b715David Lawrence - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15a44745412679c30a6d022733925af70a38b715David Lawrence - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15a44745412679c30a6d022733925af70a38b715David Lawrence - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15a44745412679c30a6d022733925af70a38b715David Lawrence - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15a44745412679c30a6d022733925af70a38b715David Lawrence - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15a44745412679c30a6d022733925af70a38b715David Lawrence - PERFORMANCE OF THIS SOFTWARE.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff-->
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<!-- $Id: Bv9ARM.ch05.html,v 1.89 2010/08/17 01:15:30 tbox Exp $ -->
49a940dc68b30d9e4f9e1bd3c0503d8b90bb1726Mark Andrews<html>
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence<head>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<title>Chapter�5.�The BIND 9 Lightweight Resolver</title>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<link rel="prev" href="Bv9ARM.ch04.html" title="Chapter�4.�Advanced DNS Features">
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley<link rel="next" href="Bv9ARM.ch06.html" title="Chapter�6.�BIND 9 Configuration Reference">
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff</head>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<div class="navheader">
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff<table width="100%" summary="Navigation header">
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff<tr><th colspan="3" align="center">Chapter�5.�The <acronym class="acronym">BIND</acronym> 9 Lightweight Resolver</th></tr>
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff<tr>
9282e3c21a20f354e22ad3f092aea4956abaea5cMichael Graff<td width="20%" align="left">
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff<a accesskey="p" href="Bv9ARM.ch04.html">Prev</a>�</td>
9282e3c21a20f354e22ad3f092aea4956abaea5cMichael Graff<th width="60%" align="center">�</th>
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch06.html">Next</a>
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff</td>
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff</tr>
058eeac2105c39e7cb31fb75ee0b473717ec3bbcMark Andrews</table>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence<hr>
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff</div>
5fca48054b5e791a2fa0c5015bc3b6fef4fcdce1Andreas Gustafsson<div class="chapter" lang="en">
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff<div class="titlepage"><div><div><h2 class="title">
6028d1ce0380d0ba7f6c6ecd1ad20b31ddd1becbDavid Lawrence<a name="Bv9ARM.ch05"></a>Chapter�5.�The <acronym class="acronym">BIND</acronym> 9 Lightweight Resolver</h2></div></div></div>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence<div class="toc">
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff<p><b>Table of Contents</b></p>
440be4c866f6935ac069db79a414304507a664c2Michael Graff<dl>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff<dt><span class="sect1"><a href="Bv9ARM.ch05.html#id2572857">The Lightweight Resolver Library</a></span></dt>
e45d323a2a0f4ca08d4b139546e60a5fa7bd3f0cMichael Graff<dt><span class="sect1"><a href="Bv9ARM.ch05.html#lwresd">Running a Resolver Daemon</a></span></dt>
29f28fe573d4b3b318b3b026d567c1eb86738015Michael Graff</dl>
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff</div>
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff<div class="sect1" lang="en">
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff<div class="titlepage"><div><div><h2 class="title" style="clear: both">
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff<a name="id2572857"></a>The Lightweight Resolver Library</h2></div></div></div>
d1cbf714097e900ed1703529584d3e1a50e8a4a8Brian Wellington<p>
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff Traditionally applications have been linked with a stub resolver
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence library that sends recursive DNS queries to a local caching name
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff server.
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence </p>
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff<p>
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence IPv6 once introduced new complexity into the resolution process,
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff such as following A6 chains and DNAME records, and simultaneous
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence lookup of IPv4 and IPv6 addresses. Though most of the complexity was
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff then removed, these are hard or impossible
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence to implement in a traditional stub resolver.
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff </p>
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence<p>
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff <acronym class="acronym">BIND</acronym> 9 therefore can also provide resolution
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence services to local clients
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff using a combination of a lightweight resolver library and a resolver
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrence daemon process running on the local host. These communicate using
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley a simple UDP-based protocol, the "lightweight resolver protocol"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff that is distinct from and simpler than the full DNS protocol.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff </p>
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley</div>
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley<div class="sect1" lang="en">
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley<div class="titlepage"><div><div><h2 class="title" style="clear: both">
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<a name="lwresd"></a>Running a Resolver Daemon</h2></div></div></div>
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff<p>
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff To use the lightweight resolver interface, the system must
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff run the resolver daemon <span><strong class="command">lwresd</strong></span> or a
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff local
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graff name server configured with a <span><strong class="command">lwres</strong></span>
49a940dc68b30d9e4f9e1bd3c0503d8b90bb1726Mark Andrews statement.
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graff </p>
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff<p>
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley By default, applications using the lightweight resolver library will
a14eb88840e06b8d458c1556e5452b6d2a50012eMichael Graff make
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff UDP requests to the IPv4 loopback address (127.0.0.1) on port 921.
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley The
7b5172166d816efabcdb22519b136ba124bb2619Brian Wellington address can be overridden by <span><strong class="command">lwserver</strong></span>
7b5172166d816efabcdb22519b136ba124bb2619Brian Wellington lines in
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley <code class="filename">/etc/resolv.conf</code>.
7b5172166d816efabcdb22519b136ba124bb2619Brian Wellington </p>
7b5172166d816efabcdb22519b136ba124bb2619Brian Wellington<p>
7b5172166d816efabcdb22519b136ba124bb2619Brian Wellington The daemon currently only looks in the DNS, but in the future
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff it may use other sources such as <code class="filename">/etc/hosts</code>,
acafce24bbc6140464302fb18c729791f1bfddd6Michael Graff NIS, etc.
acafce24bbc6140464302fb18c729791f1bfddd6Michael Graff </p>
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff<p>
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff The <span><strong class="command">lwresd</strong></span> daemon is essentially a
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff caching-only name server that responds to requests using the
081cff0c33514a5dc63ab794fc199c07377ab756Mark Andrews lightweight
081cff0c33514a5dc63ab794fc199c07377ab756Mark Andrews resolver protocol rather than the DNS protocol. Because it needs
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff to run on each host, it is designed to require no or minimal
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff configuration.
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff Unless configured otherwise, it uses the name servers listed on
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff <span><strong class="command">nameserver</strong></span> lines in <code class="filename">/etc/resolv.conf</code>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff as forwarders, but is also capable of doing the resolution
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff autonomously if
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley none are specified.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff </p>
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff<p>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff The <span><strong class="command">lwresd</strong></span> daemon may also be
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff configured with a
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff <code class="filename">named.conf</code> style configuration file,
78bf1ca89505820ed7b03be4bf0c0b53b557f3cdAndreas Gustafsson in
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff <code class="filename">/etc/lwresd.conf</code> by default. A name
439c0011e642fb1d26011116144af698125262dbMichael Graff server may also
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff be configured to act as a lightweight resolver daemon using the
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff <span><strong class="command">lwres</strong></span> statement in <code class="filename">named.conf</code>.
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff </p>
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff</div>
081cff0c33514a5dc63ab794fc199c07377ab756Mark Andrews</div>
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff<div class="navfooter">
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff<hr>
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley<table width="100%" summary="Navigation footer">
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff<tr>
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff<td width="40%" align="left">
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff<a accesskey="p" href="Bv9ARM.ch04.html">Prev</a>�</td>
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff<td width="20%" align="center">�</td>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff<td width="40%" align="right">�<a accesskey="n" href="Bv9ARM.ch06.html">Next</a>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff</td>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff</tr>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff<tr>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff<td width="40%" align="left" valign="top">Chapter�4.�Advanced DNS Features�</td>
2992344aacdb08e4af936c176d49ef789f5673ddMichael Graff<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff<td width="40%" align="right" valign="top">�Chapter�6.�<acronym class="acronym">BIND</acronym> 9 Configuration Reference</td>
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff</tr>
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff</table>
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff</div>
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff</body>
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley</html>
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley