bind10-guide.html 93 KB

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