bind10-guide.html 132 KB

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