bind10-guide.html 119 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BIND 10 Guide</title><link rel="stylesheet" href="./bind10-guide.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><meta name="description" content="BIND 10 is a Domain Name System (DNS) suite managed by Internet Systems Consortium (ISC). It includes DNS libraries and modular components for controlling authoritative and recursive DNS servers. This is the reference guide for BIND 10 version 20111129. The most up-to-date version of this document (in PDF, HTML, and plain text formats), along with other documents for BIND 10, can be found at ."></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="BIND 10 Guide"><div class="titlepage"><div><div><h1 class="title"><a name="id308566"></a>BIND 10 Guide</h1></div><div><h2 class="subtitle">Administrator Reference for BIND 10</h2></div><div><p class="releaseinfo">This is the reference guide for BIND 10 version
  2. 20111129.</p></div><div><p class="copyright">Copyright © 2010-2011 Internet Systems Consortium, Inc.</p></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p><p>BIND 10 is a Domain Name System (DNS) suite managed by
  3. Internet Systems Consortium (ISC). It includes DNS libraries
  4. and modular components for controlling authoritative and
  5. recursive DNS servers.
  6. </p><p>
  7. This is the reference guide for BIND 10 version 20111129.
  8. The most up-to-date version of this document (in PDF, HTML,
  9. and plain text formats), along with other documents for
  10. BIND 10, can be found at <a class="ulink" href="http://bind10.isc.org/docs" target="_top">http://bind10.isc.org/docs</a>.
  11. </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#id308377">Supported Platforms</a></span></dt><dt><span class="section"><a href="#id308389">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#id308843">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id309064">Download Tar File</a></span></dt><dt><span class="section"><a href="#id309086">Retrieve from Git</a></span></dt><dt><span class="section"><a href="#id308053">Configure before the build</a></span></dt><dt><span class="section"><a href="#id309339">Build</a></span></dt><dt><span class="section"><a href="#id309355">Install</a></span></dt><dt><span class="section"><a href="#id309382">Install Hierarchy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#bind10">3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></a></span></dt><dd><dl><dt><span class="section"><a href="#start">Starting BIND 10</a></span></dt><dt><span class="section"><a href="#bind10.config">Configuration of started processes</a></span></dt></dl></dd><dt><span class="chapter"><a href="#msgq">4. Command channel</a></span></dt><dt><span class="chapter"><a href="#cfgmgr">5. Configuration manager</a></span></dt><dt><span class="chapter"><a href="#cmdctl">6. Remote control daemon</a></span></dt><dd><dl><dt><span class="section"><a href="#cmdctl.spec">Configuration specification for b10-cmdctl</a></span></dt></dl></dd><dt><span class="chapter"><a href="#bindctl">7. Control and configure user interface</a></span></dt><dt><span class="chapter"><a href="#authserver">8. Authoritative Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id310420">Server Configurations</a></span></dt><dt><span class="section"><a href="#id310493">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id310529">Loading Master Zones Files</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrin">9. Incoming Zone Transfers</a></span></dt><dd><dl><dt><span class="section"><a href="#id310683">Configuration for Incoming Zone Transfers</a></span></dt><dt><span class="section"><a href="#id310728">Enabling IXFR</a></span></dt><dt><span class="section"><a href="#zonemgr">Secondary Manager</a></span></dt><dt><span class="section"><a href="#id310870">Trigger an Incoming Zone Transfer Manually</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrout">10. Outbound Zone Transfers</a></span></dt><dt><span class="chapter"><a href="#resolverserver">11. Recursive Name Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id311183">Access Control</a></span></dt><dt><span class="section"><a href="#id311322">Forwarding</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dhcp4">12. DHCPv4 Server</a></span></dt><dd><dl><dt><span class="section"><a href="#dhcp4-usage">DHCPv4 Server Usage</a></span></dt><dt><span class="section"><a href="#dhcp4-config">DHCPv4 Server Configuration</a></span></dt><dt><span class="section"><a href="#dhcp4-std">Supported standards</a></span></dt><dt><span class="section"><a href="#dhcp4-limit">DHCPv4 Server Limitations</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dhcp6">13. DHCPv6 Server</a></span></dt><dd><dl><dt><span class="section"><a href="#dhcp6-usage">DHCPv6 Server Usage</a></span></dt><dt><span class="section"><a href="#dhcp6-config">DHCPv6 Server Configuration</a></span></dt><dt><span class="section"><a href="#dhcp6-std">Supported DHCPv6 Standards</a></span></dt><dt><span class="section"><a href="#dhcp6-limit">DHCPv6 Server Limitations</a></span></dt></dl></dd><dt><span class="chapter"><a href="#libdhcp">14. libdhcp++ library</a></span></dt><dd><dl><dt><span class="section"><a href="#iface-detect">Interface detection</a></span></dt><dt><span class="section"><a href="#packet-handling">DHCPv4/DHCPv6 packet handling</a></span></dt></dl></dd><dt><span class="chapter"><a href="#statistics">15. Statistics</a></span></dt><dt><span class="chapter"><a href="#logging">16. Logging</a></span></dt><dd><dl><dt><span class="section"><a href="#id312142">Logging configuration</a></span></dt><dd><dl><dt><span class="section"><a href="#id312157">Loggers</a></span></dt><dt><span class="section"><a href="#id312460">Output Options</a></span></dt><dt><span class="section"><a href="#id312654">Example session</a></span></dt></dl></dd><dt><span class="section"><a href="#id312910">Logging Message Format</a></span></dt></dl></dd></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>3.1. <a href="#id309696"></a></dt></dl></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id308377">Supported Platforms</a></span></dt><dt><span class="section"><a href="#id308389">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></div><p>
  12. BIND is the popular implementation of a DNS server, developer
  13. interfaces, and DNS tools.
  14. BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++ and Python
  15. and provides a modular environment for serving and maintaining DNS.
  16. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  17. This guide covers the experimental prototype of
  18. BIND 10 version 20111129.
  19. </p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  20. BIND 10 provides a EDNS0- and DNSSEC-capable
  21. authoritative DNS server and a caching recursive name server
  22. which also provides forwarding.
  23. </p></div><div class="section" title="Supported Platforms"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id308377"></a>Supported Platforms</h2></div></div></div><p>
  24. BIND 10 builds have been tested on Debian GNU/Linux 5,
  25. Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7 and 8, and CentOS
  26. Linux 5.3.
  27. It has been tested on Sparc, i386, and amd64 hardware
  28. platforms.
  29. It is planned for BIND 10 to build, install and run on
  30. Windows and standard Unix-type platforms.
  31. </p></div><div class="section" title="Required Software"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id308389"></a>Required Software</h2></div></div></div><p>
  32. BIND 10 requires Python 3.1. Later versions may work, but Python
  33. 3.1 is the minimum version which will work.
  34. </p><p>
  35. BIND 10 uses the Botan crypto library for C++. It requires
  36. at least Botan version 1.8.
  37. </p><p>
  38. BIND 10 uses the log4cplus C++ logging library. It requires
  39. at least log4cplus version 1.0.3.
  40. </p><p>
  41. The authoritative server requires SQLite 3.3.9 or newer.
  42. The <span class="command"><strong>b10-xfrin</strong></span>, <span class="command"><strong>b10-xfrout</strong></span>,
  43. and <span class="command"><strong>b10-zonemgr</strong></span> modules require the
  44. libpython3 library and the Python _sqlite3.so module.
  45. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  46. Some operating systems do not provide these dependencies
  47. in their default installation nor standard packages
  48. collections.
  49. You may need to install them separately.
  50. </p></div></div><div class="section" title="Starting and Stopping the Server"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="starting_stopping"></a>Starting and Stopping the Server</h2></div></div></div><p>
  51. BIND 10 is modular. Part of this modularity is
  52. accomplished using multiple cooperating processes which, together,
  53. provide the server functionality. This is a change from
  54. the previous generation of BIND software, which used a
  55. single process.
  56. </p><p>
  57. At first, running many different processes may seem confusing.
  58. However, these processes are started, stopped, and maintained
  59. by a single command, <span class="command"><strong>bind10</strong></span>.
  60. This command starts a master process which will start other
  61. processes as needed.
  62. The processes started by the <span class="command"><strong>bind10</strong></span>
  63. command have names starting with "b10-", including:
  64. </p><p>
  65. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
  66. <span class="command"><strong>b10-msgq</strong></span> &#8212;
  67. Message bus daemon.
  68. This process coordinates communication between all of the other
  69. BIND 10 processes.
  70. </li><li class="listitem">
  71. <span class="command"><strong>b10-auth</strong></span> &#8212;
  72. Authoritative DNS server.
  73. This process serves DNS requests.
  74. </li><li class="listitem">
  75. <span class="command"><strong>b10-cfgmgr</strong></span> &#8212;
  76. Configuration manager.
  77. This process maintains all of the configuration for BIND 10.
  78. </li><li class="listitem">
  79. <span class="command"><strong>b10-cmdctl</strong></span> &#8212;
  80. Command and control service.
  81. This process allows external control of the BIND 10 system.
  82. </li><li class="listitem">
  83. <span class="command"><strong>b10-resolver</strong></span> &#8212;
  84. Recursive name server.
  85. This process handles incoming queries.
  86. </li><li class="listitem">
  87. <span class="command"><strong>b10-stats</strong></span> &#8212;
  88. Statistics collection daemon.
  89. This process collects and reports statistics data.
  90. </li><li class="listitem">
  91. <span class="command"><strong>b10-xfrin</strong></span> &#8212;
  92. Incoming zone transfer service.
  93. This process is used to transfer a new copy
  94. of a zone into BIND 10, when acting as a secondary server.
  95. </li><li class="listitem">
  96. <span class="command"><strong>b10-xfrout</strong></span> &#8212;
  97. Outgoing zone transfer service.
  98. This process is used to handle transfer requests to
  99. send a local zone to a remote secondary server,
  100. when acting as a master server.
  101. </li><li class="listitem">
  102. <span class="command"><strong>b10-zonemgr</strong></span> &#8212;
  103. Secondary manager.
  104. This process keeps track of timers and other
  105. necessary information for BIND 10 to act as a slave server.
  106. </li></ul></div><p>
  107. </p><p>
  108. These are ran automatically by <span class="command"><strong>bind10</strong></span>
  109. and do not need to be run manually.
  110. </p></div><div class="section" title="Managing BIND 10"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="managing_once_running"></a>Managing BIND 10</h2></div></div></div><p>
  111. Once BIND 10 is running, a few commands are used to interact
  112. directly with the system:
  113. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
  114. <span class="command"><strong>bindctl</strong></span> &#8212;
  115. interactive administration interface.
  116. This is a command-line tool which allows an administrator
  117. to control BIND 10.
  118. </li><li class="listitem">
  119. <span class="command"><strong>b10-loadzone</strong></span> &#8212;
  120. zone file loader.
  121. This tool will load standard masterfile-format zone files into
  122. BIND 10.
  123. </li><li class="listitem">
  124. <span class="command"><strong>b10-cmdctl-usermgr</strong></span> &#8212;
  125. user access control.
  126. This tool allows an administrator to authorize additional users
  127. to manage BIND 10.
  128. </li></ul></div><p>
  129. </p></div><p>
  130. The tools and modules are covered in full detail in this guide.
  131. In addition, manual pages are also provided in the default installation.
  132. </p><p>
  133. BIND 10 also provides libraries and programmer interfaces
  134. for C++ and Python for the message bus, configuration backend,
  135. and, of course, DNS. These include detailed developer
  136. documentation and code examples.
  137. </p></div><div class="chapter" title="Chapter 2. Installation"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 2. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id308843">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id309064">Download Tar File</a></span></dt><dt><span class="section"><a href="#id309086">Retrieve from Git</a></span></dt><dt><span class="section"><a href="#id308053">Configure before the build</a></span></dt><dt><span class="section"><a href="#id309339">Build</a></span></dt><dt><span class="section"><a href="#id309355">Install</a></span></dt><dt><span class="section"><a href="#id309382">Install Hierarchy</a></span></dt></dl></dd></dl></div><div class="section" title="Building Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id308843"></a>Building Requirements</h2></div></div></div><p>
  138. In addition to the run-time requirements, building BIND 10
  139. from source code requires various development include headers.
  140. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  141. Some operating systems have split their distribution packages into
  142. a run-time and a development package. You will need to install
  143. the development package versions, which include header files and
  144. libraries, to build BIND 10 from source code.
  145. </p></div><p>
  146. Building from source code requires the Boost
  147. build-time headers. At least Boost version 1.35 is required.
  148. </p><p>
  149. To build BIND 10, also install the Botan (at least version
  150. 1.8) and the log4cplus (at least version 1.0.3)
  151. development include headers.
  152. </p><p>
  153. The Python Library and Python _sqlite3 module are required to
  154. enable the Xfrout and Xfrin support.
  155. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  156. The Python related libraries and modules need to be built
  157. for Python 3.1.
  158. </p></div><p>
  159. Building BIND 10 also requires a C++ compiler and
  160. standard development headers, make, and pkg-config.
  161. BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
  162. 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10.
  163. </p></div><div class="section" title="Quick start"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="quickstart"></a>Quick start</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  164. This quickly covers the standard steps for installing
  165. and deploying BIND 10 as an authoritative name server using
  166. its defaults. For troubleshooting, full customizations and further
  167. details, see the respective chapters in the BIND 10 guide.
  168. </p></div><p>
  169. To quickly get started with BIND 10, follow these steps.
  170. </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
  171. Install required build dependencies.
  172. </li><li class="listitem">
  173. Download the BIND 10 source tar file from
  174. <a class="ulink" href="ftp://ftp.isc.org/isc/bind10/" target="_top">ftp://ftp.isc.org/isc/bind10/</a>.
  175. </li><li class="listitem"><p>Extract the tar file:
  176. </p><pre class="screen">$ <strong class="userinput"><code>gzcat bind10-<em class="replaceable"><code>VERSION</code></em>.tar.gz | tar -xvf -</code></strong></pre><p>
  177. </p></li><li class="listitem"><p>Go into the source and run configure:
  178. </p><pre class="screen">$ <strong class="userinput"><code>cd bind10-<em class="replaceable"><code>VERSION</code></em></code></strong>
  179. $ <strong class="userinput"><code>./configure</code></strong></pre><p>
  180. </p></li><li class="listitem"><p>Build it:
  181. </p><pre class="screen">$ <strong class="userinput"><code>make</code></strong></pre><p>
  182. </p></li><li class="listitem"><p>Install it (to default /usr/local):
  183. </p><pre class="screen">$ <strong class="userinput"><code>make install</code></strong></pre><p>
  184. </p></li><li class="listitem"><p>Start the server:
  185. </p><pre class="screen">$ <strong class="userinput"><code>/usr/local/sbin/bind10</code></strong></pre><p>
  186. </p></li><li class="listitem"><p>Test it; for example:
  187. </p><pre class="screen">$ <strong class="userinput"><code>dig @127.0.0.1 -c CH -t TXT authors.bind</code></strong></pre><p>
  188. </p></li><li class="listitem"><p>Load desired zone file(s), for example:
  189. </p><pre class="screen">$ <strong class="userinput"><code>b10-loadzone <em class="replaceable"><code>your.zone.example.org</code></em></code></strong></pre><p>
  190. </p></li><li class="listitem">
  191. Test the new zone.
  192. </li></ol></div></div><div class="section" title="Installation from source"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="install"></a>Installation from source</h2></div></div></div><p>
  193. BIND 10 is open source software written in C++ and Python.
  194. It is freely available in source code form from ISC via
  195. the Git code revision control system or as a downloadable
  196. tar file. It may also be available in pre-compiled ready-to-use
  197. packages from operating system vendors.
  198. </p><div class="section" title="Download Tar File"><div class="titlepage"><div><div><h3 class="title"><a name="id309064"></a>Download Tar File</h3></div></div></div><p>
  199. Downloading a release tar file is the recommended method to
  200. obtain the source code.
  201. </p><p>
  202. The BIND 10 releases are available as tar file downloads from
  203. <a class="ulink" href="ftp://ftp.isc.org/isc/bind10/" target="_top">ftp://ftp.isc.org/isc/bind10/</a>.
  204. Periodic development snapshots may also be available.
  205. </p></div><div class="section" title="Retrieve from Git"><div class="titlepage"><div><div><h3 class="title"><a name="id309086"></a>Retrieve from Git</h3></div></div></div><p>
  206. Downloading this "bleeding edge" code is recommended only for
  207. developers or advanced users. Using development code in a production
  208. environment is not recommended.
  209. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  210. When using source code retrieved via Git additional
  211. software will be required: automake (v1.11 or newer),
  212. libtoolize, and autoconf (2.59 or newer).
  213. These may need to be installed.
  214. </p></div><p>
  215. The latest development code, including temporary experiments
  216. and un-reviewed code, is available via the BIND 10 code revision
  217. control system. This is powered by Git and all the BIND 10
  218. development is public.
  219. The leading development is done in the <span class="quote">&#8220;<span class="quote">master</span>&#8221;</span>.
  220. </p><p>
  221. The code can be checked out from
  222. <code class="filename">git://bind10.isc.org/bind10</code>;
  223. for example:
  224. </p><pre class="screen">$ <strong class="userinput"><code>git clone git://bind10.isc.org/bind10</code></strong></pre><p>
  225. </p><p>
  226. When checking out the code from
  227. the code version control system, it doesn't include the
  228. generated configure script, Makefile.in files, nor the
  229. related configure files.
  230. They can be created by running <span class="command"><strong>autoreconf</strong></span>
  231. with the <code class="option">--install</code> switch.
  232. This will run <span class="command"><strong>autoconf</strong></span>,
  233. <span class="command"><strong>aclocal</strong></span>,
  234. <span class="command"><strong>libtoolize</strong></span>,
  235. <span class="command"><strong>autoheader</strong></span>,
  236. <span class="command"><strong>automake</strong></span>,
  237. and related commands.
  238. </p></div><div class="section" title="Configure before the build"><div class="titlepage"><div><div><h3 class="title"><a name="id308053"></a>Configure before the build</h3></div></div></div><p>
  239. BIND 10 uses the GNU Build System to discover build environment
  240. details.
  241. To generate the makefiles using the defaults, simply run:
  242. </p><pre class="screen">$ <strong class="userinput"><code>./configure</code></strong></pre><p>
  243. </p><p>
  244. Run <span class="command"><strong>./configure</strong></span> with the <code class="option">--help</code>
  245. switch to view the different options. The commonly-used options are:
  246. </p><div class="variablelist"><dl><dt><span class="term">--prefix</span></dt><dd>Define the installation location (the
  247. default is <code class="filename">/usr/local/</code>).
  248. </dd><dt><span class="term">--with-boost-include</span></dt><dd>Define the path to find the Boost headers.
  249. </dd><dt><span class="term">--with-pythonpath</span></dt><dd>Define the path to Python 3.1 if it is not in the
  250. standard execution path.
  251. </dd><dt><span class="term">--with-gtest</span></dt><dd>Enable building the C++ Unit Tests using the
  252. Google Tests framework. Optionally this can define the
  253. path to the gtest header files and library.
  254. </dd></dl></div><p>
  255. </p><p>
  256. For example, the following configures it to
  257. find the Boost headers, find the
  258. Python interpreter, and sets the installation location:
  259. </p><pre class="screen">$ <strong class="userinput"><code>./configure \
  260. --with-boost-include=/usr/pkg/include \
  261. --with-pythonpath=/usr/pkg/bin/python3.1 \
  262. --prefix=/opt/bind10</code></strong></pre><p>
  263. </p><p>
  264. If the configure fails, it may be due to missing or old
  265. dependencies.
  266. </p></div><div class="section" title="Build"><div class="titlepage"><div><div><h3 class="title"><a name="id309339"></a>Build</h3></div></div></div><p>
  267. After the configure step is complete, to build the executables
  268. from the C++ code and prepare the Python scripts, run:
  269. </p><pre class="screen">$ <strong class="userinput"><code>make</code></strong></pre><p>
  270. </p></div><div class="section" title="Install"><div class="titlepage"><div><div><h3 class="title"><a name="id309355"></a>Install</h3></div></div></div><p>
  271. To install the BIND 10 executables, support files,
  272. and documentation, run:
  273. </p><pre class="screen">$ <strong class="userinput"><code>make install</code></strong></pre><p>
  274. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The install step may require superuser privileges.</p></div></div><div class="section" title="Install Hierarchy"><div class="titlepage"><div><div><h3 class="title"><a name="id309382"></a>Install Hierarchy</h3></div></div></div><p>
  275. The following is the layout of the complete BIND 10 installation:
  276. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
  277. <code class="filename">bin/</code> &#8212;
  278. general tools and diagnostic clients.
  279. </li><li class="listitem">
  280. <code class="filename">etc/bind10-devel/</code> &#8212;
  281. configuration files.
  282. </li><li class="listitem">
  283. <code class="filename">lib/</code> &#8212;
  284. libraries and python modules.
  285. </li><li class="listitem">
  286. <code class="filename">libexec/bind10-devel/</code> &#8212;
  287. executables that a user wouldn't normally run directly and
  288. are not run independently.
  289. These are the BIND 10 modules which are daemons started by
  290. the <span class="command"><strong>bind10</strong></span> tool.
  291. </li><li class="listitem">
  292. <code class="filename">sbin/</code> &#8212;
  293. commands used by the system administrator.
  294. </li><li class="listitem">
  295. <code class="filename">share/bind10-devel/</code> &#8212;
  296. configuration specifications.
  297. </li><li class="listitem">
  298. <code class="filename">share/man/</code> &#8212;
  299. manual pages (online documentation).
  300. </li><li class="listitem">
  301. <code class="filename">var/bind10-devel/</code> &#8212;
  302. data source and configuration databases.
  303. </li></ul></div><p>
  304. </p></div></div></div><div class="chapter" title="Chapter 3. Starting BIND10 with bind10"><div class="titlepage"><div><div><h2 class="title"><a name="bind10"></a>Chapter 3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#start">Starting BIND 10</a></span></dt><dt><span class="section"><a href="#bind10.config">Configuration of started processes</a></span></dt></dl></div><p>
  305. BIND 10 provides the <span class="command"><strong>bind10</strong></span> command which
  306. starts up the required processes.
  307. <span class="command"><strong>bind10</strong></span>
  308. will also restart some processes that exit unexpectedly.
  309. This is the only command needed to start the BIND 10 system.
  310. </p><p>
  311. After starting the <span class="command"><strong>b10-msgq</strong></span> communications channel,
  312. <span class="command"><strong>bind10</strong></span> connects to it,
  313. runs the configuration manager, and reads its own configuration.
  314. Then it starts the other modules.
  315. </p><p>
  316. The <span class="command"><strong>b10-sockcreator</strong></span>, <span class="command"><strong>b10-msgq</strong></span> and
  317. <span class="command"><strong>b10-cfgmgr</strong></span>
  318. services make up the core. The <span class="command"><strong>b10-msgq</strong></span> daemon
  319. provides the communication channel between every part of the system.
  320. The <span class="command"><strong>b10-cfgmgr</strong></span> daemon is always needed by every
  321. module, if only to send information about themselves somewhere,
  322. but more importantly to ask about their own settings, and
  323. about other modules. The <span class="command"><strong>b10-sockcreator</strong></span> will
  324. allocate sockets for the rest of the system.
  325. </p><p>
  326. In its default configuration, the <span class="command"><strong>bind10</strong></span>
  327. master process will also start up
  328. <span class="command"><strong>b10-cmdctl</strong></span> for admins to communicate with the
  329. system, <span class="command"><strong>b10-auth</strong></span> for authoritative DNS service,
  330. <span class="command"><strong>b10-stats</strong></span> for statistics collection,
  331. <span class="command"><strong>b10-xfrin</strong></span> for inbound DNS zone transfers,
  332. <span class="command"><strong>b10-xfrout</strong></span> for outbound DNS zone transfers,
  333. and <span class="command"><strong>b10-zonemgr</strong></span> for secondary service.
  334. </p><div class="section" title="Starting BIND 10"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="start"></a>Starting BIND 10</h2></div></div></div><p>
  335. To start the BIND 10 service, simply run <span class="command"><strong>bind10</strong></span>.
  336. Run it with the <code class="option">--verbose</code> switch to
  337. get additional debugging or diagnostic output.
  338. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  339. If the setproctitle Python module is detected at start up,
  340. the process names for the Python-based daemons will be renamed
  341. to better identify them instead of just <span class="quote">&#8220;<span class="quote">python</span>&#8221;</span>.
  342. This is not needed on some operating systems.
  343. </p></div></div><div class="section" title="Configuration of started processes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="bind10.config"></a>Configuration of started processes</h2></div></div></div><p>
  344. The processes to be started can be configured, with the exception
  345. of the <span class="command"><strong>b10-sockcreator</strong></span>, <span class="command"><strong>b10-msgq</strong></span>
  346. and <span class="command"><strong>b10-cfgmgr</strong></span>.
  347. </p><p>
  348. The configuration is in the Boss/components section. Each element
  349. represents one component, which is an abstraction of a process
  350. (currently there's also one component which doesn't represent
  351. a process). If you didn't want to transfer out at all (your server
  352. is a slave only), you would just remove the corresponding component
  353. from the set, like this and the process would be stopped immediately
  354. (and not started on the next startup):
  355. </p><pre class="screen">&gt; <strong class="userinput"><code>config remove Boss/components b10-xfrout</code></strong>
  356. &gt; <strong class="userinput"><code>config commit</code></strong></pre><p>
  357. </p><p>
  358. To add a process to the set, let's say the resolver (which not started
  359. by default), you would do this:
  360. </p><pre class="screen">&gt; <strong class="userinput"><code>config add Boss/components b10-resolver</code></strong>
  361. &gt; <strong class="userinput"><code>config set Boss/components/b10-resolver/special resolver</code></strong>
  362. &gt; <strong class="userinput"><code>config set Boss/components/b10-resolver/kind needed</code></strong>
  363. &gt; <strong class="userinput"><code>config set Boss/components/b10-resolver/priority 10</code></strong>
  364. &gt; <strong class="userinput"><code>config commit</code></strong></pre><p>
  365. Now, what it means. We add an entry called b10-resolver. It is both a
  366. name used to reference this component in the configuration and the
  367. name of the process to start. Then we set some parameters on how to
  368. start it.
  369. </p><p>
  370. The special one is for components that need some kind of special care
  371. during startup or shutdown. Unless specified, the component is started
  372. in usual way. This is the list of components that need to be started
  373. in a special way, with the value of special used for them:
  374. </p><div class="table"><a name="id309696"></a><p class="title"><b>Table 3.1. </b></p><div class="table-contents"><table border="1"><colgroup><col align="left"><col align="left"><col align="left"></colgroup><thead><tr><th align="left">Component</th><th align="left">Special</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left">b10-auth</td><td align="left">auth</td><td align="left">Authoritative server</td></tr><tr><td align="left">b10-resolver</td><td align="left">resolver</td><td align="left">The resolver</td></tr><tr><td align="left">b10-cmdctl</td><td align="left">cmdctl</td><td align="left">The command control (remote control interface)</td></tr><tr><td align="left">setuid</td><td align="left">setuid</td><td align="left">Virtual component, see below</td></tr></tbody></table></div></div><p><br class="table-break">
  375. </p><p>
  376. The kind specifies how a failure of the component should
  377. be handled. If it is set to <span class="quote">&#8220;<span class="quote">dispensable</span>&#8221;</span>
  378. (the default unless you set something else), it will get
  379. started again if it fails. If it is set to <span class="quote">&#8220;<span class="quote">needed</span>&#8221;</span>
  380. and it fails at startup, the whole <span class="command"><strong>bind10</strong></span>
  381. shuts down and exits with error exit code. But if it fails
  382. some time later, it is just started again. If you set it
  383. to <span class="quote">&#8220;<span class="quote">core</span>&#8221;</span>, you indicate that the system is
  384. not usable without the component and if such component
  385. fails, the system shuts down no matter when the failure
  386. happened. This is the behaviour of the core components
  387. (the ones you can't turn off), but you can declare any
  388. other components as core as well if you wish (but you can
  389. turn these off, they just can't fail).
  390. </p><p>
  391. The priority defines order in which the components should start.
  392. The ones with higher number are started sooner than the ones with
  393. lower ones. If you don't set it, 0 (zero) is used as the priority.
  394. </p><p>
  395. There are other parameters we didn't use in our example.
  396. One of them is <span class="quote">&#8220;<span class="quote">address</span>&#8221;</span>. It is the address
  397. used by the component on the <span class="command"><strong>b10-msgq</strong></span>
  398. message bus. The special components already know their
  399. address, but the usual ones don't. The address is by
  400. convention the thing after <span class="emphasis"><em>b10-</em></span>, with
  401. the first letter capital (eg. <span class="command"><strong>b10-stats</strong></span>
  402. would have <span class="quote">&#8220;<span class="quote">Stats</span>&#8221;</span> as its address).
  403. </p><p>
  404. The last one is process. It is the name of the process to be started.
  405. It defaults to the name of the component if not set, but you can use
  406. this to override it.
  407. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  408. This system allows you to start the same component multiple times
  409. (by including it in the configuration with different names, but the
  410. same process setting). However, the rest of the system doesn't expect
  411. such situation, so it would probably not do what you want. Such
  412. support is yet to be implemented.
  413. </p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  414. The configuration is quite powerful, but that includes
  415. a lot of space for mistakes. You could turn off the
  416. <span class="command"><strong>b10-cmdctl</strong></span>, but then you couldn't
  417. change it back the usual way, as it would require it to
  418. be running (you would have to find and edit the configuration
  419. directly). Also, some modules might have dependencies
  420. -- <span class="command"><strong>b10-stats-httpd</strong></span> need
  421. <span class="command"><strong>b10-stats</strong></span>, <span class="command"><strong>b10-xfrout</strong></span>
  422. needs the <span class="command"><strong>b10-auth</strong></span> to be running, etc.
  423. </p><p>
  424. In short, you should think twice before disabling something here.
  425. </p></div><p>
  426. Now, to the mysterious setuid virtual component. If you
  427. use the <span class="command"><strong>-u</strong></span> option to start the
  428. <span class="command"><strong>bind10</strong></span> as root, but change the user
  429. later, we need to start the <span class="command"><strong>b10-auth</strong></span> or
  430. <span class="command"><strong>b10-resolver</strong></span> as root (until the socket
  431. creator is finished). So we need to specify
  432. the time when the switch from root do the given user happens
  433. and that's what the setuid component is for. The switch is
  434. done at the time the setuid component would be started, if
  435. it was a process. The default configuration contains the
  436. setuid component with priority 5, <span class="command"><strong>b10-auth</strong></span>
  437. has 10 to be started before the switch and everything else
  438. is without priority, so it is started after the switch.
  439. </p></div></div><div class="chapter" title="Chapter 4. Command channel"><div class="titlepage"><div><div><h2 class="title"><a name="msgq"></a>Chapter 4. Command channel</h2></div></div></div><p>
  440. The BIND 10 components use the <span class="command"><strong>b10-msgq</strong></span>
  441. message routing daemon to communicate with other BIND 10 components.
  442. The <span class="command"><strong>b10-msgq</strong></span> implements what is called the
  443. <span class="quote">&#8220;<span class="quote">Command Channel</span>&#8221;</span>.
  444. Processes intercommunicate by sending messages on the command
  445. channel.
  446. Example messages include shutdown, get configurations, and set
  447. configurations.
  448. This Command Channel is not used for DNS message passing.
  449. It is used only to control and monitor the BIND 10 system.
  450. </p><p>
  451. Administrators do not communicate directly with the
  452. <span class="command"><strong>b10-msgq</strong></span> daemon.
  453. By default, BIND 10 uses port 9912 for the
  454. <span class="command"><strong>b10-msgq</strong></span> service.
  455. It listens on 127.0.0.1.
  456. </p></div><div class="chapter" title="Chapter 5. Configuration manager"><div class="titlepage"><div><div><h2 class="title"><a name="cfgmgr"></a>Chapter 5. Configuration manager</h2></div></div></div><p>
  457. The configuration manager, <span class="command"><strong>b10-cfgmgr</strong></span>,
  458. handles all BIND 10 system configuration. It provides
  459. persistent storage for configuration, and notifies running
  460. modules of configuration changes.
  461. </p><p>
  462. The <span class="command"><strong>b10-auth</strong></span> and <span class="command"><strong>b10-xfrin</strong></span>
  463. daemons and other components receive their configurations
  464. from the configuration manager over the <span class="command"><strong>b10-msgq</strong></span>
  465. command channel.
  466. </p><p>The administrator doesn't connect to it directly, but
  467. uses a user interface to communicate with the configuration
  468. manager via <span class="command"><strong>b10-cmdctl</strong></span>'s REST-ful interface.
  469. <span class="command"><strong>b10-cmdctl</strong></span> is covered in <a class="xref" href="#cmdctl" title="Chapter 6. Remote control daemon">Chapter 6, <i>Remote control daemon</i></a>.
  470. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  471. The development prototype release only provides the
  472. <span class="command"><strong>bindctl</strong></span> as a user interface to
  473. <span class="command"><strong>b10-cmdctl</strong></span>.
  474. Upcoming releases will provide another interactive command-line
  475. interface and a web-based interface.
  476. </p></div><p>
  477. The <span class="command"><strong>b10-cfgmgr</strong></span> daemon can send all
  478. specifications and all current settings to the
  479. <span class="command"><strong>bindctl</strong></span> client (via
  480. <span class="command"><strong>b10-cmdctl</strong></span>).
  481. </p><p>
  482. <span class="command"><strong>b10-cfgmgr</strong></span> relays configurations received
  483. from <span class="command"><strong>b10-cmdctl</strong></span> to the appropriate modules.
  484. </p><p>
  485. The stored configuration file is at
  486. <code class="filename">/usr/local/var/bind10-devel/b10-config.db</code>.
  487. (The full path is what was defined at build configure time for
  488. <code class="option">--localstatedir</code>.
  489. The default is <code class="filename">/usr/local/var/</code>.)
  490. The format is loosely based on JSON and is directly parseable
  491. python, but this may change in a future version.
  492. This configuration data file is not manually edited by the
  493. administrator.
  494. </p><p>
  495. The configuration manager does not have any command line arguments.
  496. Normally it is not started manually, but is automatically
  497. started using the <span class="command"><strong>bind10</strong></span> master process
  498. (as covered in <a class="xref" href="#bind10" title="Chapter 3. Starting BIND10 with bind10">Chapter 3, <i>Starting BIND10 with <span class="command"><strong>bind10</strong></span></i></a>).
  499. </p></div><div class="chapter" title="Chapter 6. Remote control daemon"><div class="titlepage"><div><div><h2 class="title"><a name="cmdctl"></a>Chapter 6. Remote control daemon</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#cmdctl.spec">Configuration specification for b10-cmdctl</a></span></dt></dl></div><p>
  500. <span class="command"><strong>b10-cmdctl</strong></span> is the gateway between
  501. administrators and the BIND 10 system.
  502. It is a HTTPS server that uses standard HTTP Digest
  503. Authentication for username and password validation.
  504. It provides a REST-ful interface for accessing and controlling
  505. BIND 10.
  506. </p><p>
  507. When <span class="command"><strong>b10-cmdctl</strong></span> starts, it firsts
  508. asks <span class="command"><strong>b10-cfgmgr</strong></span> about what modules are
  509. running and what their configuration is (over the
  510. <span class="command"><strong>b10-msgq</strong></span> channel). Then it will start listening
  511. on HTTPS for clients &#8212; the user interface &#8212; such
  512. as <span class="command"><strong>bindctl</strong></span>.
  513. </p><p>
  514. <span class="command"><strong>b10-cmdctl</strong></span> directly sends commands
  515. (received from the user interface) to the specified component.
  516. Configuration changes are actually commands to
  517. <span class="command"><strong>b10-cfgmgr</strong></span> so are sent there.
  518. </p><p>The HTTPS server requires a private key,
  519. such as a RSA PRIVATE KEY.
  520. The default location is at
  521. <code class="filename">/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</code>.
  522. (A sample key is at
  523. <code class="filename">/usr/local/share/bind10-devel/cmdctl-keyfile.pem</code>.)
  524. It also uses a certificate located at
  525. <code class="filename">/usr/local/etc/bind10-devel/cmdctl-certfile.pem</code>.
  526. (A sample certificate is at
  527. <code class="filename">/usr/local/share/bind10-devel/cmdctl-certfile.pem</code>.)
  528. This may be a self-signed certificate or purchased from a
  529. certification authority.
  530. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  531. The HTTPS server doesn't support a certificate request from a
  532. client (at this time).
  533. The <span class="command"><strong>b10-cmdctl</strong></span> daemon does not provide a
  534. public service. If any client wants to control BIND 10, then
  535. a certificate needs to be first received from the BIND 10
  536. administrator.
  537. The BIND 10 installation provides a sample PEM bundle that matches
  538. the sample key and certificate.
  539. </p></div><p>
  540. The <span class="command"><strong>b10-cmdctl</strong></span> daemon also requires
  541. the user account file located at
  542. <code class="filename">/usr/local/etc/bind10-devel/cmdctl-accounts.csv</code>.
  543. This comma-delimited file lists the accounts with a user name,
  544. hashed password, and salt.
  545. (A sample file is at
  546. <code class="filename">/usr/local/share/bind10-devel/cmdctl-accounts.csv</code>.
  547. It contains the user named <span class="quote">&#8220;<span class="quote">root</span>&#8221;</span> with the password
  548. <span class="quote">&#8220;<span class="quote">bind10</span>&#8221;</span>.)
  549. </p><p>
  550. The administrator may create a user account with the
  551. <span class="command"><strong>b10-cmdctl-usermgr</strong></span> tool.
  552. </p><p>
  553. By default the HTTPS server listens on the localhost port 8080.
  554. The port can be set by using the <code class="option">--port</code> command line option.
  555. The address to listen on can be set using the <code class="option">--address</code> command
  556. line argument.
  557. Each HTTPS connection is stateless and timesout in 1200 seconds
  558. by default. This can be
  559. redefined by using the <code class="option">--idle-timeout</code> command line argument.
  560. </p><div class="section" title="Configuration specification for b10-cmdctl"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmdctl.spec"></a>Configuration specification for b10-cmdctl</h2></div></div></div><p>
  561. The configuration items for <span class="command"><strong>b10-cmdctl</strong></span> are:
  562. key_file
  563. cert_file
  564. accounts_file
  565. </p><p>
  566. The control commands are:
  567. print_settings
  568. shutdown
  569. </p></div></div><div class="chapter" title="Chapter 7. Control and configure user interface"><div class="titlepage"><div><div><h2 class="title"><a name="bindctl"></a>Chapter 7. Control and configure user interface</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  570. For this development prototype release, <span class="command"><strong>bindctl</strong></span>
  571. is the only user interface. It is expected that upcoming
  572. releases will provide another interactive command-line
  573. interface and a web-based interface for controlling and
  574. configuring BIND 10.
  575. </p></div><p>
  576. The <span class="command"><strong>bindctl</strong></span> tool provides an interactive
  577. prompt for configuring, controlling, and querying the BIND 10
  578. components.
  579. It communicates directly with a REST-ful interface over HTTPS
  580. provided by <span class="command"><strong>b10-cmdctl</strong></span>. It doesn't
  581. communicate to any other components directly.
  582. </p><p>
  583. Configuration changes are actually commands to
  584. <span class="command"><strong>b10-cfgmgr</strong></span>. So when <span class="command"><strong>bindctl</strong></span>
  585. sends a configuration, it is sent to <span class="command"><strong>b10-cmdctl</strong></span>
  586. (over a HTTPS connection); then <span class="command"><strong>b10-cmdctl</strong></span>
  587. sends the command (over a <span class="command"><strong>b10-msgq</strong></span> command
  588. channel) to <span class="command"><strong>b10-cfgmgr</strong></span> which then stores
  589. the details and relays (over a <span class="command"><strong>b10-msgq</strong></span> command
  590. channel) the configuration on to the specified module.
  591. </p><p>
  592. </p></div><div class="chapter" title="Chapter 8. Authoritative Server"><div class="titlepage"><div><div><h2 class="title"><a name="authserver"></a>Chapter 8. Authoritative Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id310420">Server Configurations</a></span></dt><dt><span class="section"><a href="#id310493">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id310529">Loading Master Zones Files</a></span></dt></dl></div><p>
  593. The <span class="command"><strong>b10-auth</strong></span> is the authoritative DNS server.
  594. It supports EDNS0 and DNSSEC. It supports IPv6.
  595. Normally it is started by the <span class="command"><strong>bind10</strong></span> master
  596. process.
  597. </p><div class="section" title="Server Configurations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id310420"></a>Server Configurations</h2></div></div></div><p>
  598. <span class="command"><strong>b10-auth</strong></span> is configured via the
  599. <span class="command"><strong>b10-cfgmgr</strong></span> configuration manager.
  600. The module name is <span class="quote">&#8220;<span class="quote">Auth</span>&#8221;</span>.
  601. The configuration data item is:
  602. </p><div class="variablelist"><dl><dt><span class="term">database_file</span></dt><dd>This is an optional string to define the path to find
  603. the SQLite3 database file.
  604. Note: Later the DNS server will use various data source backends.
  605. This may be a temporary setting until then.
  606. </dd></dl></div><p>
  607. </p><p>
  608. The configuration command is:
  609. </p><div class="variablelist"><dl><dt><span class="term">shutdown</span></dt><dd>Stop the authoritative DNS server.
  610. </dd></dl></div><p>
  611. </p></div><div class="section" title="Data Source Backends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id310493"></a>Data Source Backends</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  612. For the development prototype release, <span class="command"><strong>b10-auth</strong></span>
  613. supports a SQLite3 data source backend and in-memory data source
  614. backend.
  615. Upcoming versions will be able to use multiple different
  616. data sources, such as MySQL and Berkeley DB.
  617. </p></div><p>
  618. By default, the SQLite3 backend uses the data file located at
  619. <code class="filename">/usr/local/var/bind10-devel/zone.sqlite3</code>.
  620. (The full path is what was defined at build configure time for
  621. <code class="option">--localstatedir</code>.
  622. The default is <code class="filename">/usr/local/var/</code>.)
  623. This data file location may be changed by defining the
  624. <span class="quote">&#8220;<span class="quote">database_file</span>&#8221;</span> configuration.
  625. </p></div><div class="section" title="Loading Master Zones Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id310529"></a>Loading Master Zones Files</h2></div></div></div><p>
  626. RFC 1035 style DNS master zone files may imported
  627. into a BIND 10 data source by using the
  628. <span class="command"><strong>b10-loadzone</strong></span> utility.
  629. </p><p>
  630. <span class="command"><strong>b10-loadzone</strong></span> supports the following
  631. special directives (control entries):
  632. </p><div class="variablelist"><dl><dt><span class="term">$INCLUDE</span></dt><dd>Loads an additional zone file. This may be recursive.
  633. </dd><dt><span class="term">$ORIGIN</span></dt><dd>Defines the relative domain name.
  634. </dd><dt><span class="term">$TTL</span></dt><dd>Defines the time-to-live value used for following
  635. records that don't include a TTL.
  636. </dd></dl></div><p>
  637. </p><p>
  638. The <code class="option">-o</code> argument may be used to define the
  639. default origin for loaded zone file records.
  640. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  641. In the development prototype release, only the SQLite3 back
  642. end is used.
  643. By default, it stores the zone data in
  644. <code class="filename">/usr/local/var/bind10-devel/zone.sqlite3</code>
  645. unless the <code class="option">-d</code> switch is used to set the
  646. database filename.
  647. Multiple zones are stored in a single SQLite3 zone database.
  648. </p></div><p>
  649. If you reload a zone already existing in the database,
  650. all records from that prior zone disappear and a whole new set
  651. appears.
  652. </p></div></div><div class="chapter" title="Chapter 9. Incoming Zone Transfers"><div class="titlepage"><div><div><h2 class="title"><a name="xfrin"></a>Chapter 9. Incoming Zone Transfers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id310683">Configuration for Incoming Zone Transfers</a></span></dt><dt><span class="section"><a href="#id310728">Enabling IXFR</a></span></dt><dt><span class="section"><a href="#zonemgr">Secondary Manager</a></span></dt><dt><span class="section"><a href="#id310870">Trigger an Incoming Zone Transfer Manually</a></span></dt></dl></div><p>
  653. Incoming zones are transferred using the <span class="command"><strong>b10-xfrin</strong></span>
  654. process which is started by <span class="command"><strong>bind10</strong></span>.
  655. When received, the zone is stored in the corresponding BIND 10
  656. data source, and its records can be served by
  657. <span class="command"><strong>b10-auth</strong></span>.
  658. In combination with <span class="command"><strong>b10-zonemgr</strong></span> (for
  659. automated SOA checks), this allows the BIND 10 server to
  660. provide <span class="quote">&#8220;<span class="quote">secondary</span>&#8221;</span> service.
  661. </p><p>
  662. The <span class="command"><strong>b10-xfrin</strong></span> process supports both AXFR and
  663. IXFR. Due to some implementation limitations of the current
  664. development release, however, it only tries AXFR by default,
  665. and care should be taken to enable IXFR.
  666. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  667. In the current development release of BIND 10, incoming zone
  668. transfers are only available for SQLite3-based data sources,
  669. that is, they don't work for an in-memory data source.
  670. </p></div><div class="section" title="Configuration for Incoming Zone Transfers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id310683"></a>Configuration for Incoming Zone Transfers</h2></div></div></div><p>
  671. In practice, you need to specify a list of secondary zones to
  672. enable incoming zone transfers for these zones (you can still
  673. trigger a zone transfer manually, without a prior configuration
  674. (see below)).
  675. </p><p>
  676. For example, to enable zone transfers for a zone named "example.com"
  677. (whose master address is assumed to be 2001:db8::53 here),
  678. run the following at the <span class="command"><strong>bindctl</strong></span> prompt:
  679. </p><pre class="screen">&gt; <strong class="userinput"><code>config add Xfrin/zones</code></strong>
  680. &gt; <strong class="userinput"><code>config set Xfrin/zones[0]/name "<code class="option">example.com</code>"</code></strong>
  681. &gt; <strong class="userinput"><code>config set Xfrin/zones[0]/master_addr "<code class="option">2001:db8::53</code>"</code></strong>
  682. &gt; <strong class="userinput"><code>config commit</code></strong></pre><p>
  683. (We assume there has been no zone configuration before).
  684. </p></div><div class="section" title="Enabling IXFR"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id310728"></a>Enabling IXFR</h2></div></div></div><p>
  685. As noted above, <span class="command"><strong>b10-xfrin</strong></span> uses AXFR for
  686. zone transfers by default. To enable IXFR for zone transfers
  687. for a particular zone, set the <strong class="userinput"><code>use_ixfr</code></strong>
  688. configuration parameter to <strong class="userinput"><code>true</code></strong>.
  689. In the above example of configuration sequence, you'll need
  690. to add the following before performing <strong class="userinput"><code>commit</code></strong>:
  691. </p><pre class="screen">&gt; <strong class="userinput"><code>config set Xfrin/zones[0]/use_ixfr true</code></strong></pre><p>
  692. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  693. One reason why IXFR is disabled by default in the current
  694. release is because it does not support automatic fallback from IXFR to
  695. AXFR when it encounters a primary server that doesn't support
  696. outbound IXFR (and, not many existing implementations support
  697. it). Another, related reason is that it does not use AXFR even
  698. if it has no knowledge about the zone (like at the very first
  699. time the secondary server is set up). IXFR requires the
  700. "current version" of the zone, so obviously it doesn't work
  701. in this situation and AXFR is the only workable choice.
  702. The current release of <span class="command"><strong>b10-xfrin</strong></span> does not
  703. make this selection automatically.
  704. These features will be implemented in a near future
  705. version, at which point we will enable IXFR by default.
  706. </p></div></div><div class="section" title="Secondary Manager"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="zonemgr"></a>Secondary Manager</h2></div></div></div><p>
  707. The <span class="command"><strong>b10-zonemgr</strong></span> process is started by
  708. <span class="command"><strong>bind10</strong></span>.
  709. It keeps track of SOA refresh, retry, and expire timers
  710. and other details for BIND 10 to perform as a slave.
  711. When the <span class="command"><strong>b10-auth</strong></span> authoritative DNS server
  712. receives a NOTIFY message, <span class="command"><strong>b10-zonemgr</strong></span>
  713. may tell <span class="command"><strong>b10-xfrin</strong></span> to do a refresh
  714. to start an inbound zone transfer.
  715. The secondary manager resets its counters when a new zone is
  716. transferred in.
  717. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  718. Access control (such as allowing notifies) is not yet provided.
  719. The primary/secondary service is not yet complete.
  720. </p></div><p>
  721. The following example shows using <span class="command"><strong>bindctl</strong></span>
  722. to configure the server to be a secondary for the example zone:
  723. </p><pre class="screen">&gt; <strong class="userinput"><code>config add Zonemgr/secondary_zones</code></strong>
  724. &gt; <strong class="userinput"><code>config set Zonemgr/secondary_zones[0]/name "<code class="option">example.com</code>"</code></strong>
  725. &gt; <strong class="userinput"><code>config set Zonemgr/secondary_zones[0]/class "<code class="option">IN</code>"</code></strong>
  726. &gt; <strong class="userinput"><code>config commit</code></strong></pre><p>
  727. </p><p>
  728. If the zone does not exist in the data source already
  729. (i.e. no SOA record for it), <span class="command"><strong>b10-zonemgr</strong></span>
  730. will automatically tell <span class="command"><strong>b10-xfrin</strong></span>
  731. to transfer the zone in.
  732. </p></div><div class="section" title="Trigger an Incoming Zone Transfer Manually"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id310870"></a>Trigger an Incoming Zone Transfer Manually</h2></div></div></div><p>
  733. To manually trigger a zone transfer to retrieve a remote zone,
  734. you may use the <span class="command"><strong>bindctl</strong></span> utility.
  735. For example, at the <span class="command"><strong>bindctl</strong></span> prompt run:
  736. </p><pre class="screen">&gt; <strong class="userinput"><code>Xfrin retransfer zone_name="<code class="option">foo.example.org</code>" master=<code class="option">192.0.2.99</code></code></strong></pre><p>
  737. </p></div></div><div class="chapter" title="Chapter 10. Outbound Zone Transfers"><div class="titlepage"><div><div><h2 class="title"><a name="xfrout"></a>Chapter 10. Outbound Zone Transfers</h2></div></div></div><p>
  738. The <span class="command"><strong>b10-xfrout</strong></span> process is started by
  739. <span class="command"><strong>bind10</strong></span>.
  740. When the <span class="command"><strong>b10-auth</strong></span> authoritative DNS server
  741. receives an AXFR or IXFR request, <span class="command"><strong>b10-auth</strong></span>
  742. internally forwards the request to <span class="command"><strong>b10-xfrout</strong></span>,
  743. which handles the rest of request processing.
  744. This is used to provide primary DNS service to share zones
  745. to secondary name servers.
  746. The <span class="command"><strong>b10-xfrout</strong></span> is also used to send
  747. NOTIFY messages to secondary servers.
  748. </p><p>
  749. A global or per zone <code class="option">transfer_acl</code> configuration
  750. can be used to control accessibility of the outbound zone
  751. transfer service.
  752. By default, <span class="command"><strong>b10-xfrout</strong></span> allows any clients to
  753. perform zone transfers for any zones:
  754. </p><pre class="screen">&gt; <strong class="userinput"><code>config show Xfrout/transfer_acl</code></strong>
  755. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</pre><p>
  756. You can change this to, for example, rejecting all transfer
  757. requests by default while allowing requests for the transfer
  758. of zone "example.com" from 192.0.2.1 and 2001:db8::1 as follows:
  759. </p><pre class="screen">&gt; <strong class="userinput"><code>config set Xfrout/transfer_acl[0] {"action": "REJECT"}</code></strong>
  760. &gt; <strong class="userinput"><code>config add Xfrout/zone_config</code></strong>
  761. &gt; <strong class="userinput"><code>config set Xfrout/zone_config[0]/origin "example.com"</code></strong>
  762. &gt; <strong class="userinput"><code>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1"},</code></strong>
  763. <strong class="userinput"><code> {"action": "ACCEPT", "from": "2001:db8::1"}]</code></strong>
  764. &gt; <strong class="userinput"><code>config commit</code></strong></pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  765. In the above example the lines
  766. for <code class="option">transfer_acl</code> were divided for
  767. readability. In the actual input it must be in a single line.
  768. </p></div><p>
  769. If you want to require TSIG in access control, a separate TSIG
  770. "key ring" must be configured specifically
  771. for <span class="command"><strong>b10-xfrout</strong></span> as well as a system wide
  772. key ring, both containing a consistent set of keys.
  773. For example, to change the previous example to allowing requests
  774. from 192.0.2.1 signed by a TSIG with a key name of
  775. "key.example", you'll need to do this:
  776. </p><pre class="screen">&gt; <strong class="userinput"><code>config set tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</code></strong>
  777. &gt; <strong class="userinput"><code>config set Xfrout/tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</code></strong>
  778. &gt; <strong class="userinput"><code>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]</code></strong>
  779. &gt; <strong class="userinput"><code>config commit</code></strong></pre><p>
  780. The first line of configuration defines a system wide key ring.
  781. This is necessary because the <span class="command"><strong>b10-auth</strong></span> server
  782. also checks TSIGs and it uses the system wide configuration.
  783. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  784. In a future version, <span class="command"><strong>b10-xfrout</strong></span> will also
  785. use the system wide TSIG configuration.
  786. The way to specify zone specific configuration (ACLs, etc) is
  787. likely to be changed, too.
  788. </p></div></div><div class="chapter" title="Chapter 11. Recursive Name Server"><div class="titlepage"><div><div><h2 class="title"><a name="resolverserver"></a>Chapter 11. Recursive Name Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id311183">Access Control</a></span></dt><dt><span class="section"><a href="#id311322">Forwarding</a></span></dt></dl></div><p>
  789. The <span class="command"><strong>b10-resolver</strong></span> process is started by
  790. <span class="command"><strong>bind10</strong></span>.
  791. </p><p>
  792. The main <span class="command"><strong>bind10</strong></span> process can be configured
  793. to select to run either the authoritative or resolver or both.
  794. By default, it starts the authoritative service.
  795. You may change this using <span class="command"><strong>bindctl</strong></span>, for example:
  796. </p><pre class="screen">
  797. &gt; <strong class="userinput"><code>config remove Boss/components b10-xfrout</code></strong>
  798. &gt; <strong class="userinput"><code>config remove Boss/components b10-xfrin</code></strong>
  799. &gt; <strong class="userinput"><code>config remove Boss/components b10-auth</code></strong>
  800. &gt; <strong class="userinput"><code>config add Boss/components b10-resolver</code></strong>
  801. &gt; <strong class="userinput"><code>config set Boss/components/b10-resolver/special resolver</code></strong>
  802. &gt; <strong class="userinput"><code>config set Boss/components/b10-resolver/kind needed</code></strong>
  803. &gt; <strong class="userinput"><code>config set Boss/components/b10-resolver/priority 10</code></strong>
  804. &gt; <strong class="userinput"><code>config commit</code></strong>
  805. </pre><p>
  806. </p><p>
  807. The master <span class="command"><strong>bind10</strong></span> will stop and start
  808. the desired services.
  809. </p><p>
  810. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  811. The following example shows how it can be configured to
  812. listen on an additional address (and port):
  813. </p><pre class="screen">
  814. &gt; <strong class="userinput"><code>config add Resolver/listen_on</code></strong>
  815. &gt; <strong class="userinput"><code>config set Resolver/listen_on[<em class="replaceable"><code>2</code></em>]/address "192.168.1.1"</code></strong>
  816. &gt; <strong class="userinput"><code>config set Resolver/listen_on[<em class="replaceable"><code>2</code></em>]/port 53</code></strong>
  817. &gt; <strong class="userinput"><code>config commit</code></strong>
  818. </pre><p>
  819. </p><p>(Replace the <span class="quote">&#8220;<span class="quote"><em class="replaceable"><code>2</code></em></span>&#8221;</span>
  820. as needed; run <span class="quote">&#8220;<span class="quote"><strong class="userinput"><code>config show
  821. Resolver/listen_on</code></strong></span>&#8221;</span> if needed.)</p><div class="section" title="Access Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id311183"></a>Access Control</h2></div></div></div><p>
  822. By default, the <span class="command"><strong>b10-resolver</strong></span> daemon only accepts
  823. DNS queries from the localhost (127.0.0.1 and ::1).
  824. The <code class="option">Resolver/query_acl</code> configuration may
  825. be used to reject, drop, or allow specific IPs or networks.
  826. This configuration list is first match.
  827. </p><p>
  828. The configuration's <code class="option">action</code> item may be
  829. set to <span class="quote">&#8220;<span class="quote">ACCEPT</span>&#8221;</span> to allow the incoming query,
  830. <span class="quote">&#8220;<span class="quote">REJECT</span>&#8221;</span> to respond with a DNS REFUSED return
  831. code, or <span class="quote">&#8220;<span class="quote">DROP</span>&#8221;</span> to ignore the query without
  832. any response (such as a blackhole). For more information,
  833. see the respective debugging messages: <a class="ulink" href="bind10-messages.html#RESOLVER_QUERY_ACCEPTED" target="_top">RESOLVER_QUERY_ACCEPTED</a>,
  834. <a class="ulink" href="bind10-messages.html#RESOLVER_QUERY_REJECTED" target="_top">RESOLVER_QUERY_REJECTED</a>,
  835. and <a class="ulink" href="bind10-messages.html#RESOLVER_QUERY_DROPPED" target="_top">RESOLVER_QUERY_DROPPED</a>.
  836. </p><p>
  837. The required configuration's <code class="option">from</code> item is set
  838. to an IPv4 or IPv6 address, addresses with an network mask, or to
  839. the special lowercase keywords <span class="quote">&#8220;<span class="quote">any6</span>&#8221;</span> (for
  840. any IPv6 address) or <span class="quote">&#8220;<span class="quote">any4</span>&#8221;</span> (for any IPv4
  841. address).
  842. </p><p>
  843. For example to allow the <em class="replaceable"><code>192.168.1.0/24</code></em>
  844. network to use your recursive name server, at the
  845. <span class="command"><strong>bindctl</strong></span> prompt run:
  846. </p><pre class="screen">
  847. &gt; <strong class="userinput"><code>config add Resolver/query_acl</code></strong>
  848. &gt; <strong class="userinput"><code>config set Resolver/query_acl[<em class="replaceable"><code>2</code></em>]/action "ACCEPT"</code></strong>
  849. &gt; <strong class="userinput"><code>config set Resolver/query_acl[<em class="replaceable"><code>2</code></em>]/from "<em class="replaceable"><code>192.168.1.0/24</code></em>"</code></strong>
  850. &gt; <strong class="userinput"><code>config commit</code></strong>
  851. </pre><p>(Replace the <span class="quote">&#8220;<span class="quote"><em class="replaceable"><code>2</code></em></span>&#8221;</span>
  852. as needed; run <span class="quote">&#8220;<span class="quote"><strong class="userinput"><code>config show
  853. Resolver/query_acl</code></strong></span>&#8221;</span> if needed.)</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This prototype access control configuration
  854. syntax may be changed.</p></div></div><div class="section" title="Forwarding"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id311322"></a>Forwarding</h2></div></div></div><p>
  855. To enable forwarding, the upstream address and port must be
  856. configured to forward queries to, such as:
  857. </p><pre class="screen">
  858. &gt; <strong class="userinput"><code>config set Resolver/forward_addresses [{ "address": "<em class="replaceable"><code>192.168.1.1</code></em>", "port": 53 }]</code></strong>
  859. &gt; <strong class="userinput"><code>config commit</code></strong>
  860. </pre><p>
  861. (Replace <em class="replaceable"><code>192.168.1.1</code></em> to point to your
  862. full resolver.)
  863. </p><p>
  864. Normal iterative name service can be re-enabled by clearing the
  865. forwarding address(es); for example:
  866. </p><pre class="screen">
  867. &gt; <strong class="userinput"><code>config set Resolver/forward_addresses []</code></strong>
  868. &gt; <strong class="userinput"><code>config commit</code></strong>
  869. </pre><p>
  870. </p></div></div><div class="chapter" title="Chapter 12. DHCPv4 Server"><div class="titlepage"><div><div><h2 class="title"><a name="dhcp4"></a>Chapter 12. DHCPv4 Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#dhcp4-usage">DHCPv4 Server Usage</a></span></dt><dt><span class="section"><a href="#dhcp4-config">DHCPv4 Server Configuration</a></span></dt><dt><span class="section"><a href="#dhcp4-std">Supported standards</a></span></dt><dt><span class="section"><a href="#dhcp4-limit">DHCPv4 Server Limitations</a></span></dt></dl></div><p>Dynamic Host Configuration Protocol for IPv4 (DHCP or
  871. DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  872. are protocols that allow one node (server) to provision
  873. configuration parameters to many hosts and devices (clients). To
  874. ease deployment in larger networks, additional nodes (relays) may
  875. be deployed that facilitate communication between servers and
  876. clients. Even though principles of both DHCPv4 and DHCPv6 are
  877. somewhat similar, these are two radically different
  878. protocols. BIND10 offers server implementations for both DHCPv4
  879. and DHCPv6. This chapter is about DHCP for IPv4. For description of
  880. DHCPv6 server, see <a class="xref" href="#dhcp6" title="Chapter 13. DHCPv6 Server">Chapter 13, <i>DHCPv6 Server</i></a>.</p><p>DHCPv6 server component is currently under intense
  881. development. You may want to check out <a class="ulink" href="http://bind10.isc.org/wiki/Kea" target="_top">BIND10 DHCP (Kea) wiki</a>
  882. and recent posts on <a class="ulink" href="https://lists.isc.org/mailman/listinfo/bind10-dev" target="_top">BIND10
  883. developers mailing list</a>.</p><p>DHCPv4 and DHCPv6 components in BIND10 architecture are
  884. internally code named <span class="quote">&#8220;<span class="quote">Kea</span>&#8221;</span>.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  885. As of December 2011, both DHCPv4 and DHCPv6 components are
  886. skeleton servers. That means that while they are capable of
  887. performing DHCP configuration, they are not fully functional
  888. yet. In particular, both do not have functional lease
  889. databases. This means that they will assign the same, fixed,
  890. hardcoded addresses to any client that will ask. See <a class="xref" href="#dhcp4-limit" title="DHCPv4 Server Limitations">the section called &#8220;DHCPv4 Server Limitations&#8221;</a> and <a class="xref" href="#dhcp6-limit" title="DHCPv6 Server Limitations">the section called &#8220;DHCPv6 Server Limitations&#8221;</a> for
  891. detailed description.
  892. </p></div><div class="section" title="DHCPv4 Server Usage"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp4-usage"></a>DHCPv4 Server Usage</h2></div></div></div><p>BIND10 provides DHCPv4 server component since December
  893. 2011. It is a skeleton server and can be described as an early
  894. prototype that is not fully functional yet. It is mature enough
  895. to conduct first tests in lab environment, but it has
  896. significant limitations. See <a class="xref" href="#dhcp4-limit" title="DHCPv4 Server Limitations">the section called &#8220;DHCPv4 Server Limitations&#8221;</a> for
  897. details.
  898. </p><p>
  899. DHCPv4 server is implemented as <span class="command"><strong>b10-dhcp4</strong></span>
  900. daemon. As it is not configurable yet, it is fully autonomous,
  901. i.e. it does not interact with <span class="command"><strong>b10-cfgmgr</strong></span>.
  902. To start DHCPv4 server, simply input:
  903. </p><pre class="screen">
  904. #<strong class="userinput"><code>cd src/bin/dhcp4</code></strong>
  905. #<strong class="userinput"><code>./b10-dhcp4</code></strong>
  906. </pre><p>
  907. Depending on your installation, <span class="command"><strong>b10-dhcp4</strong></span>
  908. binary may reside in src/bin/dhcp4 in your source code
  909. directory, in /usr/local/bin/b10-dhcp4 or other directory
  910. you specified during compilation.
  911. After start, server will detect available network interfaces
  912. and will attempt to open UDP sockets on all interfaces that
  913. are up, running, are not loopback and have IPv4 address
  914. assigned.
  915. Server will then listen to incoming traffic. Currently
  916. supported client messages are DISCOVER and REQUEST. Server
  917. will respond to them with OFFER and ACK, respectively.
  918. As DHCPv4 server opens privileged ports, it requires root
  919. access. Make sure you run this daemon as root.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  920. Integration with <span class="command"><strong>bind10</strong></span> is
  921. planned. Ultimately, <span class="command"><strong>b10-dhcp4</strong></span> will not
  922. be started directly, but rather via
  923. <span class="command"><strong>bind10</strong></span>. Please be aware of this planned
  924. change.
  925. </p></div></div><div class="section" title="DHCPv4 Server Configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp4-config"></a>DHCPv4 Server Configuration</h2></div></div></div><p>
  926. DHCPv4 server does not have lease database implemented yet
  927. or any support for configuration, so every time the same set
  928. of configuration options (including the same fixed address)
  929. will be assigned every time.
  930. </p><p>
  931. At this stage of development, the only way to alter server
  932. configuration is to tweak its source code. To do so, please
  933. edit src/bin/dhcp4/dhcp4_srv.cc file and modify following
  934. parameters and recompile:
  935. </p><pre class="screen">
  936. const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
  937. const std::string HARDCODED_NETMASK = "255.255.255.0";
  938. const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds
  939. const std::string HARDCODED_GATEWAY = "192.0.2.1";
  940. const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
  941. const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
  942. const std::string HARDCODED_SERVER_ID = "192.0.2.1";</pre><p>
  943. Lease database and configuration support is planned for 2012.
  944. </p></div><div class="section" title="Supported standards"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp4-std"></a>Supported standards</h2></div></div></div><p>The following standards and draft standards are currently
  945. supported:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">RFC2131: Supported messages are DISCOVER, OFFER,
  946. REQUEST, and ACK.</li><li class="listitem">RFC2132: Supported options are: PAD (0),
  947. END(255), Message Type(53), DHCP Server Identifier (54),
  948. Domain Name (15), DNS Servers (6), IP Address Lease Time
  949. (51), Subnet mask (1), and Routers (3).</li></ul></div></div><div class="section" title="DHCPv4 Server Limitations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp4-limit"></a>DHCPv4 Server Limitations</h2></div></div></div><p> These are the current limitations of DHCPv4 server
  950. software. Most of them are reflections of the early stage of
  951. development and should be treated as <span class="quote">&#8220;<span class="quote">not implemented
  952. yet</span>&#8221;</span>, rather than actual limitations.</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">During initial IPv4 node configuration, server is
  953. expected to send packets to a node that does not have IPv4
  954. address assigned yet. Server requires certain tricks (or
  955. hacks) to transmit such packets. This is not implemented
  956. yet, therefore DHCPv4 server supports relayed traffic only
  957. (that is normal point to point communication).</li><li class="listitem"><span class="command"><strong>b10-dhcp4</strong></span> provides a single,
  958. fixed, hardcoded lease to any client that asks. There is
  959. no lease manager implemented. If two clients request
  960. addresses, they will both get the same fixed
  961. address.</li><li class="listitem"><span class="command"><strong>b10-dhcp4</strong></span> does not support any
  962. configuration mechanisms yet. The whole configuration is
  963. currently hardcoded. The only way to tweak configuration
  964. is to directly modify source code. See see <a class="xref" href="#dhcp4-config" title="DHCPv4 Server Configuration">the section called &#8220;DHCPv4 Server Configuration&#8221;</a> for details.</li><li class="listitem">Upon start, server will open sockets on all
  965. interfaces that are not loopback, are up and running and
  966. have IPv4 address. Support for multiple interfaces is not
  967. coded in reception routines yet, so if you are running
  968. this code on a machine that has many interfaces and
  969. <span class="command"><strong>b10-dhcp4</strong></span> happens to listen on wrong
  970. interface, the easiest way to work around this problem is
  971. to turn down other interfaces. This limitation will be
  972. fixed shortly.</li><li class="listitem">PRL (Parameter Request List, a list of options
  973. requested by a client) is currently ignored and server
  974. assigns DNS SERVER and DOMAIN NAME options.</li><li class="listitem"><span class="command"><strong>b10-dhcp4</strong></span> does not support
  975. BOOTP. That is a design choice. This limitation is
  976. permanent. If you have legacy nodes that can't use DHCP and
  977. require BOOTP support, please use latest version of ISC DHCP
  978. <a class="ulink" href="http://www.isc.org/software/dhcp" target="_top">http://www.isc.org/software/dhcp</a>.</li><li class="listitem">Interface detection is currently working on Linux
  979. only. See <a class="xref" href="#iface-detect" title="Interface detection">the section called &#8220;Interface detection&#8221;</a> for details.</li><li class="listitem"><span class="command"><strong>b10-dhcp4</strong></span> does not verify that
  980. assigned address is unused. According to RFC2131, the
  981. allocating server should verify that address is no used by
  982. sending ICMP echo request.</li><li class="listitem">Address renewal (RENEW), rebinding (REBIND),
  983. confirmation (CONFIRM), duplication report (DECLINE) and
  984. release (RELEASE) are not supported yet.</li><li class="listitem">DNS Update is not supported yet.</li><li class="listitem">-v (verbose) command line option is currently
  985. permanently enabled.</li></ul></div></div></div><div class="chapter" title="Chapter 13. DHCPv6 Server"><div class="titlepage"><div><div><h2 class="title"><a name="dhcp6"></a>Chapter 13. DHCPv6 Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#dhcp6-usage">DHCPv6 Server Usage</a></span></dt><dt><span class="section"><a href="#dhcp6-config">DHCPv6 Server Configuration</a></span></dt><dt><span class="section"><a href="#dhcp6-std">Supported DHCPv6 Standards</a></span></dt><dt><span class="section"><a href="#dhcp6-limit">DHCPv6 Server Limitations</a></span></dt></dl></div><p>Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is
  986. specified in RFC3315. BIND10 provides DHCPv6 server implementation
  987. that is described in this chapter. For DHCPv4 server
  988. implementation, see <a class="xref" href="#dhcp4" title="Chapter 12. DHCPv4 Server">Chapter 12, <i>DHCPv4 Server</i></a>.
  989. </p><p>DHCPv6 server component is currently under intense
  990. development. You may want to check out <a class="ulink" href="http://bind10.isc.org/wiki/Kea" target="_top">BIND10 DHCP (Kea) wiki</a>
  991. and recent posts on <a class="ulink" href="https://lists.isc.org/mailman/listinfo/bind10-dev" target="_top">BIND10
  992. developers mailing list</a>.</p><p>DHCPv4 and DHCPv6 components in BIND10 architecture are
  993. internally code named <span class="quote">&#8220;<span class="quote">Kea</span>&#8221;</span>.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  994. As of December 2011, both DHCPv4 and DHCPv6 components are
  995. skeleton servers. That means that while they are capable of
  996. performing DHCP configuration, they are not fully functional
  997. yet. In particular, both do not have functional lease
  998. databases. This means that they will assign the same, fixed,
  999. hardcoded addresses to any client that will ask. See <a class="xref" href="#dhcp4-limit" title="DHCPv4 Server Limitations">the section called &#8220;DHCPv4 Server Limitations&#8221;</a> and <a class="xref" href="#dhcp6-limit" title="DHCPv6 Server Limitations">the section called &#8220;DHCPv6 Server Limitations&#8221;</a> for
  1000. detailed description.
  1001. </p></div><div class="section" title="DHCPv6 Server Usage"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp6-usage"></a>DHCPv6 Server Usage</h2></div></div></div><p>
  1002. BIND10 provides DHCPv6 server component since September
  1003. 2011. It is a skeleton server and can be described as an early
  1004. prototype that is not fully functional yet. It is mature
  1005. enough to conduct first tests in lab environment, but it has
  1006. significant limitations. See <a class="xref" href="#dhcp6-limit" title="DHCPv6 Server Limitations">the section called &#8220;DHCPv6 Server Limitations&#8221;</a> for
  1007. details.
  1008. </p><p>
  1009. DHCPv6 server is implemented as <span class="command"><strong>b10-dhcp6</strong></span>
  1010. daemon. As it is not configurable yet, it is fully autonomous,
  1011. i.e. it does not interact with <span class="command"><strong>b10-cfgmgr</strong></span>.
  1012. To start DHCPv6 server, simply input:
  1013. </p><pre class="screen">
  1014. #<strong class="userinput"><code>cd src/bin/dhcp6</code></strong>
  1015. #<strong class="userinput"><code>./b10-dhcp6</code></strong>
  1016. </pre><p>
  1017. Depending on your installation, <span class="command"><strong>b10-dhcp6</strong></span>
  1018. binary may reside in src/bin/dhcp6 in your source code
  1019. directory, in /usr/local/bin/b10-dhcp6 or other directory
  1020. you specified during compilation.
  1021. After start, server will detect available network interfaces
  1022. and will attempt to open UDP sockets on all interfaces that
  1023. are up, running, are not loopback, are multicast-capable and
  1024. have IPv6 address assigned.
  1025. Server will then listen to incoming traffic. Currently
  1026. supported client messages are SOLICIT and REQUEST. Server
  1027. will respond to them with ADVERTISE and REPLY, respectively.
  1028. As DHCPv6 server opens privileged ports, it requires root
  1029. access. Make sure you run this daemon as root.
  1030. </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
  1031. Integration with <span class="command"><strong>bind10</strong></span> is
  1032. planned. Ultimately, <span class="command"><strong>b10-dhcp6</strong></span> will not
  1033. be started directly, but rather via
  1034. <span class="command"><strong>bind10</strong></span>. Please be aware of this planned
  1035. change.
  1036. </p></div></div><div class="section" title="DHCPv6 Server Configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp6-config"></a>DHCPv6 Server Configuration</h2></div></div></div><p>
  1037. DHCPv4 server does not have lease database implemented yet
  1038. or any support for configuration, so every time the same set
  1039. of configuration options (including the same fixed address)
  1040. will be assigned every time.
  1041. </p><p>
  1042. At this stage of development, the only way to alter server
  1043. configuration is to tweak its source code. To do so, please
  1044. edit src/bin/dhcp6/dhcp6_srv.cc file and modify following
  1045. parameters and recompile:
  1046. </p><pre class="screen">
  1047. const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
  1048. const uint32_t HARDCODED_T1 = 1500; // in seconds
  1049. const uint32_t HARDCODED_T2 = 2600; // in seconds
  1050. const uint32_t HARDCODED_PREFERRED_LIFETIME = 3600; // in seconds
  1051. const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds
  1052. const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";</pre><p>
  1053. Lease database and configuration support is planned for 2012.
  1054. </p></div><div class="section" title="Supported DHCPv6 Standards"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp6-std"></a>Supported DHCPv6 Standards</h2></div></div></div><p>The following standards and draft standards are currently
  1055. supported:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">RFC3315: Supported messages are SOLICIT,
  1056. ADVERTISE, REQUEST, and REPLY. Supported options are
  1057. SERVER_ID, CLIENT_ID, IA_NA, and IAADDRESS.</li><li class="listitem">RFC3646: Supported option is DNS_SERVERS.</li></ul></div></div><div class="section" title="DHCPv6 Server Limitations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dhcp6-limit"></a>DHCPv6 Server Limitations</h2></div></div></div><p> These are the current limitations of DHCPv6 server
  1058. software. Most of them are reflections of the early stage of
  1059. development and should be treated as <span class="quote">&#8220;<span class="quote">not implemented
  1060. yet</span>&#8221;</span>, rather than actual limitations.</p><p>
  1061. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">Relayed traffic is not supported.</li><li class="listitem"><span class="command"><strong>b10-dhcp6</strong></span> provides a single,
  1062. fixed, hardcoded lease to any client that asks. There is no
  1063. lease manager implemented. If two clients request addresses,
  1064. they will both get the same fixed address.</li><li class="listitem"><span class="command"><strong>b10-dhcp6</strong></span> does not support any
  1065. configuration mechanisms yet. The whole configuration is
  1066. currently hardcoded. The only way to tweak configuration
  1067. is to directly modify source code. See see <a class="xref" href="#dhcp6-config" title="DHCPv6 Server Configuration">the section called &#8220;DHCPv6 Server Configuration&#8221;</a> for details.</li><li class="listitem">Upon start, server will open sockets on all
  1068. interfaces that are not loopback, are up, running and are
  1069. multicast capable and have IPv6 address. Support for
  1070. multiple interfaces is not coded in reception routines yet,
  1071. so if you are running this code on a machine that has many
  1072. interfaces and <span class="command"><strong>b10-dhcp6</strong></span> happens to
  1073. listen on wrong interface, the easiest way to work around
  1074. this problem is to turn down other interfaces. This
  1075. limitation will be fixed shortly.</li><li class="listitem">ORO (Option Request Option, a list of options
  1076. requested by a client) is currently ignored and server
  1077. assigns DNS SERVER option.</li><li class="listitem">Temporary addresses are not supported yet.</li><li class="listitem">Prefix delegation is not supported yet.</li><li class="listitem">Address renewal (RENEW), rebinding (REBIND),
  1078. confirmation (CONFIRM), duplication report (DECLINE) and
  1079. release (RELEASE) are not supported yet.</li><li class="listitem">DNS Update is not supported yet.</li><li class="listitem">Interface detection is currently working on Linux
  1080. only. See <a class="xref" href="#iface-detect" title="Interface detection">the section called &#8220;Interface detection&#8221;</a> for details.</li><li class="listitem">-v (verbose) command line option is currently permanently
  1081. enabled.</li></ul></div><p>
  1082. </p></div></div><div class="chapter" title="Chapter 14. libdhcp++ library"><div class="titlepage"><div><div><h2 class="title"><a name="libdhcp"></a>Chapter 14. libdhcp++ library</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#iface-detect">Interface detection</a></span></dt><dt><span class="section"><a href="#packet-handling">DHCPv4/DHCPv6 packet handling</a></span></dt></dl></div><p>libdhcp++ is a common library written in C++ that handles
  1083. many DHCP-related tasks, like DHCPv4 and DHCPv6 packets parsing,
  1084. manipulation and assembly, option parsing, manipulation and
  1085. assembly, network interface detection and socket operations, like
  1086. socket creations, data transmission and reception and socket
  1087. closing.
  1088. </p><p>
  1089. While this library is currently used by
  1090. <span class="command"><strong>b10-dhcp4</strong></span> and <span class="command"><strong>b10-dhcp6</strong></span>
  1091. only, it is designed to be portable, universal library useful for
  1092. any kind of DHCP-related software.
  1093. </p><div class="section" title="Interface detection"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="iface-detect"></a>Interface detection</h2></div></div></div><p>Both DHCPv4 and DHCPv6 components share network
  1094. interface detection routines. Interface detection is
  1095. currently only supported on Linux systems.</p><p>For non-linux systems, there is currently stub
  1096. implementation provided. As DHCP servers need to know available
  1097. addresses, there is a simple mechanism implemented to provide
  1098. that information. User is expected to create interfaces.txt
  1099. file. Format of this file is simple. It contains list of
  1100. interfaces along with available address on each interface. This
  1101. mechanism is temporary and is going to be removed as soon as
  1102. interface detection becomes available on non-linux
  1103. systems. Example of interfaces.txt file looks as follows:
  1104. </p><pre class="screen">
  1105. # For DHCPv6, please specify link-local address (starts with fe80::)
  1106. # If in doubt, check output of 'ifconfig -a' command.
  1107. eth0 fe80::21e:8cff:fe9b:7349
  1108. # For DHCPv4, please use following format:
  1109. #eth0 192.0.2.5</pre><p>
  1110. </p></div><div class="section" title="DHCPv4/DHCPv6 packet handling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="packet-handling"></a>DHCPv4/DHCPv6 packet handling</h2></div></div></div><p>TODO: Describe packet handling here, with pointers to wiki</p></div></div><div class="chapter" title="Chapter 15. Statistics"><div class="titlepage"><div><div><h2 class="title"><a name="statistics"></a>Chapter 15. Statistics</h2></div></div></div><p>
  1111. The <span class="command"><strong>b10-stats</strong></span> process is started by
  1112. <span class="command"><strong>bind10</strong></span>.
  1113. It periodically collects statistics data from various modules
  1114. and aggregates it.
  1115. </p><p>
  1116. This stats daemon provides commands to identify if it is
  1117. running, show specified or all statistics data, show specified
  1118. or all statistics data schema, and set specified statistics
  1119. data.
  1120. For example, using <span class="command"><strong>bindctl</strong></span>:
  1121. </p><pre class="screen">
  1122. &gt; <strong class="userinput"><code>Stats show</code></strong>
  1123. {
  1124. "Auth": {
  1125. "queries.tcp": 1749,
  1126. "queries.udp": 867868
  1127. },
  1128. "Boss": {
  1129. "boot_time": "2011-01-20T16:59:03Z"
  1130. },
  1131. "Stats": {
  1132. "boot_time": "2011-01-20T16:59:05Z",
  1133. "last_update_time": "2011-01-20T17:04:05Z",
  1134. "lname": "4d3869d9_a@jreed.example.net",
  1135. "report_time": "2011-01-20T17:04:06Z",
  1136. "timestamp": 1295543046.823504
  1137. }
  1138. }
  1139. </pre><p>
  1140. </p></div><div class="chapter" title="Chapter 16. Logging"><div class="titlepage"><div><div><h2 class="title"><a name="logging"></a>Chapter 16. Logging</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id312142">Logging configuration</a></span></dt><dd><dl><dt><span class="section"><a href="#id312157">Loggers</a></span></dt><dt><span class="section"><a href="#id312460">Output Options</a></span></dt><dt><span class="section"><a href="#id312654">Example session</a></span></dt></dl></dd><dt><span class="section"><a href="#id312910">Logging Message Format</a></span></dt></dl></div><div class="section" title="Logging configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id312142"></a>Logging configuration</h2></div></div></div><p>
  1141. The logging system in BIND 10 is configured through the
  1142. Logging module. All BIND 10 modules will look at the
  1143. configuration in Logging to see what should be logged and
  1144. to where.
  1145. </p><div class="section" title="Loggers"><div class="titlepage"><div><div><h3 class="title"><a name="id312157"></a>Loggers</h3></div></div></div><p>
  1146. Within BIND 10, a message is logged through a component
  1147. called a "logger". Different parts of BIND 10 log messages
  1148. through different loggers, and each logger can be configured
  1149. independently of one another.
  1150. </p><p>
  1151. In the Logging module, you can specify the configuration
  1152. for zero or more loggers; any that are not specified will
  1153. take appropriate default values..
  1154. </p><p>
  1155. The three most important elements of a logger configuration
  1156. are the <code class="option">name</code> (the component that is
  1157. generating the messages), the <code class="option">severity</code>
  1158. (what to log), and the <code class="option">output_options</code>
  1159. (where to log).
  1160. </p><div class="section" title="name (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id312188"></a>name (string)</h4></div></div></div><p>
  1161. Each logger in the system has a name, the name being that
  1162. of the component using it to log messages. For instance,
  1163. if you want to configure logging for the resolver module,
  1164. you add an entry for a logger named <span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span>. This
  1165. configuration will then be used by the loggers in the
  1166. Resolver module, and all the libraries used by it.
  1167. </p><p>
  1168. If you want to specify logging for one specific library
  1169. within the module, you set the name to
  1170. <em class="replaceable"><code>module.library</code></em>. For example, the
  1171. logger used by the nameserver address store component
  1172. has the full name of <span class="quote">&#8220;<span class="quote">Resolver.nsas</span>&#8221;</span>. If
  1173. there is no entry in Logging for a particular library,
  1174. it will use the configuration given for the module.
  1175. </p><p>
  1176. To illustrate this, suppose you want the cache library
  1177. to log messages of severity DEBUG, and the rest of the
  1178. resolver code to log messages of severity INFO. To achieve
  1179. this you specify two loggers, one with the name
  1180. <span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span> and severity INFO, and one with
  1181. the name <span class="quote">&#8220;<span class="quote">Resolver.cache</span>&#8221;</span> with severity
  1182. DEBUG. As there are no entries for other libraries (e.g.
  1183. the nsas), they will use the configuration for the module
  1184. (<span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span>), so giving the desired behavior.
  1185. </p><p>
  1186. One special case is that of a module name of <span class="quote">&#8220;<span class="quote">*</span>&#8221;</span>
  1187. (asterisks), which is interpreted as <span class="emphasis"><em>any</em></span>
  1188. module. You can set global logging options by using this,
  1189. including setting the logging configuration for a library
  1190. that is used by multiple modules (e.g. <span class="quote">&#8220;<span class="quote">*.config</span>&#8221;</span>
  1191. specifies the configuration library code in whatever
  1192. module is using it).
  1193. </p><p>
  1194. If there are multiple logger specifications in the
  1195. configuration that might match a particular logger, the
  1196. specification with the more specific logger name takes
  1197. precedence. For example, if there are entries for for
  1198. both <span class="quote">&#8220;<span class="quote">*</span>&#8221;</span> and <span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span>, the
  1199. resolver module &#8212; and all libraries it uses &#8212;
  1200. will log messages according to the configuration in the
  1201. second entry (<span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span>). All other modules
  1202. will use the configuration of the first entry
  1203. (<span class="quote">&#8220;<span class="quote">*</span>&#8221;</span>). If there was also a configuration
  1204. entry for <span class="quote">&#8220;<span class="quote">Resolver.cache</span>&#8221;</span>, the cache library
  1205. within the resolver would use that in preference to the
  1206. entry for <span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span>.
  1207. </p><p>
  1208. One final note about the naming. When specifying the
  1209. module name within a logger, use the name of the module
  1210. as specified in <span class="command"><strong>bindctl</strong></span>, e.g.
  1211. <span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span> for the resolver module,
  1212. <span class="quote">&#8220;<span class="quote">Xfrout</span>&#8221;</span> for the xfrout module, etc. When
  1213. the message is logged, the message will include the name
  1214. of the logger generating the message, but with the module
  1215. name replaced by the name of the process implementing
  1216. the module (so for example, a message generated by the
  1217. <span class="quote">&#8220;<span class="quote">Auth.cache</span>&#8221;</span> logger will appear in the output
  1218. with a logger name of <span class="quote">&#8220;<span class="quote">b10-auth.cache</span>&#8221;</span>).
  1219. </p></div><div class="section" title="severity (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id312322"></a>severity (string)</h4></div></div></div><p>
  1220. This specifies the category of messages logged.
  1221. Each message is logged with an associated severity which
  1222. may be one of the following (in descending order of
  1223. severity):
  1224. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"> FATAL </li><li class="listitem"> ERROR </li><li class="listitem"> WARN </li><li class="listitem"> INFO </li><li class="listitem"> DEBUG </li></ul></div><p>
  1225. When the severity of a logger is set to one of these
  1226. values, it will only log messages of that severity, and
  1227. the severities above it. The severity may also be set to
  1228. NONE, in which case all messages from that logger are
  1229. inhibited.
  1230. </p></div><div class="section" title="output_options (list)"><div class="titlepage"><div><div><h4 class="title"><a name="id312380"></a>output_options (list)</h4></div></div></div><p>
  1231. Each logger can have zero or more
  1232. <code class="option">output_options</code>. These specify where log
  1233. messages are sent to. These are explained in detail below.
  1234. </p><p>
  1235. The other options for a logger are:
  1236. </p></div><div class="section" title="debuglevel (integer)"><div class="titlepage"><div><div><h4 class="title"><a name="id312399"></a>debuglevel (integer)</h4></div></div></div><p>
  1237. When a logger's severity is set to DEBUG, this value
  1238. specifies what debug messages should be printed. It ranges
  1239. from 0 (least verbose) to 99 (most verbose).
  1240. </p><p>
  1241. If severity for the logger is not DEBUG, this value is ignored.
  1242. </p></div><div class="section" title="additive (true or false)"><div class="titlepage"><div><div><h4 class="title"><a name="id312419"></a>additive (true or false)</h4></div></div></div><p>
  1243. If this is true, the <code class="option">output_options</code> from
  1244. the parent will be used. For example, if there are two
  1245. loggers configured; <span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span> and
  1246. <span class="quote">&#8220;<span class="quote">Resolver.cache</span>&#8221;</span>, and <code class="option">additive</code>
  1247. is true in the second, it will write the log messages
  1248. not only to the destinations specified for
  1249. <span class="quote">&#8220;<span class="quote">Resolver.cache</span>&#8221;</span>, but also to the destinations
  1250. as specified in the <code class="option">output_options</code> in
  1251. the logger named <span class="quote">&#8220;<span class="quote">Resolver</span>&#8221;</span>.
  1252. </p></div></div><div class="section" title="Output Options"><div class="titlepage"><div><div><h3 class="title"><a name="id312460"></a>Output Options</h3></div></div></div><p>
  1253. The main settings for an output option are the
  1254. <code class="option">destination</code> and a value called
  1255. <code class="option">output</code>, the meaning of which depends on
  1256. the destination that is set.
  1257. </p><div class="section" title="destination (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id312477"></a>destination (string)</h4></div></div></div><p>
  1258. The destination is the type of output. It can be one of:
  1259. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"> console </li><li class="listitem"> file </li><li class="listitem"> syslog </li></ul></div></div><div class="section" title="output (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id312511"></a>output (string)</h4></div></div></div><p>
  1260. Depending on what is set as the output destination, this
  1261. value is interpreted as follows:
  1262. </p><div class="variablelist"><dl><dt><span class="term"><code class="option">destination</code> is <span class="quote">&#8220;<span class="quote">console</span>&#8221;</span></span></dt><dd>
  1263. The value of output must be one of <span class="quote">&#8220;<span class="quote">stdout</span>&#8221;</span>
  1264. (messages printed to standard output) or
  1265. <span class="quote">&#8220;<span class="quote">stderr</span>&#8221;</span> (messages printed to standard
  1266. error).
  1267. </dd><dt><span class="term"><code class="option">destination</code> is <span class="quote">&#8220;<span class="quote">file</span>&#8221;</span></span></dt><dd>
  1268. The value of output is interpreted as a file name;
  1269. log messages will be appended to this file.
  1270. </dd><dt><span class="term"><code class="option">destination</code> is <span class="quote">&#8220;<span class="quote">syslog</span>&#8221;</span></span></dt><dd>
  1271. The value of output is interpreted as the
  1272. <span class="command"><strong>syslog</strong></span> facility (e.g.
  1273. <span class="emphasis"><em>local0</em></span>) that should be used
  1274. for log messages.
  1275. </dd></dl></div><p>
  1276. The other options for <code class="option">output_options</code> are:
  1277. </p><div class="section" title="flush (true of false)"><div class="titlepage"><div><div><h5 class="title"><a name="id312604"></a>flush (true of false)</h5></div></div></div><p>
  1278. Flush buffers after each log message. Doing this will
  1279. reduce performance but will ensure that if the program
  1280. terminates abnormally, all messages up to the point of
  1281. termination are output.
  1282. </p></div><div class="section" title="maxsize (integer)"><div class="titlepage"><div><div><h5 class="title"><a name="id312616"></a>maxsize (integer)</h5></div></div></div><p>
  1283. Only relevant when destination is file, this is maximum
  1284. file size of output files in bytes. When the maximum
  1285. size is reached, the file is renamed and a new file opened.
  1286. (For example, a ".1" is appended to the name &#8212;
  1287. if a ".1" file exists, it is renamed ".2",
  1288. etc.)
  1289. </p><p>
  1290. If this is 0, no maximum file size is used.
  1291. </p></div><div class="section" title="maxver (integer)"><div class="titlepage"><div><div><h5 class="title"><a name="id312633"></a>maxver (integer)</h5></div></div></div><p>
  1292. Maximum number of old log files to keep around when
  1293. rolling the output file. Only relevant when
  1294. <code class="option">destination</code> is <span class="quote">&#8220;<span class="quote">file</span>&#8221;</span>.
  1295. </p></div></div></div><div class="section" title="Example session"><div class="titlepage"><div><div><h3 class="title"><a name="id312654"></a>Example session</h3></div></div></div><p>
  1296. In this example we want to set the global logging to
  1297. write to the file <code class="filename">/var/log/my_bind10.log</code>,
  1298. at severity WARN. We want the authoritative server to
  1299. log at DEBUG with debuglevel 40, to a different file
  1300. (<code class="filename">/tmp/debug_messages</code>).
  1301. </p><p>
  1302. Start <span class="command"><strong>bindctl</strong></span>.
  1303. </p><p>
  1304. </p><pre class="screen">["login success "]
  1305. &gt; <strong class="userinput"><code>config show Logging</code></strong>
  1306. Logging/loggers [] list
  1307. </pre><p>
  1308. </p><p>
  1309. By default, no specific loggers are configured, in which
  1310. case the severity defaults to INFO and the output is
  1311. written to stderr.
  1312. </p><p>
  1313. Let's first add a default logger:
  1314. </p><p>
  1315. </p><pre class="screen"><strong class="userinput"><code>&gt; config add Logging/loggers</code></strong>
  1316. &gt; <strong class="userinput"><code>config show Logging</code></strong>
  1317. Logging/loggers/ list (modified)
  1318. </pre><p>
  1319. </p><p>
  1320. The loggers value line changed to indicate that it is no
  1321. longer an empty list:
  1322. </p><p>
  1323. </p><pre class="screen">&gt; <strong class="userinput"><code>config show Logging/loggers</code></strong>
  1324. Logging/loggers[0]/name "" string (default)
  1325. Logging/loggers[0]/severity "INFO" string (default)
  1326. Logging/loggers[0]/debuglevel 0 integer (default)
  1327. Logging/loggers[0]/additive false boolean (default)
  1328. Logging/loggers[0]/output_options [] list (default)
  1329. </pre><p>
  1330. </p><p>
  1331. The name is mandatory, so we must set it. We will also
  1332. change the severity as well. Let's start with the global
  1333. logger.
  1334. </p><p>
  1335. </p><pre class="screen">&gt; <strong class="userinput"><code>config set Logging/loggers[0]/name *</code></strong>
  1336. &gt; <strong class="userinput"><code>config set Logging/loggers[0]/severity WARN</code></strong>
  1337. &gt; <strong class="userinput"><code>config show Logging/loggers</code></strong>
  1338. Logging/loggers[0]/name "*" string (modified)
  1339. Logging/loggers[0]/severity "WARN" string (modified)
  1340. Logging/loggers[0]/debuglevel 0 integer (default)
  1341. Logging/loggers[0]/additive false boolean (default)
  1342. Logging/loggers[0]/output_options [] list (default)
  1343. </pre><p>
  1344. </p><p>
  1345. Of course, we need to specify where we want the log
  1346. messages to go, so we add an entry for an output option.
  1347. </p><p>
  1348. </p><pre class="screen">&gt; <strong class="userinput"><code> config add Logging/loggers[0]/output_options</code></strong>
  1349. &gt; <strong class="userinput"><code> config show Logging/loggers[0]/output_options</code></strong>
  1350. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  1351. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  1352. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1353. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  1354. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  1355. </pre><p>
  1356. </p><p>
  1357. These aren't the values we are looking for.
  1358. </p><p>
  1359. </p><pre class="screen">&gt; <strong class="userinput"><code> config set Logging/loggers[0]/output_options[0]/destination file</code></strong>
  1360. &gt; <strong class="userinput"><code> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</code></strong>
  1361. &gt; <strong class="userinput"><code> config set Logging/loggers[0]/output_options[0]/maxsize 30000</code></strong>
  1362. &gt; <strong class="userinput"><code> config set Logging/loggers[0]/output_options[0]/maxver 8</code></strong>
  1363. </pre><p>
  1364. </p><p>
  1365. Which would make the entire configuration for this logger
  1366. look like:
  1367. </p><p>
  1368. </p><pre class="screen">&gt; <strong class="userinput"><code> config show all Logging/loggers</code></strong>
  1369. Logging/loggers[0]/name "*" string (modified)
  1370. Logging/loggers[0]/severity "WARN" string (modified)
  1371. Logging/loggers[0]/debuglevel 0 integer (default)
  1372. Logging/loggers[0]/additive false boolean (default)
  1373. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  1374. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  1375. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1376. Logging/loggers[0]/output_options[0]/maxsize 30000 integer (modified)
  1377. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  1378. </pre><p>
  1379. </p><p>
  1380. That looks OK, so let's commit it before we add the
  1381. configuration for the authoritative server's logger.
  1382. </p><p>
  1383. </p><pre class="screen">&gt; <strong class="userinput"><code> config commit</code></strong></pre><p>
  1384. </p><p>
  1385. Now that we have set it, and checked each value along
  1386. the way, adding a second entry is quite similar.
  1387. </p><p>
  1388. </p><pre class="screen">&gt; <strong class="userinput"><code> config add Logging/loggers</code></strong>
  1389. &gt; <strong class="userinput"><code> config set Logging/loggers[1]/name Auth</code></strong>
  1390. &gt; <strong class="userinput"><code> config set Logging/loggers[1]/severity DEBUG</code></strong>
  1391. &gt; <strong class="userinput"><code> config set Logging/loggers[1]/debuglevel 40</code></strong>
  1392. &gt; <strong class="userinput"><code> config add Logging/loggers[1]/output_options</code></strong>
  1393. &gt; <strong class="userinput"><code> config set Logging/loggers[1]/output_options[0]/destination file</code></strong>
  1394. &gt; <strong class="userinput"><code> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</code></strong>
  1395. &gt; <strong class="userinput"><code> config commit</code></strong>
  1396. </pre><p>
  1397. </p><p>
  1398. And that's it. Once we have found whatever it was we
  1399. needed the debug messages for, we can simply remove the
  1400. second logger to let the authoritative server use the
  1401. same settings as the rest.
  1402. </p><p>
  1403. </p><pre class="screen">&gt; <strong class="userinput"><code> config remove Logging/loggers[1]</code></strong>
  1404. &gt; <strong class="userinput"><code> config commit</code></strong>
  1405. </pre><p>
  1406. </p><p>
  1407. And every module will now be using the values from the
  1408. logger named <span class="quote">&#8220;<span class="quote">*</span>&#8221;</span>.
  1409. </p></div></div><div class="section" title="Logging Message Format"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id312910"></a>Logging Message Format</h2></div></div></div><p>
  1410. Each message written by BIND 10 to the configured logging
  1411. destinations comprises a number of components that identify
  1412. the origin of the message and, if the message indicates
  1413. a problem, information about the problem that may be
  1414. useful in fixing it.
  1415. </p><p>
  1416. Consider the message below logged to a file:
  1417. </p><pre class="screen">2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  1418. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</pre><p>
  1419. </p><p>
  1420. Note: the layout of messages written to the system logging
  1421. file (syslog) may be slightly different. This message has
  1422. been split across two lines here for display reasons; in the
  1423. logging file, it will appear on one line.)
  1424. </p><p>
  1425. The log message comprises a number of components:
  1426. </p><div class="variablelist"><dl><dt><span class="term">2011-06-15 13:48:22.034</span></dt><dd><p>
  1427. The date and time at which the message was generated.
  1428. </p></dd><dt><span class="term">ERROR</span></dt><dd><p>
  1429. The severity of the message.
  1430. </p></dd><dt><span class="term">[b10-resolver.asiolink]</span></dt><dd><p>
  1431. The source of the message. This comprises two components:
  1432. the BIND 10 process generating the message (in this
  1433. case, <span class="command"><strong>b10-resolver</strong></span>) and the module
  1434. within the program from which the message originated
  1435. (which in the example is the asynchronous I/O link
  1436. module, asiolink).
  1437. </p></dd><dt><span class="term">ASIODNS_OPENSOCK</span></dt><dd><p>
  1438. The message identification. Every message in BIND 10
  1439. has a unique identification, which can be used as an
  1440. index into the <a class="ulink" href="bind10-messages.html" target="_top"><em class="citetitle">BIND 10 Messages
  1441. Manual</em></a> (<a class="ulink" href="http://bind10.isc.org/docs/bind10-messages.html" target="_top">http://bind10.isc.org/docs/bind10-messages.html</a>) from which more information can be obtained.
  1442. </p></dd><dt><span class="term">error 111 opening TCP socket to 127.0.0.1(53)</span></dt><dd><p>
  1443. A brief description of the cause of the problem.
  1444. Within this text, information relating to the condition
  1445. that caused the message to be logged will be included.
  1446. In this example, error number 111 (an operating
  1447. system-specific error number) was encountered when
  1448. trying to open a TCP connection to port 53 on the
  1449. local system (address 127.0.0.1). The next step
  1450. would be to find out the reason for the failure by
  1451. consulting your system's documentation to identify
  1452. what error number 111 means.
  1453. </p></dd></dl></div><p>
  1454. </p></div></div></div></body></html>