bind10-guide.xml 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2014;" >
  5. <!ENTITY % version SYSTEM "version.ent">
  6. %version;
  7. ]>
  8. <!--
  9. - Copyright (C) 2010-2011 Internet Systems Consortium, Inc. ("ISC")
  10. -
  11. - Permission to use, copy, modify, and/or distribute this software for any
  12. - purpose with or without fee is hereby granted, provided that the above
  13. - copyright notice and this permission notice appear in all copies.
  14. -
  15. - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  16. - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  17. - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  18. - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  19. - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  20. - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21. - PERFORMANCE OF THIS SOFTWARE.
  22. -->
  23. <book>
  24. <?xml-stylesheet href="bind10-guide.css" type="text/css"?>
  25. <bookinfo>
  26. <title>BIND 10 Guide</title>
  27. <subtitle>Administrator Reference for BIND 10</subtitle>
  28. <copyright>
  29. <year>2010-2011</year><holder>Internet Systems Consortium, Inc.</holder>
  30. </copyright>
  31. <abstract>
  32. <para>BIND 10 is a Domain Name System (DNS) suite managed by
  33. Internet Systems Consortium (ISC). It includes DNS libraries
  34. and modular components for controlling authoritative and
  35. recursive DNS servers.
  36. </para>
  37. <para>
  38. This is the reference guide for BIND 10 version &__VERSION__;.
  39. The most up-to-date version of this document (in PDF, HTML,
  40. and plain text formats), along with other documents for
  41. BIND 10, can be found at <ulink url="http://bind10.isc.org/docs"/>.
  42. </para> </abstract>
  43. <releaseinfo>This is the reference guide for BIND 10 version
  44. &__VERSION__;.</releaseinfo>
  45. </bookinfo>
  46. <chapter id="intro">
  47. <title>Introduction</title>
  48. <para>
  49. BIND is the popular implementation of a DNS server, developer
  50. interfaces, and DNS tools.
  51. BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++ and Python
  52. and provides a modular environment for serving and maintaining DNS.
  53. </para>
  54. <note>
  55. <para>
  56. This guide covers the experimental prototype of
  57. BIND 10 version &__VERSION__;.
  58. </para>
  59. </note>
  60. <note>
  61. <para>
  62. BIND 10 provides a EDNS0- and DNSSEC-capable
  63. authoritative DNS server and a caching recursive name server
  64. which also provides forwarding.
  65. </para>
  66. </note>
  67. <section>
  68. <title>Supported Platforms</title>
  69. <para>
  70. BIND 10 builds have been tested on Debian GNU/Linux 5,
  71. Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7 and 8, and CentOS
  72. Linux 5.3.
  73. It has been tested on Sparc, i386, and amd64 hardware
  74. platforms.
  75. It is planned for BIND 10 to build, install and run on
  76. Windows and standard Unix-type platforms.
  77. </para>
  78. </section>
  79. <section>
  80. <title>Required Software</title>
  81. <para>
  82. BIND 10 requires Python 3.1. Later versions may work, but Python
  83. 3.1 is the minimum version which will work.
  84. </para>
  85. <para>
  86. BIND 10 uses the Botan crypto library for C++. It requires
  87. at least Botan version 1.8.
  88. </para>
  89. <para>
  90. BIND 10 uses the log4cplus C++ logging library. It requires
  91. at least log4cplus version 1.0.3.
  92. </para>
  93. <para>
  94. The authoritative server requires SQLite 3.3.9 or newer.
  95. The <command>b10-xfrin</command>, <command>b10-xfrout</command>,
  96. and <command>b10-zonemgr</command> modules require the
  97. libpython3 library and the Python _sqlite3.so module.
  98. </para>
  99. <!-- TODO: this will change ... -->
  100. <!-- TODO: list where to get these from -->
  101. <note>
  102. <para>
  103. Some operating systems do not provide these dependencies
  104. in their default installation nor standard packages
  105. collections.
  106. You may need to install them separately.
  107. </para>
  108. </note>
  109. </section>
  110. <section id="starting_stopping">
  111. <title>Starting and Stopping the Server</title>
  112. <para>
  113. BIND 10 is modular. Part of this modularity is
  114. accomplished using multiple cooperating processes which, together,
  115. provide the server functionality. This is a change from
  116. the previous generation of BIND software, which used a
  117. single process.
  118. </para>
  119. <para>
  120. At first, running many different processes may seem confusing.
  121. However, these processes are started, stopped, and maintained
  122. by a single command, <command>bind10</command>.
  123. This command starts a master process which will start other
  124. processes as needed.
  125. The processes started by the <command>bind10</command>
  126. command have names starting with "b10-", including:
  127. </para>
  128. <para>
  129. <itemizedlist>
  130. <listitem>
  131. <simpara>
  132. <command>b10-msgq</command> &mdash;
  133. Message bus daemon.
  134. This process coordinates communication between all of the other
  135. BIND 10 processes.
  136. </simpara>
  137. </listitem>
  138. <listitem>
  139. <simpara>
  140. <command>b10-auth</command> &mdash;
  141. Authoritative DNS server.
  142. This process serves DNS requests.
  143. </simpara>
  144. </listitem>
  145. <listitem>
  146. <simpara>
  147. <command>b10-cfgmgr</command> &mdash;
  148. Configuration manager.
  149. This process maintains all of the configuration for BIND 10.
  150. </simpara>
  151. </listitem>
  152. <listitem>
  153. <simpara>
  154. <command>b10-cmdctl</command> &mdash;
  155. Command and control service.
  156. This process allows external control of the BIND 10 system.
  157. </simpara>
  158. </listitem>
  159. <listitem>
  160. <simpara>
  161. <command>b10-resolver</command> &mdash;
  162. Recursive name server.
  163. This process handles incoming queries.
  164. <!-- TODO: -->
  165. </simpara>
  166. </listitem>
  167. <listitem>
  168. <simpara>
  169. <command>b10-stats</command> &mdash;
  170. Statistics collection daemon.
  171. This process collects and reports statistics data.
  172. </simpara>
  173. </listitem>
  174. <listitem>
  175. <simpara>
  176. <command>b10-xfrin</command> &mdash;
  177. Incoming zone transfer service.
  178. This process is used to transfer a new copy
  179. of a zone into BIND 10, when acting as a secondary server.
  180. </simpara>
  181. </listitem>
  182. <listitem>
  183. <simpara>
  184. <command>b10-xfrout</command> &mdash;
  185. Outgoing zone transfer service.
  186. This process is used to handle transfer requests to
  187. send a local zone to a remote secondary server,
  188. when acting as a master server.
  189. </simpara>
  190. </listitem>
  191. <listitem>
  192. <simpara>
  193. <command>b10-zonemgr</command> &mdash;
  194. Secondary manager.
  195. This process keeps track of timers and other
  196. necessary information for BIND 10 to act as a slave server.
  197. </simpara>
  198. </listitem>
  199. </itemizedlist>
  200. </para>
  201. <para>
  202. These are ran automatically by <command>bind10</command>
  203. and do not need to be run manually.
  204. </para>
  205. </section>
  206. <section id="managing_once_running">
  207. <title>Managing BIND 10</title>
  208. <para>
  209. Once BIND 10 is running, a few commands are used to interact
  210. directly with the system:
  211. <itemizedlist>
  212. <listitem>
  213. <simpara>
  214. <command>bindctl</command> &mdash;
  215. interactive administration interface.
  216. This is a command-line tool which allows an administrator
  217. to control BIND 10.
  218. </simpara>
  219. </listitem>
  220. <listitem>
  221. <simpara>
  222. <command>b10-loadzone</command> &mdash;
  223. zone file loader.
  224. This tool will load standard masterfile-format zone files into
  225. BIND 10.
  226. </simpara>
  227. </listitem>
  228. <listitem>
  229. <simpara>
  230. <command>b10-cmdctl-usermgr</command> &mdash;
  231. user access control.
  232. This tool allows an administrator to authorize additional users
  233. to manage BIND 10.
  234. </simpara>
  235. </listitem>
  236. <!-- TODO usermgr -->
  237. </itemizedlist>
  238. </para>
  239. </section>
  240. <para>
  241. The tools and modules are covered in full detail in this guide.
  242. <!-- TODO point to these -->
  243. In addition, manual pages are also provided in the default installation.
  244. </para>
  245. <!--
  246. bin/
  247. bindctl*
  248. host*
  249. lib/
  250. libauth
  251. libdns
  252. libexceptions
  253. python3.1/site-packages/isc/{cc,config}
  254. sbin/
  255. bind10
  256. share/
  257. share/bind10/
  258. auth.spec
  259. b10-cmdctl.pem
  260. bob.spec
  261. passwd.csv
  262. man/
  263. var/
  264. bind10/b10-config.db
  265. -->
  266. <para>
  267. BIND 10 also provides libraries and programmer interfaces
  268. for C++ and Python for the message bus, configuration backend,
  269. and, of course, DNS. These include detailed developer
  270. documentation and code examples.
  271. <!-- TODO point to this -->
  272. </para>
  273. </chapter>
  274. <chapter id="installation">
  275. <title>Installation</title>
  276. <section>
  277. <title>Building Requirements</title>
  278. <para>
  279. In addition to the run-time requirements, building BIND 10
  280. from source code requires various development include headers.
  281. </para>
  282. <note>
  283. <simpara>
  284. Some operating systems have split their distribution packages into
  285. a run-time and a development package. You will need to install
  286. the development package versions, which include header files and
  287. libraries, to build BIND 10 from source code.
  288. </simpara>
  289. </note>
  290. <para>
  291. Building from source code requires the Boost
  292. build-time headers. At least Boost version 1.35 is required.
  293. <!-- TODO: we don't check for this version -->
  294. <!-- NOTE: jreed has tested with 1.34, 1.38, and 1.41. -->
  295. </para>
  296. <para>
  297. To build BIND 10, also install the Botan (at least version
  298. 1.8) and the log4cplus (at least version 1.0.3)
  299. development include headers.
  300. </para>
  301. <!--
  302. TODO
  303. Debian and Ubuntu:
  304. libgmp3-dev and libbz2-dev required for botan too
  305. -->
  306. <para>
  307. <!-- TODO: is this needed at build time? test time? -->
  308. The Python Library and Python _sqlite3 module are required to
  309. enable the Xfrout and Xfrin support.
  310. </para>
  311. <note><simpara>
  312. The Python related libraries and modules need to be built
  313. for Python 3.1.
  314. </simpara></note>
  315. <para>
  316. Building BIND 10 also requires a C++ compiler and
  317. standard development headers, make, and pkg-config.
  318. BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
  319. 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10.
  320. </para>
  321. </section>
  322. <section id="quickstart">
  323. <title>Quick start</title>
  324. <note>
  325. <simpara>
  326. This quickly covers the standard steps for installing
  327. and deploying BIND 10 as an authoritative name server using
  328. its defaults. For troubleshooting, full customizations and further
  329. details, see the respective chapters in the BIND 10 guide.
  330. </simpara>
  331. </note>
  332. <para>
  333. To quickly get started with BIND 10, follow these steps.
  334. </para>
  335. <orderedlist>
  336. <listitem>
  337. <simpara>
  338. Install required build dependencies.
  339. </simpara>
  340. </listitem>
  341. <listitem>
  342. <simpara>
  343. Download the BIND 10 source tar file from
  344. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  345. </simpara>
  346. </listitem>
  347. <listitem>
  348. <para>Extract the tar file:
  349. <screen>$ <userinput>gzcat bind10-<replaceable>VERSION</replaceable>.tar.gz | tar -xvf -</userinput></screen>
  350. </para>
  351. </listitem>
  352. <listitem>
  353. <para>Go into the source and run configure:
  354. <screen>$ <userinput>cd bind10-<replaceable>VERSION</replaceable></userinput>
  355. $ <userinput>./configure</userinput></screen>
  356. </para>
  357. </listitem>
  358. <listitem>
  359. <para>Build it:
  360. <screen>$ <userinput>make</userinput></screen>
  361. </para>
  362. </listitem>
  363. <listitem>
  364. <para>Install it (to default /usr/local):
  365. <screen>$ <userinput>make install</userinput></screen>
  366. </para>
  367. </listitem>
  368. <listitem>
  369. <para>Start the server:
  370. <screen>$ <userinput>/usr/local/sbin/bind10</userinput></screen>
  371. </para>
  372. </listitem>
  373. <listitem>
  374. <para>Test it; for example:
  375. <screen>$ <userinput>dig @127.0.0.1 -c CH -t TXT authors.bind</userinput></screen>
  376. </para>
  377. </listitem>
  378. <listitem>
  379. <para>Load desired zone file(s), for example:
  380. <screen>$ <userinput>b10-loadzone <replaceable>your.zone.example.org</replaceable></userinput></screen>
  381. </para>
  382. </listitem>
  383. <listitem>
  384. <simpara>
  385. Test the new zone.
  386. </simpara>
  387. </listitem>
  388. </orderedlist>
  389. </section>
  390. <section id="install">
  391. <title>Installation from source</title>
  392. <para>
  393. BIND 10 is open source software written in C++ and Python.
  394. It is freely available in source code form from ISC via
  395. the Git code revision control system or as a downloadable
  396. tar file. It may also be available in pre-compiled ready-to-use
  397. packages from operating system vendors.
  398. </para>
  399. <section>
  400. <title>Download Tar File</title>
  401. <para>
  402. Downloading a release tar file is the recommended method to
  403. obtain the source code.
  404. </para>
  405. <para>
  406. The BIND 10 releases are available as tar file downloads from
  407. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  408. Periodic development snapshots may also be available.
  409. </para>
  410. <!-- TODO -->
  411. </section>
  412. <section>
  413. <title>Retrieve from Git</title>
  414. <para>
  415. Downloading this "bleeding edge" code is recommended only for
  416. developers or advanced users. Using development code in a production
  417. environment is not recommended.
  418. </para>
  419. <note>
  420. <para>
  421. When using source code retrieved via Git additional
  422. software will be required: automake (v1.11 or newer),
  423. libtoolize, and autoconf (2.59 or newer).
  424. These may need to be installed.
  425. </para>
  426. </note>
  427. <para>
  428. The latest development code, including temporary experiments
  429. and un-reviewed code, is available via the BIND 10 code revision
  430. control system. This is powered by Git and all the BIND 10
  431. development is public.
  432. The leading development is done in the <quote>master</quote>.
  433. </para>
  434. <para>
  435. The code can be checked out from
  436. <filename>git://bind10.isc.org/bind10</filename>;
  437. for example:
  438. <screen>$ <userinput>git clone git://bind10.isc.org/bind10</userinput></screen>
  439. </para>
  440. <para>
  441. When checking out the code from
  442. the code version control system, it doesn't include the
  443. generated configure script, Makefile.in files, nor the
  444. related configure files.
  445. They can be created by running <command>autoreconf</command>
  446. with the <option>--install</option> switch.
  447. This will run <command>autoconf</command>,
  448. <command>aclocal</command>,
  449. <command>libtoolize</command>,
  450. <command>autoheader</command>,
  451. <command>automake</command>,
  452. and related commands.
  453. </para>
  454. </section>
  455. <section>
  456. <title>Configure before the build</title>
  457. <para>
  458. BIND 10 uses the GNU Build System to discover build environment
  459. details.
  460. To generate the makefiles using the defaults, simply run:
  461. <screen>$ <userinput>./configure</userinput></screen>
  462. </para>
  463. <para>
  464. Run <command>./configure</command> with the <option>--help</option>
  465. switch to view the different options. The commonly-used options are:
  466. <variablelist>
  467. <varlistentry>
  468. <term>--prefix</term>
  469. <listitem>
  470. <simpara>Define the installation location (the
  471. default is <filename>/usr/local/</filename>).
  472. </simpara>
  473. </listitem>
  474. </varlistentry>
  475. <varlistentry>
  476. <term>--with-boost-include</term>
  477. <listitem>
  478. <simpara>Define the path to find the Boost headers.
  479. </simpara>
  480. </listitem>
  481. </varlistentry>
  482. <varlistentry>
  483. <term>--with-pythonpath</term>
  484. <listitem>
  485. <simpara>Define the path to Python 3.1 if it is not in the
  486. standard execution path.
  487. </simpara>
  488. </listitem>
  489. </varlistentry>
  490. <varlistentry>
  491. <term>--with-gtest</term>
  492. <listitem>
  493. <simpara>Enable building the C++ Unit Tests using the
  494. Google Tests framework. Optionally this can define the
  495. path to the gtest header files and library.
  496. </simpara>
  497. </listitem>
  498. </varlistentry>
  499. </variablelist>
  500. </para>
  501. <!-- TODO: lcov -->
  502. <para>
  503. For example, the following configures it to
  504. find the Boost headers, find the
  505. Python interpreter, and sets the installation location:
  506. <screen>$ <userinput>./configure \
  507. --with-boost-include=/usr/pkg/include \
  508. --with-pythonpath=/usr/pkg/bin/python3.1 \
  509. --prefix=/opt/bind10</userinput></screen>
  510. </para>
  511. <para>
  512. If the configure fails, it may be due to missing or old
  513. dependencies.
  514. </para>
  515. </section>
  516. <section>
  517. <title>Build</title>
  518. <para>
  519. After the configure step is complete, to build the executables
  520. from the C++ code and prepare the Python scripts, run:
  521. <screen>$ <userinput>make</userinput></screen>
  522. </para>
  523. </section>
  524. <section>
  525. <title>Install</title>
  526. <para>
  527. To install the BIND 10 executables, support files,
  528. and documentation, run:
  529. <screen>$ <userinput>make install</userinput></screen>
  530. </para>
  531. <note>
  532. <para>The install step may require superuser privileges.</para>
  533. </note>
  534. </section>
  535. <!-- TODO: tests -->
  536. <section>
  537. <title>Install Hierarchy</title>
  538. <para>
  539. The following is the layout of the complete BIND 10 installation:
  540. <itemizedlist>
  541. <listitem>
  542. <simpara>
  543. <filename>bin/</filename> &mdash;
  544. general tools and diagnostic clients.
  545. </simpara>
  546. </listitem>
  547. <listitem>
  548. <simpara>
  549. <filename>etc/bind10-devel/</filename> &mdash;
  550. configuration files.
  551. </simpara>
  552. </listitem>
  553. <listitem>
  554. <simpara>
  555. <filename>lib/</filename> &mdash;
  556. libraries and python modules.
  557. </simpara>
  558. </listitem>
  559. <listitem>
  560. <simpara>
  561. <filename>libexec/bind10-devel/</filename> &mdash;
  562. executables that a user wouldn't normally run directly and
  563. are not run independently.
  564. These are the BIND 10 modules which are daemons started by
  565. the <command>bind10</command> tool.
  566. </simpara>
  567. </listitem>
  568. <listitem>
  569. <simpara>
  570. <filename>sbin/</filename> &mdash;
  571. commands used by the system administrator.
  572. </simpara>
  573. </listitem>
  574. <listitem>
  575. <simpara>
  576. <filename>share/bind10-devel/</filename> &mdash;
  577. configuration specifications.
  578. </simpara>
  579. </listitem>
  580. <listitem>
  581. <simpara>
  582. <filename>share/man/</filename> &mdash;
  583. manual pages (online documentation).
  584. </simpara>
  585. </listitem>
  586. <listitem>
  587. <simpara>
  588. <filename>var/bind10-devel/</filename> &mdash;
  589. data source and configuration databases.
  590. </simpara>
  591. </listitem>
  592. </itemizedlist>
  593. </para>
  594. </section>
  595. </section>
  596. <!--
  597. <section id="install.troubleshooting">
  598. <title>Troubleshooting</title>
  599. <para>
  600. </para>
  601. </section>
  602. -->
  603. </chapter>
  604. <chapter id="bind10">
  605. <title>Starting BIND10 with <command>bind10</command></title>
  606. <para>
  607. BIND 10 provides the <command>bind10</command> command which
  608. starts up the required processes.
  609. <command>bind10</command>
  610. will also restart some processes that exit unexpectedly.
  611. This is the only command needed to start the BIND 10 system.
  612. </para>
  613. <para>
  614. After starting the <command>b10-msgq</command> communications channel,
  615. <command>bind10</command> connects to it,
  616. runs the configuration manager, and reads its own configuration.
  617. Then it starts the other modules.
  618. </para>
  619. <para>
  620. The <command>b10-sockcreator</command>, <command>b10-msgq</command> and
  621. <command>b10-cfgmgr</command>
  622. services make up the core. The <command>b10-msgq</command> daemon
  623. provides the communication channel between every part of the system.
  624. The <command>b10-cfgmgr</command> daemon is always needed by every
  625. module, if only to send information about themselves somewhere,
  626. but more importantly to ask about their own settings, and
  627. about other modules. The <command>b10-sockcreator</command> will
  628. allocate sockets for the rest of the system.
  629. </para>
  630. <para>
  631. In its default configuration, the <command>bind10</command>
  632. master process will also start up
  633. <command>b10-cmdctl</command> for admins to communicate with the
  634. system, <command>b10-auth</command> for authoritative DNS service,
  635. <command>b10-stats</command> for statistics collection,
  636. <command>b10-xfrin</command> for inbound DNS zone transfers,
  637. <command>b10-xfrout</command> for outbound DNS zone transfers,
  638. and <command>b10-zonemgr</command> for secondary service.
  639. </para>
  640. <section id="start">
  641. <title>Starting BIND 10</title>
  642. <para>
  643. To start the BIND 10 service, simply run <command>bind10</command>.
  644. Run it with the <option>--verbose</option> switch to
  645. get additional debugging or diagnostic output.
  646. </para>
  647. <!-- TODO: note it doesn't go into background -->
  648. <note>
  649. <para>
  650. If the setproctitle Python module is detected at start up,
  651. the process names for the Python-based daemons will be renamed
  652. to better identify them instead of just <quote>python</quote>.
  653. This is not needed on some operating systems.
  654. </para>
  655. </note>
  656. </section>
  657. <section id="bind10.config">
  658. <title>Configuration of started processes</title>
  659. <para>
  660. The processes to be started can be configured, with the exception
  661. of the <command>b10-sockcreator</command>, <command>b10-msgq</command>
  662. and <command>b10-cfgmgr</command>.
  663. </para>
  664. <para>
  665. The configuration is in the Boss/components section. Each element
  666. represents one component, which is an abstraction of a process
  667. (currently there's also one component which doesn't represent
  668. a process). If you didn't want to transfer out at all (your server
  669. is a slave only), you would just remove the corresponding component
  670. from the set, like this and the process would be stopped immediately
  671. (and not started on the next startup):
  672. <screen>&gt; <userinput>config del Boss/components b10-xfrout</userinput>
  673. &gt; <userinput>config commit</userinput></screen>
  674. </para>
  675. <para>
  676. To add a process to the set, let's say the resolver (which not started
  677. by default), you would do this:
  678. <screen>&gt; <userinput>config add Boss/components b10-resolver</userinput>
  679. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  680. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  681. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  682. &gt; <userinput>config commit</userinput></screen></para>
  683. <para>
  684. Now, what it means. We add an entry called b10-resolver. It is both a
  685. name used to reference this component in the configuration and the
  686. name of the process to start. Then we set some parameters on how to
  687. start it.
  688. </para>
  689. <para>
  690. The special one is for components that need some kind of special care
  691. during startup or shutdown. Unless specified, the component is started
  692. in usual way. This is the list of components that need to be started
  693. in a special way, with the value of special used for them:
  694. <table>
  695. <tgroup cols='3' align='left'>
  696. <colspec colname='component'/>
  697. <colspec colname='special'/>
  698. <colspec colname='description'/>
  699. <thead><row><entry>Component</entry><entry>Special</entry><entry>Description</entry></row></thead>
  700. <tbody>
  701. <row><entry>b10-auth</entry><entry>auth</entry><entry>Authoritative server</entry></row>
  702. <row><entry>b10-resolver</entry><entry>resolver</entry><entry>The resolver</entry></row>
  703. <row><entry>b10-cmdctl</entry><entry>cmdctl</entry><entry>The command control (remote control interface)</entry></row>
  704. <row><entry>setuid</entry><entry>setuid</entry><entry>Virtual component, see below</entry></row>
  705. <!-- TODO Either add xfrin and xfrout as well or clean up the workarounds in boss before the release -->
  706. </tbody>
  707. </tgroup>
  708. </table>
  709. </para>
  710. <para>
  711. The kind specifies how a failure of the component should be handled.
  712. If it is set to "dispensable" (the default unless you set something
  713. else), it will get started again if it fails. If it is set to
  714. "needed" and it fails at startup, the whole bind10 shuts down and exits
  715. with error exit code. But if it fails some time later, it is just
  716. started again. If you set it to "core", you indicate that the system
  717. is not usable without the component and if such component fails, the
  718. system shuts down no matter when the failure happened. This is the
  719. behaviour of the core components (the ones you can't turn off), but
  720. you can declare any other components as core as well if you wish
  721. (but you can turn these off, they just can't fail).
  722. </para>
  723. <para>
  724. The priority defines order in which the components should start.
  725. The ones with higher number are started sooner than the ones with
  726. lover ones. If you don't set it, 0 is used as the priority.
  727. </para>
  728. <para>
  729. There are other parameters we didn't use in our example.
  730. One of them is "address". It is the address used by the component
  731. on the b10-msgq message bus. The special components already know
  732. their address, but the usual ones don't. The address is by convention
  733. the thing after b10-, with the first letter capital (eg. b10-stats
  734. would have Stats as its address).
  735. </para>
  736. <para>
  737. The last one is process. It is the name of the process to be started.
  738. It defaults to the name of the component if not set, but you can use
  739. this to override it.
  740. </para>
  741. <!-- TODO Add parameters when they work, not implemented yet-->
  742. <note>
  743. <para>
  744. This system allows you to start the same component multiple times
  745. (by including it in the configuration with different names, but the
  746. same process setting). However, the rest of the system doesn't expect
  747. such situation, so it would probably not do what you want. Such
  748. support is yet to be implemented.
  749. </para>
  750. </note>
  751. <note>
  752. <para>
  753. The configuration is quite powerful, but that includes a lot of space
  754. for mistakes. You could turn off the b10-cmdctl, but then you
  755. couldn't change it back the usual way, as it would require it to be
  756. running (you would have to find and edit the configuration directly).
  757. Also, some modules might have dependencies -- b10-stats-http need
  758. b10-stats, b10-xfrout needs the b10-auth to be running, etc.
  759. </para>
  760. <para>
  761. In short, you should think twice before disabling something here.
  762. </para>
  763. </note>
  764. <para>
  765. Now, to the mysterious setuid virtual component. If you use the <command>-u</command>
  766. option to start the bind10 as root, but change the user later, we need
  767. to start the <command>b10-auth</command> or <command>b10-resolver</command>
  768. as root (until the socket creator is finished). So we need to specify
  769. the time when the switch from root do the given user happens and that's
  770. what the setuid component is for. The switch is done at the time the
  771. setuid component would be started, if it was a process. The default
  772. configuration contains the setuid component with priority 5, b10-auth
  773. has 10 to be started before the switch and everything else is without
  774. priority, so it is started after the switch.
  775. </para>
  776. </section>
  777. </chapter>
  778. <chapter id="msgq">
  779. <title>Command channel</title>
  780. <para>
  781. The BIND 10 components use the <command>b10-msgq</command>
  782. message routing daemon to communicate with other BIND 10 components.
  783. The <command>b10-msgq</command> implements what is called the
  784. <quote>Command Channel</quote>.
  785. Processes intercommunicate by sending messages on the command
  786. channel.
  787. Example messages include shutdown, get configurations, and set
  788. configurations.
  789. This Command Channel is not used for DNS message passing.
  790. It is used only to control and monitor the BIND 10 system.
  791. </para>
  792. <para>
  793. Administrators do not communicate directly with the
  794. <command>b10-msgq</command> daemon.
  795. By default, BIND 10 uses port 9912 for the
  796. <command>b10-msgq</command> service.
  797. It listens on 127.0.0.1.
  798. </para>
  799. <!-- TODO: this is broken, see Trac #111
  800. <para>
  801. To select an alternate port for the <command>b10-msgq</command> to
  802. use, run <command>bind10</command> specifying the option:
  803. <screen> $ <userinput>bind10 -TODO-msgq-port 9912</userinput></screen>
  804. </para>
  805. -->
  806. <!-- TODO: upcoming plans:
  807. Unix domain sockets
  808. -->
  809. </chapter>
  810. <chapter id="cfgmgr">
  811. <title>Configuration manager</title>
  812. <para>
  813. The configuration manager, <command>b10-cfgmgr</command>,
  814. handles all BIND 10 system configuration. It provides
  815. persistent storage for configuration, and notifies running
  816. modules of configuration changes.
  817. </para>
  818. <para>
  819. The <command>b10-auth</command> and <command>b10-xfrin</command>
  820. daemons and other components receive their configurations
  821. from the configuration manager over the <command>b10-msgq</command>
  822. command channel.
  823. </para>
  824. <para>The administrator doesn't connect to it directly, but
  825. uses a user interface to communicate with the configuration
  826. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  827. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  828. </para>
  829. <!-- TODO -->
  830. <note>
  831. <para>
  832. The development prototype release only provides the
  833. <command>bindctl</command> as a user interface to
  834. <command>b10-cmdctl</command>.
  835. Upcoming releases will provide another interactive command-line
  836. interface and a web-based interface.
  837. </para>
  838. </note>
  839. <para>
  840. The <command>b10-cfgmgr</command> daemon can send all
  841. specifications and all current settings to the
  842. <command>bindctl</command> client (via
  843. <command>b10-cmdctl</command>).
  844. </para>
  845. <para>
  846. <command>b10-cfgmgr</command> relays configurations received
  847. from <command>b10-cmdctl</command> to the appropriate modules.
  848. </para>
  849. <!-- TODO:
  850. Configuration settings for itself are defined as ConfigManager.
  851. TODO: show examples
  852. -->
  853. <!-- TODO:
  854. config changes are actually commands to cfgmgr
  855. -->
  856. <!-- TODO: what about run time config to change this? -->
  857. <!-- jelte: > config set cfgmgr/config_database <file> -->
  858. <!-- TODO: what about command line switch to change this? -->
  859. <para>
  860. The stored configuration file is at
  861. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  862. (The full path is what was defined at build configure time for
  863. <option>--localstatedir</option>.
  864. The default is <filename>/usr/local/var/</filename>.)
  865. The format is loosely based on JSON and is directly parseable
  866. python, but this may change in a future version.
  867. This configuration data file is not manually edited by the
  868. administrator.
  869. </para>
  870. <!--
  871. Well the specfiles have a more fixed format (they must contain specific
  872. stuff), but those are also directly parseable python structures (and
  873. 'coincidentally', our data::element string representation is the same)
  874. loosely based on json, tweaked to be directly parseable in python, but a
  875. subset of that.
  876. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  877. nope, spec files are written by module developers, and db should be done
  878. through bindctl and friends
  879. -->
  880. <para>
  881. The configuration manager does not have any command line arguments.
  882. Normally it is not started manually, but is automatically
  883. started using the <command>bind10</command> master process
  884. (as covered in <xref linkend="bind10"/>).
  885. </para>
  886. <!-- TODO: upcoming plans:
  887. configuration for configuration manager itself. And perhaps we might
  888. change the messaging protocol, but an admin should never see any of that
  889. -->
  890. <!-- TODO: show examples, test this -->
  891. <!--
  892. , so an admin can simply run bindctl,
  893. do config show, and it shows all modules; config show >module> shows all
  894. options for that module
  895. -->
  896. </chapter>
  897. <chapter id="cmdctl">
  898. <title>Remote control daemon</title>
  899. <para>
  900. <command>b10-cmdctl</command> is the gateway between
  901. administrators and the BIND 10 system.
  902. It is a HTTPS server that uses standard HTTP Digest
  903. Authentication for username and password validation.
  904. It provides a REST-ful interface for accessing and controlling
  905. BIND 10.
  906. </para>
  907. <!-- TODO: copy examples from wiki, try with wget -->
  908. <para>
  909. When <command>b10-cmdctl</command> starts, it firsts
  910. asks <command>b10-cfgmgr</command> about what modules are
  911. running and what their configuration is (over the
  912. <command>b10-msgq</command> channel). Then it will start listening
  913. on HTTPS for clients &mdash; the user interface &mdash; such
  914. as <command>bindctl</command>.
  915. </para>
  916. <para>
  917. <command>b10-cmdctl</command> directly sends commands
  918. (received from the user interface) to the specified component.
  919. Configuration changes are actually commands to
  920. <command>b10-cfgmgr</command> so are sent there.
  921. </para>
  922. <!--
  923. TODO:
  924. "For bindctl to list a module's available configurations and
  925. available commands, it communicates over the cmdctl REST interface.
  926. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  927. asks the module for its specification and also cfgmgr looks in its
  928. own configuration database for current values."
  929. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  930. GET, but rather requests it once and then listens in for updates,
  931. but you might wanna check with likun
  932. -->
  933. <!-- TODO: replace /usr/local -->
  934. <!-- TODO: permissions -->
  935. <para>The HTTPS server requires a private key,
  936. such as a RSA PRIVATE KEY.
  937. The default location is at
  938. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  939. (A sample key is at
  940. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  941. It also uses a certificate located at
  942. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  943. (A sample certificate is at
  944. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  945. This may be a self-signed certificate or purchased from a
  946. certification authority.
  947. </para>
  948. <note><para>
  949. The HTTPS server doesn't support a certificate request from a
  950. client (at this time).
  951. <!-- TODO: maybe allow request from server side -->
  952. The <command>b10-cmdctl</command> daemon does not provide a
  953. public service. If any client wants to control BIND 10, then
  954. a certificate needs to be first received from the BIND 10
  955. administrator.
  956. The BIND 10 installation provides a sample PEM bundle that matches
  957. the sample key and certificate.
  958. </para></note>
  959. <!-- TODO: cross-ref -->
  960. <!-- TODO
  961. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  962. but that is a single file, maybethis should go back to that format?
  963. -->
  964. <!--
  965. <para>
  966. (08:20:56) shane: It is in theory possible to run without cmdctl.
  967. (08:21:02) shane: I think we discussed this.
  968. </para>
  969. -->
  970. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  971. <para>
  972. The <command>b10-cmdctl</command> daemon also requires
  973. the user account file located at
  974. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  975. This comma-delimited file lists the accounts with a user name,
  976. hashed password, and salt.
  977. (A sample file is at
  978. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  979. It contains the user named <quote>root</quote> with the password
  980. <quote>bind10</quote>.)
  981. </para>
  982. <para>
  983. The administrator may create a user account with the
  984. <command>b10-cmdctl-usermgr</command> tool.
  985. </para>
  986. <!-- TODO: show example -->
  987. <!-- TODO: does cmdctl need to be restarted to change cert or key
  988. or accounts database -->
  989. <para>
  990. By default the HTTPS server listens on the localhost port 8080.
  991. The port can be set by using the <option>--port</option> command line option.
  992. The address to listen on can be set using the <option>--address</option> command
  993. line argument.
  994. Each HTTPS connection is stateless and timesout in 1200 seconds
  995. by default. This can be
  996. redefined by using the <option>--idle-timeout</option> command line argument.
  997. </para>
  998. <section id="cmdctl.spec">
  999. <title>Configuration specification for b10-cmdctl</title>
  1000. <para>
  1001. The configuration items for <command>b10-cmdctl</command> are:
  1002. key_file
  1003. cert_file
  1004. accounts_file
  1005. </para>
  1006. <!-- TODO -->
  1007. <para>
  1008. The control commands are:
  1009. print_settings
  1010. <!-- TODO: remove that -->
  1011. shutdown
  1012. </para>
  1013. <!-- TODO -->
  1014. </section>
  1015. <!--
  1016. TODO
  1017. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  1018. (12:21:33) jinmei: btw
  1019. -->
  1020. </chapter>
  1021. <chapter id="bindctl">
  1022. <title>Control and configure user interface</title>
  1023. <note><para>
  1024. For this development prototype release, <command>bindctl</command>
  1025. is the only user interface. It is expected that upcoming
  1026. releases will provide another interactive command-line
  1027. interface and a web-based interface for controlling and
  1028. configuring BIND 10.
  1029. </para></note>
  1030. <para>
  1031. The <command>bindctl</command> tool provides an interactive
  1032. prompt for configuring, controlling, and querying the BIND 10
  1033. components.
  1034. It communicates directly with a REST-ful interface over HTTPS
  1035. provided by <command>b10-cmdctl</command>. It doesn't
  1036. communicate to any other components directly.
  1037. </para>
  1038. <!-- TODO: explain and show interface -->
  1039. <para>
  1040. Configuration changes are actually commands to
  1041. <command>b10-cfgmgr</command>. So when <command>bindctl</command>
  1042. sends a configuration, it is sent to <command>b10-cmdctl</command>
  1043. (over a HTTPS connection); then <command>b10-cmdctl</command>
  1044. sends the command (over a <command>b10-msgq</command> command
  1045. channel) to <command>b10-cfgmgr</command> which then stores
  1046. the details and relays (over a <command>b10-msgq</command> command
  1047. channel) the configuration on to the specified module.
  1048. </para>
  1049. <para>
  1050. </para>
  1051. </chapter>
  1052. <chapter id="authserver">
  1053. <title>Authoritative Server</title>
  1054. <para>
  1055. The <command>b10-auth</command> is the authoritative DNS server.
  1056. It supports EDNS0 and DNSSEC. It supports IPv6.
  1057. Normally it is started by the <command>bind10</command> master
  1058. process.
  1059. </para>
  1060. <section>
  1061. <title>Server Configurations</title>
  1062. <!-- TODO: offers command line options but not used
  1063. since we used bind10 -->
  1064. <para>
  1065. <command>b10-auth</command> is configured via the
  1066. <command>b10-cfgmgr</command> configuration manager.
  1067. The module name is <quote>Auth</quote>.
  1068. The configuration data item is:
  1069. <variablelist>
  1070. <varlistentry>
  1071. <term>database_file</term>
  1072. <listitem>
  1073. <simpara>This is an optional string to define the path to find
  1074. the SQLite3 database file.
  1075. <!-- TODO: -->
  1076. Note: Later the DNS server will use various data source backends.
  1077. This may be a temporary setting until then.
  1078. </simpara>
  1079. </listitem>
  1080. </varlistentry>
  1081. </variablelist>
  1082. </para>
  1083. <para>
  1084. The configuration command is:
  1085. <variablelist>
  1086. <varlistentry>
  1087. <term>shutdown</term>
  1088. <listitem>
  1089. <simpara>Stop the authoritative DNS server.
  1090. </simpara>
  1091. <!-- TODO: what happens when this is sent, will bind10 restart? -->
  1092. </listitem>
  1093. </varlistentry>
  1094. </variablelist>
  1095. </para>
  1096. <!-- TODO: examples of setting or running above? -->
  1097. </section>
  1098. <section>
  1099. <title>Data Source Backends</title>
  1100. <note><para>
  1101. For the development prototype release, <command>b10-auth</command>
  1102. supports a SQLite3 data source backend and in-memory data source
  1103. backend.
  1104. Upcoming versions will be able to use multiple different
  1105. data sources, such as MySQL and Berkeley DB.
  1106. </para></note>
  1107. <para>
  1108. By default, the SQLite3 backend uses the data file located at
  1109. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  1110. (The full path is what was defined at build configure time for
  1111. <option>--localstatedir</option>.
  1112. The default is <filename>/usr/local/var/</filename>.)
  1113. This data file location may be changed by defining the
  1114. <quote>database_file</quote> configuration.
  1115. </para>
  1116. </section>
  1117. <section>
  1118. <title>Loading Master Zones Files</title>
  1119. <para>
  1120. RFC 1035 style DNS master zone files may imported
  1121. into a BIND 10 data source by using the
  1122. <command>b10-loadzone</command> utility.
  1123. </para>
  1124. <para>
  1125. <command>b10-loadzone</command> supports the following
  1126. special directives (control entries):
  1127. <variablelist>
  1128. <varlistentry>
  1129. <term>$INCLUDE</term>
  1130. <listitem>
  1131. <simpara>Loads an additional zone file. This may be recursive.
  1132. </simpara>
  1133. </listitem>
  1134. </varlistentry>
  1135. <varlistentry>
  1136. <term>$ORIGIN</term>
  1137. <listitem>
  1138. <simpara>Defines the relative domain name.
  1139. </simpara>
  1140. </listitem>
  1141. </varlistentry>
  1142. <varlistentry>
  1143. <term>$TTL</term>
  1144. <listitem>
  1145. <simpara>Defines the time-to-live value used for following
  1146. records that don't include a TTL.
  1147. </simpara>
  1148. </listitem>
  1149. </varlistentry>
  1150. </variablelist>
  1151. </para>
  1152. <para>
  1153. The <option>-o</option> argument may be used to define the
  1154. default origin for loaded zone file records.
  1155. </para>
  1156. <note>
  1157. <para>
  1158. In the development prototype release, only the SQLite3 back
  1159. end is used.
  1160. By default, it stores the zone data in
  1161. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  1162. unless the <option>-d</option> switch is used to set the
  1163. database filename.
  1164. Multiple zones are stored in a single SQLite3 zone database.
  1165. </para>
  1166. </note>
  1167. <para>
  1168. If you reload a zone already existing in the database,
  1169. all records from that prior zone disappear and a whole new set
  1170. appears.
  1171. </para>
  1172. <!--TODO: permissions for xfrin or loadzone to create the file -->
  1173. </section>
  1174. <!--
  1175. TODO
  1176. <section>
  1177. <title>Troubleshooting</title>
  1178. <para>
  1179. </para>
  1180. </section>
  1181. -->
  1182. </chapter>
  1183. <chapter id="xfrin">
  1184. <title>Incoming Zone Transfers</title>
  1185. <para>
  1186. Incoming zones are transferred using the <command>b10-xfrin</command>
  1187. process which is started by <command>bind10</command>.
  1188. When received, the zone is stored in the corresponding BIND 10
  1189. data source, and its records can be served by
  1190. <command>b10-auth</command>.
  1191. In combination with <command>b10-zonemgr</command> (for
  1192. automated SOA checks), this allows the BIND 10 server to
  1193. provide <quote>secondary</quote> service.
  1194. </para>
  1195. <para>
  1196. The <command>b10-xfrin</command> process supports both AXFR and
  1197. IXFR. Due to some implementation limitations of the current
  1198. development release, however, it only tries AXFR by default,
  1199. and care should be taken to enable IXFR.
  1200. </para>
  1201. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1202. <note><simpara>
  1203. In the current development release of BIND 10, incoming zone
  1204. transfers are only available for SQLite3-based data sources,
  1205. that is, they don't work for an in-memory data source.
  1206. </simpara></note>
  1207. <section>
  1208. <title>Configuration for Incoming Zone Transfers</title>
  1209. <para>
  1210. In practice, you need to specify a list of secondary zones to
  1211. enable incoming zone transfers for these zones (you can still
  1212. trigger a zone transfer manually, without a prior configuration
  1213. (see below)).
  1214. </para>
  1215. <para>
  1216. For example, to enable zone transfers for a zone named "example.com"
  1217. (whose master address is assumed to be 2001:db8::53 here),
  1218. run the following at the <command>bindctl</command> prompt:
  1219. <screen>&gt; <userinput>config add Xfrin/zones</userinput>
  1220. &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
  1221. &gt; <userinput>config set Xfrin/zones[0]/master_addr "<option>2001:db8::53</option>"</userinput>
  1222. &gt; <userinput>config commit</userinput></screen>
  1223. (We assume there has been no zone configuration before).
  1224. </para>
  1225. </section>
  1226. <section>
  1227. <title>Enabling IXFR</title>
  1228. <para>
  1229. As noted above, <command>b10-xfrin</command> uses AXFR for
  1230. zone transfers by default. To enable IXFR for zone transfers
  1231. for a particular zone, set the <userinput>use_ixfr</userinput>
  1232. configuration parameter to <userinput>true</userinput>.
  1233. In the above example of configuration sequence, you'll need
  1234. to add the following before performing <userinput>commit</userinput>:
  1235. <screen>&gt; <userinput>config set Xfrin/zones[0]/use_ixfr true</userinput></screen>
  1236. </para>
  1237. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1238. <note><simpara>
  1239. One reason why IXFR is disabled by default in the current
  1240. release is because it does not support automatic fallback from IXFR to
  1241. AXFR when it encounters a primary server that doesn't support
  1242. outbound IXFR (and, not many existing implementations support
  1243. it). Another, related reason is that it does not use AXFR even
  1244. if it has no knowledge about the zone (like at the very first
  1245. time the secondary server is set up). IXFR requires the
  1246. "current version" of the zone, so obviously it doesn't work
  1247. in this situation and AXFR is the only workable choice.
  1248. The current release of <command>b10-xfrin</command> does not
  1249. make this selection automatically.
  1250. These features will be implemented in a near future
  1251. version, at which point we will enable IXFR by default.
  1252. </simpara></note>
  1253. </section>
  1254. <!-- TODO:
  1255. how to tell bind10 you are a secondary?
  1256. when will it first attempt to check for new zone? (using REFRESH?)
  1257. what if zonemgr is not running?
  1258. what if a NOTIFY is sent?
  1259. -->
  1260. <section>
  1261. <title>Trigger an Incoming Zone Transfer Manually</title>
  1262. <para>
  1263. To manually trigger a zone transfer to retrieve a remote zone,
  1264. you may use the <command>bindctl</command> utility.
  1265. For example, at the <command>bindctl</command> prompt run:
  1266. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  1267. </para>
  1268. </section>
  1269. <!-- TODO: can that retransfer be used to identify a new zone? -->
  1270. <!-- TODO: what if doesn't exist at that master IP? -->
  1271. </chapter>
  1272. <chapter id="xfrout">
  1273. <title>Outbound Zone Transfers</title>
  1274. <para>
  1275. The <command>b10-xfrout</command> process is started by
  1276. <command>bind10</command>.
  1277. When the <command>b10-auth</command> authoritative DNS server
  1278. receives an AXFR request, <command>b10-xfrout</command>
  1279. sends the zone.
  1280. This is used to provide master DNS service to share zones
  1281. to secondary name servers.
  1282. The <command>b10-xfrout</command> is also used to send
  1283. NOTIFY messages to slaves.
  1284. </para>
  1285. <note><simpara>
  1286. The current development release of BIND 10 only supports
  1287. AXFR. (IXFR is not supported.)
  1288. Access control is not yet provided.
  1289. </simpara></note>
  1290. <!--
  1291. TODO:
  1292. xfrout section:
  1293. auth servers checks for AXFR query
  1294. sends the XFR query to the xfrout module
  1295. uses /tmp/auth_xfrout_conn which is a socket
  1296. what is XfroutClient xfr_client??
  1297. /tmp/auth_xfrout_conn is not removed
  1298. -->
  1299. </chapter>
  1300. <chapter id="zonemgr">
  1301. <title>Secondary Manager</title>
  1302. <para>
  1303. The <command>b10-zonemgr</command> process is started by
  1304. <command>bind10</command>.
  1305. It keeps track of SOA refresh, retry, and expire timers
  1306. and other details for BIND 10 to perform as a slave.
  1307. When the <command>b10-auth</command> authoritative DNS server
  1308. receives a NOTIFY message, <command>b10-zonemgr</command>
  1309. may tell <command>b10-xfrin</command> to do a refresh
  1310. to start an inbound zone transfer.
  1311. The secondary manager resets its counters when a new zone is
  1312. transferred in.
  1313. </para>
  1314. <note><simpara>
  1315. Access control (such as allowing notifies) is not yet provided.
  1316. The primary/secondary service is not yet complete.
  1317. </simpara></note>
  1318. <!-- TODO: lots to describe for zonemgr -->
  1319. </chapter>
  1320. <chapter id="resolverserver">
  1321. <title>Recursive Name Server</title>
  1322. <para>
  1323. The <command>b10-resolver</command> process is started by
  1324. <command>bind10</command>.
  1325. <!-- TODO
  1326. It provides a resolver so DNS clients can ask it to do recursion
  1327. and it will return answers.
  1328. -->
  1329. </para>
  1330. <para>
  1331. The main <command>bind10</command> process can be configured
  1332. to select to run either the authoritative or resolver or both.
  1333. By default, it starts the authoritative service.
  1334. <!-- TODO: later both -->
  1335. You may change this using <command>bindctl</command>, for example:
  1336. <screen>
  1337. &gt; <userinput>config del Boss/components b10-xfrout</userinput>
  1338. &gt; <userinput>config del Boss/components b10-xfrin</userinput>
  1339. &gt; <userinput>config del Boss/components b10-auth</userinput>
  1340. &gt; <userinput>config add Boss/components b10-resolver</userinput>
  1341. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  1342. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  1343. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  1344. &gt; <userinput>config commit</userinput>
  1345. </screen>
  1346. </para>
  1347. <para>
  1348. The master <command>bind10</command> will stop and start
  1349. the desired services.
  1350. </para>
  1351. <para>
  1352. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  1353. The following example shows how it can be configured to
  1354. listen on an additional address (and port):
  1355. <screen>
  1356. &gt; <userinput>config add Resolver/listen_on</userinput>
  1357. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
  1358. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
  1359. &gt; <userinput>config commit</userinput>
  1360. </screen>
  1361. </para>
  1362. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  1363. as needed; run <quote><userinput>config show
  1364. Resolver/listen_on</userinput></quote> if needed.)</simpara>
  1365. <!-- TODO: this example should not include the port, ticket #1185 -->
  1366. <section>
  1367. <title>Access Control</title>
  1368. <para>
  1369. By default, the <command>b10-resolver</command> daemon only accepts
  1370. DNS queries from the localhost (127.0.0.1 and ::1).
  1371. The <option>Resolver/query_acl</option> configuration may
  1372. be used to reject, drop, or allow specific IPs or networks.
  1373. This configuration list is first match.
  1374. </para>
  1375. <para>
  1376. The configuration's <option>action</option> item may be
  1377. set to <quote>ACCEPT</quote> to allow the incoming query,
  1378. <quote>REJECT</quote> to respond with a DNS REFUSED return
  1379. code, or <quote>DROP</quote> to ignore the query without
  1380. any response (such as a blackhole). For more information,
  1381. see the respective debugging messages: <ulink
  1382. url="bind10-messages.html#RESOLVER_QUERY_ACCEPTED">RESOLVER_QUERY_ACCEPTED</ulink>,
  1383. <ulink
  1384. url="bind10-messages.html#RESOLVER_QUERY_REJECTED">RESOLVER_QUERY_REJECTED</ulink>,
  1385. and <ulink
  1386. url="bind10-messages.html#RESOLVER_QUERY_DROPPED">RESOLVER_QUERY_DROPPED</ulink>.
  1387. </para>
  1388. <para>
  1389. The required configuration's <option>from</option> item is set
  1390. to an IPv4 or IPv6 address, addresses with an network mask, or to
  1391. the special lowercase keywords <quote>any6</quote> (for
  1392. any IPv6 address) or <quote>any4</quote> (for any IPv4
  1393. address).
  1394. </para>
  1395. <!-- TODO:
  1396. /0 is for any address in that address family
  1397. does that need any address too?
  1398. TODO: tsig
  1399. -->
  1400. <para>
  1401. For example to allow the <replaceable>192.168.1.0/24</replaceable>
  1402. network to use your recursive name server, at the
  1403. <command>bindctl</command> prompt run:
  1404. </para>
  1405. <screen>
  1406. &gt; <userinput>config add Resolver/query_acl</userinput>
  1407. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/action "ACCEPT"</userinput>
  1408. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/from "<replaceable>192.168.1.0/24</replaceable>"</userinput>
  1409. &gt; <userinput>config commit</userinput>
  1410. </screen>
  1411. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  1412. as needed; run <quote><userinput>config show
  1413. Resolver/query_acl</userinput></quote> if needed.)</simpara>
  1414. <!-- TODO: check this -->
  1415. <note><simpara>This prototype access control configuration
  1416. syntax may be changed.</simpara></note>
  1417. </section>
  1418. <section>
  1419. <title>Forwarding</title>
  1420. <para>
  1421. To enable forwarding, the upstream address and port must be
  1422. configured to forward queries to, such as:
  1423. <screen>
  1424. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  1425. &gt; <userinput>config commit</userinput>
  1426. </screen>
  1427. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  1428. full resolver.)
  1429. </para>
  1430. <para>
  1431. Normal iterative name service can be re-enabled by clearing the
  1432. forwarding address(es); for example:
  1433. <screen>
  1434. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  1435. &gt; <userinput>config commit</userinput>
  1436. </screen>
  1437. </para>
  1438. </section>
  1439. <!-- TODO: later try this
  1440. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  1441. > config set Resolver/forward_addresses[0]/port 53
  1442. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1443. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1444. -->
  1445. </chapter>
  1446. <chapter id="statistics">
  1447. <title>Statistics</title>
  1448. <para>
  1449. The <command>b10-stats</command> process is started by
  1450. <command>bind10</command>.
  1451. It periodically collects statistics data from various modules
  1452. and aggregates it.
  1453. <!-- TODO -->
  1454. </para>
  1455. <para>
  1456. This stats daemon provides commands to identify if it is
  1457. running, show specified or all statistics data, show specified
  1458. or all statistics data schema, and set specified statistics
  1459. data.
  1460. For example, using <command>bindctl</command>:
  1461. <screen>
  1462. &gt; <userinput>Stats show</userinput>
  1463. {
  1464. "Auth": {
  1465. "queries.tcp": 1749,
  1466. "queries.udp": 867868
  1467. },
  1468. "Boss": {
  1469. "boot_time": "2011-01-20T16:59:03Z"
  1470. },
  1471. "Stats": {
  1472. "boot_time": "2011-01-20T16:59:05Z",
  1473. "last_update_time": "2011-01-20T17:04:05Z",
  1474. "lname": "4d3869d9_a@jreed.example.net",
  1475. "report_time": "2011-01-20T17:04:06Z",
  1476. "timestamp": 1295543046.823504
  1477. }
  1478. }
  1479. </screen>
  1480. </para>
  1481. </chapter>
  1482. <chapter id="logging">
  1483. <title>Logging</title>
  1484. <section>
  1485. <title>Logging configuration</title>
  1486. <para>
  1487. The logging system in BIND 10 is configured through the
  1488. Logging module. All BIND 10 modules will look at the
  1489. configuration in Logging to see what should be logged and
  1490. to where.
  1491. <!-- TODO: what is context of Logging module for readers of this guide? -->
  1492. </para>
  1493. <section>
  1494. <title>Loggers</title>
  1495. <para>
  1496. Within BIND 10, a message is logged through a component
  1497. called a "logger". Different parts of BIND 10 log messages
  1498. through different loggers, and each logger can be configured
  1499. independently of one another.
  1500. </para>
  1501. <para>
  1502. In the Logging module, you can specify the configuration
  1503. for zero or more loggers; any that are not specified will
  1504. take appropriate default values..
  1505. </para>
  1506. <para>
  1507. The three most important elements of a logger configuration
  1508. are the <option>name</option> (the component that is
  1509. generating the messages), the <option>severity</option>
  1510. (what to log), and the <option>output_options</option>
  1511. (where to log).
  1512. </para>
  1513. <section>
  1514. <title>name (string)</title>
  1515. <para>
  1516. Each logger in the system has a name, the name being that
  1517. of the component using it to log messages. For instance,
  1518. if you want to configure logging for the resolver module,
  1519. you add an entry for a logger named <quote>Resolver</quote>. This
  1520. configuration will then be used by the loggers in the
  1521. Resolver module, and all the libraries used by it.
  1522. </para>
  1523. <!-- TODO: later we will have a way to know names of all modules
  1524. Right now you can only see what their names are if they are running
  1525. (a simple 'help' without anything else in bindctl for instance).
  1526. -->
  1527. <para>
  1528. If you want to specify logging for one specific library
  1529. within the module, you set the name to
  1530. <replaceable>module.library</replaceable>. For example, the
  1531. logger used by the nameserver address store component
  1532. has the full name of <quote>Resolver.nsas</quote>. If
  1533. there is no entry in Logging for a particular library,
  1534. it will use the configuration given for the module.
  1535. <!-- TODO: how to know these specific names?
  1536. We will either have to document them or tell the administrator to
  1537. specify module-wide logging and see what appears...
  1538. -->
  1539. </para>
  1540. <para>
  1541. <!-- TODO: severity has not been covered yet -->
  1542. To illustrate this, suppose you want the cache library
  1543. to log messages of severity DEBUG, and the rest of the
  1544. resolver code to log messages of severity INFO. To achieve
  1545. this you specify two loggers, one with the name
  1546. <quote>Resolver</quote> and severity INFO, and one with
  1547. the name <quote>Resolver.cache</quote> with severity
  1548. DEBUG. As there are no entries for other libraries (e.g.
  1549. the nsas), they will use the configuration for the module
  1550. (<quote>Resolver</quote>), so giving the desired behavior.
  1551. </para>
  1552. <para>
  1553. One special case is that of a module name of <quote>*</quote>
  1554. (asterisks), which is interpreted as <emphasis>any</emphasis>
  1555. module. You can set global logging options by using this,
  1556. including setting the logging configuration for a library
  1557. that is used by multiple modules (e.g. <quote>*.config</quote>
  1558. specifies the configuration library code in whatever
  1559. module is using it).
  1560. </para>
  1561. <para>
  1562. If there are multiple logger specifications in the
  1563. configuration that might match a particular logger, the
  1564. specification with the more specific logger name takes
  1565. precedence. For example, if there are entries for for
  1566. both <quote>*</quote> and <quote>Resolver</quote>, the
  1567. resolver module &mdash; and all libraries it uses &mdash;
  1568. will log messages according to the configuration in the
  1569. second entry (<quote>Resolver</quote>). All other modules
  1570. will use the configuration of the first entry
  1571. (<quote>*</quote>). If there was also a configuration
  1572. entry for <quote>Resolver.cache</quote>, the cache library
  1573. within the resolver would use that in preference to the
  1574. entry for <quote>Resolver</quote>.
  1575. </para>
  1576. <para>
  1577. One final note about the naming. When specifying the
  1578. module name within a logger, use the name of the module
  1579. as specified in <command>bindctl</command>, e.g.
  1580. <quote>Resolver</quote> for the resolver module,
  1581. <quote>Xfrout</quote> for the xfrout module, etc. When
  1582. the message is logged, the message will include the name
  1583. of the logger generating the message, but with the module
  1584. name replaced by the name of the process implementing
  1585. the module (so for example, a message generated by the
  1586. <quote>Auth.cache</quote> logger will appear in the output
  1587. with a logger name of <quote>b10-auth.cache</quote>).
  1588. </para>
  1589. </section>
  1590. <section>
  1591. <title>severity (string)</title>
  1592. <para>
  1593. This specifies the category of messages logged.
  1594. Each message is logged with an associated severity which
  1595. may be one of the following (in descending order of
  1596. severity):
  1597. </para>
  1598. <itemizedlist>
  1599. <listitem>
  1600. <simpara> FATAL </simpara>
  1601. </listitem>
  1602. <listitem>
  1603. <simpara> ERROR </simpara>
  1604. </listitem>
  1605. <listitem>
  1606. <simpara> WARN </simpara>
  1607. </listitem>
  1608. <listitem>
  1609. <simpara> INFO </simpara>
  1610. </listitem>
  1611. <listitem>
  1612. <simpara> DEBUG </simpara>
  1613. </listitem>
  1614. </itemizedlist>
  1615. <para>
  1616. When the severity of a logger is set to one of these
  1617. values, it will only log messages of that severity, and
  1618. the severities above it. The severity may also be set to
  1619. NONE, in which case all messages from that logger are
  1620. inhibited.
  1621. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  1622. </para>
  1623. </section>
  1624. <section>
  1625. <title>output_options (list)</title>
  1626. <para>
  1627. Each logger can have zero or more
  1628. <option>output_options</option>. These specify where log
  1629. messages are sent to. These are explained in detail below.
  1630. </para>
  1631. <para>
  1632. The other options for a logger are:
  1633. </para>
  1634. </section>
  1635. <section>
  1636. <title>debuglevel (integer)</title>
  1637. <para>
  1638. When a logger's severity is set to DEBUG, this value
  1639. specifies what debug messages should be printed. It ranges
  1640. from 0 (least verbose) to 99 (most verbose).
  1641. </para>
  1642. <!-- TODO: complete this sentence:
  1643. The general classification of debug message types is
  1644. TODO; there's a ticket to determine these levels, see #1074
  1645. -->
  1646. <para>
  1647. If severity for the logger is not DEBUG, this value is ignored.
  1648. </para>
  1649. </section>
  1650. <section>
  1651. <title>additive (true or false)</title>
  1652. <para>
  1653. If this is true, the <option>output_options</option> from
  1654. the parent will be used. For example, if there are two
  1655. loggers configured; <quote>Resolver</quote> and
  1656. <quote>Resolver.cache</quote>, and <option>additive</option>
  1657. is true in the second, it will write the log messages
  1658. not only to the destinations specified for
  1659. <quote>Resolver.cache</quote>, but also to the destinations
  1660. as specified in the <option>output_options</option> in
  1661. the logger named <quote>Resolver</quote>.
  1662. <!-- TODO: check this -->
  1663. </para>
  1664. </section>
  1665. </section>
  1666. <section>
  1667. <title>Output Options</title>
  1668. <para>
  1669. The main settings for an output option are the
  1670. <option>destination</option> and a value called
  1671. <option>output</option>, the meaning of which depends on
  1672. the destination that is set.
  1673. </para>
  1674. <section>
  1675. <title>destination (string)</title>
  1676. <para>
  1677. The destination is the type of output. It can be one of:
  1678. </para>
  1679. <itemizedlist>
  1680. <listitem>
  1681. <simpara> console </simpara>
  1682. </listitem>
  1683. <listitem>
  1684. <simpara> file </simpara>
  1685. </listitem>
  1686. <listitem>
  1687. <simpara> syslog </simpara>
  1688. </listitem>
  1689. </itemizedlist>
  1690. </section>
  1691. <section>
  1692. <title>output (string)</title>
  1693. <para>
  1694. Depending on what is set as the output destination, this
  1695. value is interpreted as follows:
  1696. </para>
  1697. <variablelist>
  1698. <varlistentry>
  1699. <term><option>destination</option> is <quote>console</quote></term>
  1700. <listitem>
  1701. <simpara>
  1702. The value of output must be one of <quote>stdout</quote>
  1703. (messages printed to standard output) or
  1704. <quote>stderr</quote> (messages printed to standard
  1705. error).
  1706. </simpara>
  1707. </listitem>
  1708. </varlistentry>
  1709. <varlistentry>
  1710. <term><option>destination</option> is <quote>file</quote></term>
  1711. <listitem>
  1712. <simpara>
  1713. The value of output is interpreted as a file name;
  1714. log messages will be appended to this file.
  1715. </simpara>
  1716. </listitem>
  1717. </varlistentry>
  1718. <varlistentry>
  1719. <term><option>destination</option> is <quote>syslog</quote></term>
  1720. <listitem>
  1721. <simpara>
  1722. The value of output is interpreted as the
  1723. <command>syslog</command> facility (e.g.
  1724. <emphasis>local0</emphasis>) that should be used
  1725. for log messages.
  1726. </simpara>
  1727. </listitem>
  1728. </varlistentry>
  1729. </variablelist>
  1730. <para>
  1731. The other options for <option>output_options</option> are:
  1732. </para>
  1733. <section>
  1734. <title>flush (true of false)</title>
  1735. <para>
  1736. Flush buffers after each log message. Doing this will
  1737. reduce performance but will ensure that if the program
  1738. terminates abnormally, all messages up to the point of
  1739. termination are output.
  1740. </para>
  1741. </section>
  1742. <section>
  1743. <title>maxsize (integer)</title>
  1744. <para>
  1745. Only relevant when destination is file, this is maximum
  1746. file size of output files in bytes. When the maximum
  1747. size is reached, the file is renamed and a new file opened.
  1748. (For example, a ".1" is appended to the name &mdash;
  1749. if a ".1" file exists, it is renamed ".2",
  1750. etc.)
  1751. </para>
  1752. <para>
  1753. If this is 0, no maximum file size is used.
  1754. </para>
  1755. </section>
  1756. <section>
  1757. <title>maxver (integer)</title>
  1758. <para>
  1759. Maximum number of old log files to keep around when
  1760. rolling the output file. Only relevant when
  1761. <option>destination</option> is <quote>file</quote>.
  1762. </para>
  1763. </section>
  1764. </section>
  1765. </section>
  1766. <section>
  1767. <title>Example session</title>
  1768. <para>
  1769. In this example we want to set the global logging to
  1770. write to the file <filename>/var/log/my_bind10.log</filename>,
  1771. at severity WARN. We want the authoritative server to
  1772. log at DEBUG with debuglevel 40, to a different file
  1773. (<filename>/tmp/debug_messages</filename>).
  1774. </para>
  1775. <para>
  1776. Start <command>bindctl</command>.
  1777. </para>
  1778. <para>
  1779. <screen>["login success "]
  1780. &gt; <userinput>config show Logging</userinput>
  1781. Logging/loggers [] list
  1782. </screen>
  1783. </para>
  1784. <para>
  1785. By default, no specific loggers are configured, in which
  1786. case the severity defaults to INFO and the output is
  1787. written to stderr.
  1788. </para>
  1789. <para>
  1790. Let's first add a default logger:
  1791. </para>
  1792. <!-- TODO: adding the empty loggers makes no sense -->
  1793. <para>
  1794. <screen><userinput>&gt; config add Logging/loggers</userinput>
  1795. &gt; <userinput>config show Logging</userinput>
  1796. Logging/loggers/ list (modified)
  1797. </screen>
  1798. </para>
  1799. <para>
  1800. The loggers value line changed to indicate that it is no
  1801. longer an empty list:
  1802. </para>
  1803. <para>
  1804. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  1805. Logging/loggers[0]/name "" string (default)
  1806. Logging/loggers[0]/severity "INFO" string (default)
  1807. Logging/loggers[0]/debuglevel 0 integer (default)
  1808. Logging/loggers[0]/additive false boolean (default)
  1809. Logging/loggers[0]/output_options [] list (default)
  1810. </screen>
  1811. </para>
  1812. <para>
  1813. The name is mandatory, so we must set it. We will also
  1814. change the severity as well. Let's start with the global
  1815. logger.
  1816. </para>
  1817. <para>
  1818. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  1819. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  1820. &gt; <userinput>config show Logging/loggers</userinput>
  1821. Logging/loggers[0]/name "*" string (modified)
  1822. Logging/loggers[0]/severity "WARN" string (modified)
  1823. Logging/loggers[0]/debuglevel 0 integer (default)
  1824. Logging/loggers[0]/additive false boolean (default)
  1825. Logging/loggers[0]/output_options [] list (default)
  1826. </screen>
  1827. </para>
  1828. <para>
  1829. Of course, we need to specify where we want the log
  1830. messages to go, so we add an entry for an output option.
  1831. </para>
  1832. <para>
  1833. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  1834. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  1835. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  1836. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  1837. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1838. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  1839. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  1840. </screen>
  1841. </para>
  1842. <para>
  1843. These aren't the values we are looking for.
  1844. </para>
  1845. <para>
  1846. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  1847. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  1848. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 30000</userinput>
  1849. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  1850. </screen>
  1851. </para>
  1852. <para>
  1853. Which would make the entire configuration for this logger
  1854. look like:
  1855. </para>
  1856. <para>
  1857. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  1858. Logging/loggers[0]/name "*" string (modified)
  1859. Logging/loggers[0]/severity "WARN" string (modified)
  1860. Logging/loggers[0]/debuglevel 0 integer (default)
  1861. Logging/loggers[0]/additive false boolean (default)
  1862. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  1863. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  1864. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1865. Logging/loggers[0]/output_options[0]/maxsize 30000 integer (modified)
  1866. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  1867. </screen>
  1868. </para>
  1869. <para>
  1870. That looks OK, so let's commit it before we add the
  1871. configuration for the authoritative server's logger.
  1872. </para>
  1873. <para>
  1874. <screen>&gt; <userinput> config commit</userinput></screen>
  1875. </para>
  1876. <para>
  1877. Now that we have set it, and checked each value along
  1878. the way, adding a second entry is quite similar.
  1879. </para>
  1880. <para>
  1881. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  1882. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  1883. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  1884. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  1885. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  1886. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  1887. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  1888. &gt; <userinput> config commit</userinput>
  1889. </screen>
  1890. </para>
  1891. <para>
  1892. And that's it. Once we have found whatever it was we
  1893. needed the debug messages for, we can simply remove the
  1894. second logger to let the authoritative server use the
  1895. same settings as the rest.
  1896. </para>
  1897. <para>
  1898. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  1899. &gt; <userinput> config commit</userinput>
  1900. </screen>
  1901. </para>
  1902. <para>
  1903. And every module will now be using the values from the
  1904. logger named <quote>*</quote>.
  1905. </para>
  1906. </section>
  1907. </section>
  1908. <section>
  1909. <title>Logging Message Format</title>
  1910. <para>
  1911. Each message written by BIND 10 to the configured logging
  1912. destinations comprises a number of components that identify
  1913. the origin of the message and, if the message indicates
  1914. a problem, information about the problem that may be
  1915. useful in fixing it.
  1916. </para>
  1917. <para>
  1918. Consider the message below logged to a file:
  1919. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  1920. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  1921. </para>
  1922. <para>
  1923. Note: the layout of messages written to the system logging
  1924. file (syslog) may be slightly different. This message has
  1925. been split across two lines here for display reasons; in the
  1926. logging file, it will appear on one line.)
  1927. </para>
  1928. <para>
  1929. The log message comprises a number of components:
  1930. <variablelist>
  1931. <varlistentry>
  1932. <term>2011-06-15 13:48:22.034</term>
  1933. <!-- TODO: timestamp repeated even if using syslog? -->
  1934. <listitem><para>
  1935. The date and time at which the message was generated.
  1936. </para></listitem>
  1937. </varlistentry>
  1938. <varlistentry>
  1939. <term>ERROR</term>
  1940. <listitem><para>
  1941. The severity of the message.
  1942. </para></listitem>
  1943. </varlistentry>
  1944. <varlistentry>
  1945. <term>[b10-resolver.asiolink]</term>
  1946. <listitem><para>
  1947. The source of the message. This comprises two components:
  1948. the BIND 10 process generating the message (in this
  1949. case, <command>b10-resolver</command>) and the module
  1950. within the program from which the message originated
  1951. (which in the example is the asynchronous I/O link
  1952. module, asiolink).
  1953. </para></listitem>
  1954. </varlistentry>
  1955. <varlistentry>
  1956. <term>ASIODNS_OPENSOCK</term>
  1957. <listitem><para>
  1958. The message identification. Every message in BIND 10
  1959. has a unique identification, which can be used as an
  1960. index into the <ulink
  1961. url="bind10-messages.html"><citetitle>BIND 10 Messages
  1962. Manual</citetitle></ulink> (<ulink
  1963. url="http://bind10.isc.org/docs/bind10-messages.html"
  1964. />) from which more information can be obtained.
  1965. </para></listitem>
  1966. </varlistentry>
  1967. <varlistentry>
  1968. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  1969. <listitem><para>
  1970. A brief description of the cause of the problem.
  1971. Within this text, information relating to the condition
  1972. that caused the message to be logged will be included.
  1973. In this example, error number 111 (an operating
  1974. system-specific error number) was encountered when
  1975. trying to open a TCP connection to port 53 on the
  1976. local system (address 127.0.0.1). The next step
  1977. would be to find out the reason for the failure by
  1978. consulting your system's documentation to identify
  1979. what error number 111 means.
  1980. </para></listitem>
  1981. </varlistentry>
  1982. </variablelist>
  1983. </para>
  1984. </section>
  1985. </chapter>
  1986. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  1987. <!-- <index> <title>Index</title> </index> -->
  1988. </book>
  1989. <!--
  1990. TODO:
  1991. Overview
  1992. Getting BIND 10 Installed
  1993. Basics
  1994. Dependencies
  1995. Optional
  1996. Advanced
  1997. How Does Everything Work Together?
  1998. Need Help?
  1999. -->