bind10-guide.xml 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402
  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 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-msgq</command> and <command>b10-cfgmgr</command>
  621. services make up the core. The <command>b10-msgq</command> daemon
  622. provides the communication channel between every part of the system.
  623. The <command>b10-cfgmgr</command> daemon is always needed by every
  624. module, if only to send information about themselves somewhere,
  625. but more importantly to ask about their own settings, and
  626. about other modules.
  627. The <command>bind10</command> master process will also start up
  628. <command>b10-cmdctl</command> for admins to communicate with the
  629. system, <command>b10-auth</command> for authoritative DNS service or
  630. <command>b10-resolver</command> for recursive name service,
  631. <command>b10-stats</command> for statistics collection,
  632. <command>b10-xfrin</command> for inbound DNS zone transfers,
  633. <command>b10-xfrout</command> for outbound DNS zone transfers,
  634. and <command>b10-zonemgr</command> for secondary service.
  635. </para>
  636. <section id="start">
  637. <title>Starting BIND 10</title>
  638. <para>
  639. To start the BIND 10 service, simply run <command>bind10</command>.
  640. Run it with the <option>--verbose</option> switch to
  641. get additional debugging or diagnostic output.
  642. </para>
  643. <!-- TODO: note it doesn't go into background -->
  644. <note>
  645. <para>
  646. If the setproctitle Python module is detected at start up,
  647. the process names for the Python-based daemons will be renamed
  648. to better identify them instead of just <quote>python</quote>.
  649. This is not needed on some operating systems.
  650. </para>
  651. </note>
  652. </section>
  653. </chapter>
  654. <chapter id="msgq">
  655. <title>Command channel</title>
  656. <para>
  657. The BIND 10 components use the <command>b10-msgq</command>
  658. message routing daemon to communicate with other BIND 10 components.
  659. The <command>b10-msgq</command> implements what is called the
  660. <quote>Command Channel</quote>.
  661. Processes intercommunicate by sending messages on the command
  662. channel.
  663. Example messages include shutdown, get configurations, and set
  664. configurations.
  665. This Command Channel is not used for DNS message passing.
  666. It is used only to control and monitor the BIND 10 system.
  667. </para>
  668. <para>
  669. Administrators do not communicate directly with the
  670. <command>b10-msgq</command> daemon.
  671. By default, BIND 10 uses port 9912 for the
  672. <command>b10-msgq</command> service.
  673. It listens on 127.0.0.1.
  674. </para>
  675. <!-- TODO: this is broken, see Trac #111
  676. <para>
  677. To select an alternate port for the <command>b10-msgq</command> to
  678. use, run <command>bind10</command> specifying the option:
  679. <screen> $ <userinput>bind10 -TODO-msgq-port 9912</userinput></screen>
  680. </para>
  681. -->
  682. <!-- TODO: upcoming plans:
  683. Unix domain sockets
  684. -->
  685. </chapter>
  686. <chapter id="cfgmgr">
  687. <title>Configuration manager</title>
  688. <para>
  689. The configuration manager, <command>b10-cfgmgr</command>,
  690. handles all BIND 10 system configuration. It provides
  691. persistent storage for configuration, and notifies running
  692. modules of configuration changes.
  693. </para>
  694. <para>
  695. The <command>b10-auth</command> and <command>b10-xfrin</command>
  696. daemons and other components receive their configurations
  697. from the configuration manager over the <command>b10-msgq</command>
  698. command channel.
  699. </para>
  700. <para>The administrator doesn't connect to it directly, but
  701. uses a user interface to communicate with the configuration
  702. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  703. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  704. </para>
  705. <!-- TODO -->
  706. <note>
  707. <para>
  708. The development prototype release only provides the
  709. <command>bindctl</command> as a user interface to
  710. <command>b10-cmdctl</command>.
  711. Upcoming releases will provide another interactive command-line
  712. interface and a web-based interface.
  713. </para>
  714. </note>
  715. <para>
  716. The <command>b10-cfgmgr</command> daemon can send all
  717. specifications and all current settings to the
  718. <command>bindctl</command> client (via
  719. <command>b10-cmdctl</command>).
  720. </para>
  721. <para>
  722. <command>b10-cfgmgr</command> relays configurations received
  723. from <command>b10-cmdctl</command> to the appropriate modules.
  724. </para>
  725. <!-- TODO:
  726. Configuration settings for itself are defined as ConfigManager.
  727. TODO: show examples
  728. -->
  729. <!-- TODO:
  730. config changes are actually commands to cfgmgr
  731. -->
  732. <!-- TODO: what about run time config to change this? -->
  733. <!-- jelte: > config set cfgmgr/config_database <file> -->
  734. <!-- TODO: what about command line switch to change this? -->
  735. <para>
  736. The stored configuration file is at
  737. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  738. (The full path is what was defined at build configure time for
  739. <option>--localstatedir</option>.
  740. The default is <filename>/usr/local/var/</filename>.)
  741. The format is loosely based on JSON and is directly parseable
  742. python, but this may change in a future version.
  743. This configuration data file is not manually edited by the
  744. administrator.
  745. </para>
  746. <!--
  747. Well the specfiles have a more fixed format (they must contain specific
  748. stuff), but those are also directly parseable python structures (and
  749. 'coincidentally', our data::element string representation is the same)
  750. loosely based on json, tweaked to be directly parseable in python, but a
  751. subset of that.
  752. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  753. nope, spec files are written by module developers, and db should be done
  754. through bindctl and friends
  755. -->
  756. <para>
  757. The configuration manager does not have any command line arguments.
  758. Normally it is not started manually, but is automatically
  759. started using the <command>bind10</command> master process
  760. (as covered in <xref linkend="bind10"/>).
  761. </para>
  762. <!-- TODO: upcoming plans:
  763. configuration for configuration manager itself. And perhaps we might
  764. change the messaging protocol, but an admin should never see any of that
  765. -->
  766. <!-- TODO: show examples, test this -->
  767. <!--
  768. , so an admin can simply run bindctl,
  769. do config show, and it shows all modules; config show >module> shows all
  770. options for that module
  771. -->
  772. </chapter>
  773. <chapter id="cmdctl">
  774. <title>Remote control daemon</title>
  775. <para>
  776. <command>b10-cmdctl</command> is the gateway between
  777. administrators and the BIND 10 system.
  778. It is a HTTPS server that uses standard HTTP Digest
  779. Authentication for username and password validation.
  780. It provides a REST-ful interface for accessing and controlling
  781. BIND 10.
  782. </para>
  783. <!-- TODO: copy examples from wiki, try with wget -->
  784. <para>
  785. When <command>b10-cmdctl</command> starts, it firsts
  786. asks <command>b10-cfgmgr</command> about what modules are
  787. running and what their configuration is (over the
  788. <command>b10-msgq</command> channel). Then it will start listening
  789. on HTTPS for clients &mdash; the user interface &mdash; such
  790. as <command>bindctl</command>.
  791. </para>
  792. <para>
  793. <command>b10-cmdctl</command> directly sends commands
  794. (received from the user interface) to the specified component.
  795. Configuration changes are actually commands to
  796. <command>b10-cfgmgr</command> so are sent there.
  797. </para>
  798. <!--
  799. TODO:
  800. "For bindctl to list a module's available configurations and
  801. available commands, it communicates over the cmdctl REST interface.
  802. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  803. asks the module for its specification and also cfgmgr looks in its
  804. own configuration database for current values."
  805. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  806. GET, but rather requests it once and then listens in for updates,
  807. but you might wanna check with likun
  808. -->
  809. <!-- TODO: replace /usr/local -->
  810. <!-- TODO: permissions -->
  811. <para>The HTTPS server requires a private key,
  812. such as a RSA PRIVATE KEY.
  813. The default location is at
  814. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  815. (A sample key is at
  816. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  817. It also uses a certificate located at
  818. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  819. (A sample certificate is at
  820. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  821. This may be a self-signed certificate or purchased from a
  822. certification authority.
  823. </para>
  824. <note><para>
  825. The HTTPS server doesn't support a certificate request from a
  826. client (at this time).
  827. <!-- TODO: maybe allow request from server side -->
  828. The <command>b10-cmdctl</command> daemon does not provide a
  829. public service. If any client wants to control BIND 10, then
  830. a certificate needs to be first received from the BIND 10
  831. administrator.
  832. The BIND 10 installation provides a sample PEM bundle that matches
  833. the sample key and certificate.
  834. </para></note>
  835. <!-- TODO: cross-ref -->
  836. <!-- TODO
  837. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  838. but that is a single file, maybethis should go back to that format?
  839. -->
  840. <!--
  841. <para>
  842. (08:20:56) shane: It is in theory possible to run without cmdctl.
  843. (08:21:02) shane: I think we discussed this.
  844. </para>
  845. -->
  846. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  847. <para>
  848. The <command>b10-cmdctl</command> daemon also requires
  849. the user account file located at
  850. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  851. This comma-delimited file lists the accounts with a user name,
  852. hashed password, and salt.
  853. (A sample file is at
  854. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  855. It contains the user named <quote>root</quote> with the password
  856. <quote>bind10</quote>.)
  857. </para>
  858. <para>
  859. The administrator may create a user account with the
  860. <command>b10-cmdctl-usermgr</command> tool.
  861. </para>
  862. <!-- TODO: show example -->
  863. <!-- TODO: does cmdctl need to be restarted to change cert or key
  864. or accounts database -->
  865. <para>
  866. By default the HTTPS server listens on the localhost port 8080.
  867. The port can be set by using the <option>--port</option> command line option.
  868. The address to listen on can be set using the <option>--address</option> command
  869. line argument.
  870. Each HTTPS connection is stateless and timesout in 1200 seconds
  871. by default. This can be
  872. redefined by using the <option>--idle-timeout</option> command line argument.
  873. </para>
  874. <section id="cmdctl.spec">
  875. <title>Configuration specification for b10-cmdctl</title>
  876. <para>
  877. The configuration items for <command>b10-cmdctl</command> are:
  878. key_file
  879. cert_file
  880. accounts_file
  881. </para>
  882. <!-- TODO -->
  883. <para>
  884. The control commands are:
  885. print_settings
  886. <!-- TODO: remove that -->
  887. shutdown
  888. </para>
  889. <!-- TODO -->
  890. </section>
  891. <!--
  892. TODO
  893. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  894. (12:21:33) jinmei: btw
  895. -->
  896. </chapter>
  897. <chapter id="bindctl">
  898. <title>Control and configure user interface</title>
  899. <note><para>
  900. For this development prototype release, <command>bindctl</command>
  901. is the only user interface. It is expected that upcoming
  902. releases will provide another interactive command-line
  903. interface and a web-based interface for controlling and
  904. configuring BIND 10.
  905. </para></note>
  906. <para>
  907. The <command>bindctl</command> tool provides an interactive
  908. prompt for configuring, controlling, and querying the BIND 10
  909. components.
  910. It communicates directly with a REST-ful interface over HTTPS
  911. provided by <command>b10-cmdctl</command>. It doesn't
  912. communicate to any other components directly.
  913. </para>
  914. <!-- TODO: explain and show interface -->
  915. <para>
  916. Configuration changes are actually commands to
  917. <command>b10-cfgmgr</command>. So when <command>bindctl</command>
  918. sends a configuration, it is sent to <command>b10-cmdctl</command>
  919. (over a HTTPS connection); then <command>b10-cmdctl</command>
  920. sends the command (over a <command>b10-msgq</command> command
  921. channel) to <command>b10-cfgmgr</command> which then stores
  922. the details and relays (over a <command>b10-msgq</command> command
  923. channel) the configuration on to the specified module.
  924. </para>
  925. <para>
  926. </para>
  927. </chapter>
  928. <chapter id="authserver">
  929. <title>Authoritative Server</title>
  930. <para>
  931. The <command>b10-auth</command> is the authoritative DNS server.
  932. It supports EDNS0 and DNSSEC. It supports IPv6.
  933. Normally it is started by the <command>bind10</command> master
  934. process.
  935. </para>
  936. <section>
  937. <title>Server Configurations</title>
  938. <!-- TODO: offers command line options but not used
  939. since we used bind10 -->
  940. <para>
  941. <command>b10-auth</command> is configured via the
  942. <command>b10-cfgmgr</command> configuration manager.
  943. The module name is <quote>Auth</quote>.
  944. The configuration data item is:
  945. <variablelist>
  946. <varlistentry>
  947. <term>database_file</term>
  948. <listitem>
  949. <simpara>This is an optional string to define the path to find
  950. the SQLite3 database file.
  951. <!-- TODO: -->
  952. Note: Later the DNS server will use various data source backends.
  953. This may be a temporary setting until then.
  954. </simpara>
  955. </listitem>
  956. </varlistentry>
  957. </variablelist>
  958. </para>
  959. <para>
  960. The configuration command is:
  961. <variablelist>
  962. <varlistentry>
  963. <term>shutdown</term>
  964. <listitem>
  965. <simpara>Stop the authoritative DNS server.
  966. </simpara>
  967. <!-- TODO: what happens when this is sent, will bind10 restart? -->
  968. </listitem>
  969. </varlistentry>
  970. </variablelist>
  971. </para>
  972. <!-- TODO: examples of setting or running above? -->
  973. </section>
  974. <section>
  975. <title>Data Source Backends</title>
  976. <note><para>
  977. For the development prototype release, <command>b10-auth</command>
  978. supports a SQLite3 data source backend and in-memory data source
  979. backend.
  980. Upcoming versions will be able to use multiple different
  981. data sources, such as MySQL and Berkeley DB.
  982. </para></note>
  983. <para>
  984. By default, the SQLite3 backend uses the data file located at
  985. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  986. (The full path is what was defined at build configure time for
  987. <option>--localstatedir</option>.
  988. The default is <filename>/usr/local/var/</filename>.)
  989. This data file location may be changed by defining the
  990. <quote>database_file</quote> configuration.
  991. </para>
  992. </section>
  993. <section>
  994. <title>Loading Master Zones Files</title>
  995. <para>
  996. RFC 1035 style DNS master zone files may imported
  997. into a BIND 10 data source by using the
  998. <command>b10-loadzone</command> utility.
  999. </para>
  1000. <para>
  1001. <command>b10-loadzone</command> supports the following
  1002. special directives (control entries):
  1003. <variablelist>
  1004. <varlistentry>
  1005. <term>$INCLUDE</term>
  1006. <listitem>
  1007. <simpara>Loads an additional zone file. This may be recursive.
  1008. </simpara>
  1009. </listitem>
  1010. </varlistentry>
  1011. <varlistentry>
  1012. <term>$ORIGIN</term>
  1013. <listitem>
  1014. <simpara>Defines the relative domain name.
  1015. </simpara>
  1016. </listitem>
  1017. </varlistentry>
  1018. <varlistentry>
  1019. <term>$TTL</term>
  1020. <listitem>
  1021. <simpara>Defines the time-to-live value used for following
  1022. records that don't include a TTL.
  1023. </simpara>
  1024. </listitem>
  1025. </varlistentry>
  1026. </variablelist>
  1027. </para>
  1028. <para>
  1029. The <option>-o</option> argument may be used to define the
  1030. default origin for loaded zone file records.
  1031. </para>
  1032. <note>
  1033. <para>
  1034. In the development prototype release, only the SQLite3 back
  1035. end is used.
  1036. By default, it stores the zone data in
  1037. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  1038. unless the <option>-d</option> switch is used to set the
  1039. database filename.
  1040. Multiple zones are stored in a single SQLite3 zone database.
  1041. </para>
  1042. </note>
  1043. <para>
  1044. If you reload a zone already existing in the database,
  1045. all records from that prior zone disappear and a whole new set
  1046. appears.
  1047. </para>
  1048. <!--TODO: permissions for xfrin or loadzone to create the file -->
  1049. </section>
  1050. <!--
  1051. TODO
  1052. <section>
  1053. <title>Troubleshooting</title>
  1054. <para>
  1055. </para>
  1056. </section>
  1057. -->
  1058. </chapter>
  1059. <chapter id="xfrin">
  1060. <title>Incoming Zone Transfers</title>
  1061. <para>
  1062. Incoming zones are transferred using the <command>b10-xfrin</command>
  1063. process which is started by <command>bind10</command>.
  1064. When received, the zone is stored in the corresponding BIND 10
  1065. data source, and its records can be served by
  1066. <command>b10-auth</command>.
  1067. In combination with <command>b10-zonemgr</command> (for
  1068. automated SOA checks), this allows the BIND 10 server to
  1069. provide <quote>secondary</quote> service.
  1070. </para>
  1071. <para>
  1072. The <command>b10-xfrin</command> process supports both AXFR and
  1073. IXFR. Due to some implementation limitations of the current
  1074. development release, however, it only tries AXFR by default,
  1075. and care should be taken to enable IXFR.
  1076. </para>
  1077. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1078. <note><simpara>
  1079. In the current development release of BIND 10, incoming zone
  1080. transfers are only available for SQLite3-based data sources,
  1081. that is, they don't work for an in-memory data source.
  1082. </simpara></note>
  1083. <section>
  1084. <title>Configuration for Incoming Zone Transfers</title>
  1085. <para>
  1086. In practice, you need to specify a list of secondary zones to
  1087. enable incoming zone transfers for these zones (you can still
  1088. trigger a zone transfer manually, without a prior configuration
  1089. (see below)).
  1090. </para>
  1091. <para>
  1092. For example, to enable zone transfers for a zone named "example.com"
  1093. (whose master address is assumed to be 2001:db8::53 here),
  1094. run the following at the <command>bindctl</command> prompt:
  1095. <screen>&gt; <userinput>config add Xfrin/zones</userinput>
  1096. &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
  1097. &gt; <userinput>config set Xfrin/zones[0]/master_addr "<option>2001:db8::53</option>"</userinput>
  1098. &gt; <userinput>config commit</userinput></screen>
  1099. (We assume there has been no zone configuration before).
  1100. </para>
  1101. </section>
  1102. <section>
  1103. <title>Enabling IXFR</title>
  1104. <para>
  1105. As noted above, <command>b10-xfrin</command> uses AXFR for
  1106. zone transfers by default. To enable IXFR for zone transfers
  1107. for a particular zone, set the <userinput>use_ixfr</userinput>
  1108. configuration parameter to <userinput>true</userinput>.
  1109. In the above example of configuration sequence, you'll need
  1110. to add the following before performing <userinput>commit</userinput>:
  1111. <screen>&gt; <userinput>config set Xfrin/zones[0]/use_ixfr true</userinput></screen>
  1112. </para>
  1113. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1114. <note><simpara>
  1115. One reason why IXFR is disabled by default in the current
  1116. release is because it does not support automatic fallback from IXFR to
  1117. AXFR when it encounters a primary server that doesn't support
  1118. outbound IXFR (and, not many existing implementations support
  1119. it). Another, related reason is that it does not use AXFR even
  1120. if it has no knowledge about the zone (like at the very first
  1121. time the secondary server is set up). IXFR requires the
  1122. "current version" of the zone, so obviously it doesn't work
  1123. in this situation and AXFR is the only workable choice.
  1124. The current release of <command>b10-xfrin</command> does not
  1125. make this selection automatically.
  1126. These features will be implemented in a near future
  1127. version, at which point we will enable IXFR by default.
  1128. </simpara></note>
  1129. </section>
  1130. <!-- TODO:
  1131. how to tell bind10 you are a secondary?
  1132. when will it first attempt to check for new zone? (using REFRESH?)
  1133. what if zonemgr is not running?
  1134. what if a NOTIFY is sent?
  1135. -->
  1136. <section>
  1137. <title>Trigger an Incoming Zone Transfer Manually</title>
  1138. <para>
  1139. To manually trigger a zone transfer to retrieve a remote zone,
  1140. you may use the <command>bindctl</command> utility.
  1141. For example, at the <command>bindctl</command> prompt run:
  1142. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  1143. </para>
  1144. </section>
  1145. <!-- TODO: can that retransfer be used to identify a new zone? -->
  1146. <!-- TODO: what if doesn't exist at that master IP? -->
  1147. </chapter>
  1148. <chapter id="xfrout">
  1149. <title>Outbound Zone Transfers</title>
  1150. <para>
  1151. The <command>b10-xfrout</command> process is started by
  1152. <command>bind10</command>.
  1153. When the <command>b10-auth</command> authoritative DNS server
  1154. receives an AXFR or IXFR request, <command>b10-auth</command>
  1155. internally forwards the request to <command>b10-xfrout</command>,
  1156. which handles the rest of request processing.
  1157. This is used to provide primary DNS service to share zones
  1158. to secondary name servers.
  1159. The <command>b10-xfrout</command> is also used to send
  1160. NOTIFY messages to secondary servers.
  1161. </para>
  1162. <para>
  1163. A global or per zone <option>transfer_acl</option> configuration
  1164. can be used to control accessibility of the outbound zone
  1165. transfer service.
  1166. By default, <command>b10-xfrout</command> allows any clients to
  1167. perform zone transfers for any zones:
  1168. </para>
  1169. <screen>&gt; <userinput>config show Xfrout/transfer_acl</userinput>
  1170. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</screen>
  1171. <para>
  1172. You can change this to, for example, rejecting all transfer
  1173. requests by default while allowing requests for the transfer
  1174. of zone "example.com" from 192.0.2.1 and 2001:db8::1 as follows:
  1175. </para>
  1176. <screen>&gt; <userinput>config set Xfrout/transfer_acl[0] {"action": "REJECT"}</userinput>
  1177. &gt; <userinput>config add Xfrout/zone_config</userinput>
  1178. &gt; <userinput>config set Xfrout/zone_config[0]/origin "example.com"</userinput>
  1179. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1"},</userinput>
  1180. <userinput> {"action": "ACCEPT", "from": "2001:db8::1"}]</userinput>
  1181. &gt; <userinput>config commit</userinput></screen>
  1182. <note><simpara>
  1183. In the above example the lines
  1184. for <option>transfer_acl</option> were divided for
  1185. readability. In the actual input it must be in a single line.
  1186. </simpara></note>
  1187. <para>
  1188. If you want to require TSIG in access control, a separate TSIG
  1189. "key ring" must be configured specifically
  1190. for <command>b10-xfrout</command> as well as a system wide
  1191. key ring, both containing a consistent set of keys.
  1192. For example, to change the previous example to allowing requests
  1193. from 192.0.2.1 signed by a TSIG with a key name of
  1194. "key.example", you'll need to do this:
  1195. </para>
  1196. <screen>&gt; <userinput>config set tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</userinput>
  1197. &gt; <userinput>config set Xfrout/tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</userinput>
  1198. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]</userinput>
  1199. &gt; <userinput>config commit</userinput></screen>
  1200. <para>
  1201. The first line of configuration defines a system wide key ring.
  1202. This is necessary because the <command>b10-auth</command> server
  1203. also checks TSIGs and it uses the system wide configuration.
  1204. </para>
  1205. <note><simpara>
  1206. In a future version, <command>b10-xfrout</command> will also
  1207. use the system wide TSIG configuration.
  1208. The way to specify zone specific configuration (ACLs, etc) is
  1209. likely to be changed, too.
  1210. </simpara></note>
  1211. <!--
  1212. TODO:
  1213. xfrout section:
  1214. auth servers checks for AXFR query
  1215. sends the XFR query to the xfrout module
  1216. uses /tmp/auth_xfrout_conn which is a socket
  1217. what is XfroutClient xfr_client??
  1218. /tmp/auth_xfrout_conn is not removed
  1219. -->
  1220. </chapter>
  1221. <chapter id="zonemgr">
  1222. <title>Secondary Manager</title>
  1223. <para>
  1224. The <command>b10-zonemgr</command> process is started by
  1225. <command>bind10</command>.
  1226. It keeps track of SOA refresh, retry, and expire timers
  1227. and other details for BIND 10 to perform as a slave.
  1228. When the <command>b10-auth</command> authoritative DNS server
  1229. receives a NOTIFY message, <command>b10-zonemgr</command>
  1230. may tell <command>b10-xfrin</command> to do a refresh
  1231. to start an inbound zone transfer.
  1232. The secondary manager resets its counters when a new zone is
  1233. transferred in.
  1234. </para>
  1235. <note><simpara>
  1236. Access control (such as allowing notifies) is not yet provided.
  1237. The primary/secondary service is not yet complete.
  1238. </simpara></note>
  1239. <!-- TODO: lots to describe for zonemgr -->
  1240. </chapter>
  1241. <chapter id="resolverserver">
  1242. <title>Recursive Name Server</title>
  1243. <para>
  1244. The <command>b10-resolver</command> process is started by
  1245. <command>bind10</command>.
  1246. <!-- TODO
  1247. It provides a resolver so DNS clients can ask it to do recursion
  1248. and it will return answers.
  1249. -->
  1250. </para>
  1251. <para>
  1252. The main <command>bind10</command> process can be configured
  1253. to select to run either the authoritative or resolver or both.
  1254. By default, it starts the authoritative service.
  1255. <!-- TODO: later both -->
  1256. You may change this using <command>bindctl</command>, for example:
  1257. <screen>
  1258. &gt; <userinput>config set Boss/start_auth false</userinput>
  1259. &gt; <userinput>config set Boss/start_resolver true</userinput>
  1260. &gt; <userinput>config commit</userinput>
  1261. </screen>
  1262. </para>
  1263. <para>
  1264. The master <command>bind10</command> will stop and start
  1265. the desired services.
  1266. </para>
  1267. <para>
  1268. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  1269. The following example shows how it can be configured to
  1270. listen on an additional address (and port):
  1271. <screen>
  1272. &gt; <userinput>config add Resolver/listen_on</userinput>
  1273. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
  1274. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
  1275. &gt; <userinput>config commit</userinput>
  1276. </screen>
  1277. </para>
  1278. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  1279. as needed; run <quote><userinput>config show
  1280. Resolver/listen_on</userinput></quote> if needed.)</simpara>
  1281. <!-- TODO: this example should not include the port, ticket #1185 -->
  1282. <section>
  1283. <title>Access Control</title>
  1284. <para>
  1285. By default, the <command>b10-resolver</command> daemon only accepts
  1286. DNS queries from the localhost (127.0.0.1 and ::1).
  1287. The <option>Resolver/query_acl</option> configuration may
  1288. be used to reject, drop, or allow specific IPs or networks.
  1289. This configuration list is first match.
  1290. </para>
  1291. <para>
  1292. The configuration's <option>action</option> item may be
  1293. set to <quote>ACCEPT</quote> to allow the incoming query,
  1294. <quote>REJECT</quote> to respond with a DNS REFUSED return
  1295. code, or <quote>DROP</quote> to ignore the query without
  1296. any response (such as a blackhole). For more information,
  1297. see the respective debugging messages: <ulink
  1298. url="bind10-messages.html#RESOLVER_QUERY_ACCEPTED">RESOLVER_QUERY_ACCEPTED</ulink>,
  1299. <ulink
  1300. url="bind10-messages.html#RESOLVER_QUERY_REJECTED">RESOLVER_QUERY_REJECTED</ulink>,
  1301. and <ulink
  1302. url="bind10-messages.html#RESOLVER_QUERY_DROPPED">RESOLVER_QUERY_DROPPED</ulink>.
  1303. </para>
  1304. <para>
  1305. The required configuration's <option>from</option> item is set
  1306. to an IPv4 or IPv6 address, addresses with an network mask, or to
  1307. the special lowercase keywords <quote>any6</quote> (for
  1308. any IPv6 address) or <quote>any4</quote> (for any IPv4
  1309. address).
  1310. </para>
  1311. <!-- TODO:
  1312. /0 is for any address in that address family
  1313. does that need any address too?
  1314. TODO: tsig
  1315. -->
  1316. <para>
  1317. For example to allow the <replaceable>192.168.1.0/24</replaceable>
  1318. network to use your recursive name server, at the
  1319. <command>bindctl</command> prompt run:
  1320. </para>
  1321. <screen>
  1322. &gt; <userinput>config add Resolver/query_acl</userinput>
  1323. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/action "ACCEPT"</userinput>
  1324. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/from "<replaceable>192.168.1.0/24</replaceable>"</userinput>
  1325. &gt; <userinput>config commit</userinput>
  1326. </screen>
  1327. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  1328. as needed; run <quote><userinput>config show
  1329. Resolver/query_acl</userinput></quote> if needed.)</simpara>
  1330. <!-- TODO: check this -->
  1331. <note><simpara>This prototype access control configuration
  1332. syntax may be changed.</simpara></note>
  1333. </section>
  1334. <section>
  1335. <title>Forwarding</title>
  1336. <para>
  1337. To enable forwarding, the upstream address and port must be
  1338. configured to forward queries to, such as:
  1339. <screen>
  1340. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  1341. &gt; <userinput>config commit</userinput>
  1342. </screen>
  1343. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  1344. full resolver.)
  1345. </para>
  1346. <para>
  1347. Normal iterative name service can be re-enabled by clearing the
  1348. forwarding address(es); for example:
  1349. <screen>
  1350. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  1351. &gt; <userinput>config commit</userinput>
  1352. </screen>
  1353. </para>
  1354. </section>
  1355. <!-- TODO: later try this
  1356. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  1357. > config set Resolver/forward_addresses[0]/port 53
  1358. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1359. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1360. -->
  1361. </chapter>
  1362. <chapter id="statistics">
  1363. <title>Statistics</title>
  1364. <para>
  1365. The <command>b10-stats</command> process is started by
  1366. <command>bind10</command>.
  1367. It periodically collects statistics data from various modules
  1368. and aggregates it.
  1369. <!-- TODO -->
  1370. </para>
  1371. <para>
  1372. This stats daemon provides commands to identify if it is
  1373. running, show specified or all statistics data, show specified
  1374. or all statistics data schema, and set specified statistics
  1375. data.
  1376. For example, using <command>bindctl</command>:
  1377. <screen>
  1378. &gt; <userinput>Stats show</userinput>
  1379. {
  1380. "Auth": {
  1381. "queries.tcp": 1749,
  1382. "queries.udp": 867868
  1383. },
  1384. "Boss": {
  1385. "boot_time": "2011-01-20T16:59:03Z"
  1386. },
  1387. "Stats": {
  1388. "boot_time": "2011-01-20T16:59:05Z",
  1389. "last_update_time": "2011-01-20T17:04:05Z",
  1390. "lname": "4d3869d9_a@jreed.example.net",
  1391. "report_time": "2011-01-20T17:04:06Z",
  1392. "timestamp": 1295543046.823504
  1393. }
  1394. }
  1395. </screen>
  1396. </para>
  1397. </chapter>
  1398. <chapter id="logging">
  1399. <title>Logging</title>
  1400. <section>
  1401. <title>Logging configuration</title>
  1402. <para>
  1403. The logging system in BIND 10 is configured through the
  1404. Logging module. All BIND 10 modules will look at the
  1405. configuration in Logging to see what should be logged and
  1406. to where.
  1407. <!-- TODO: what is context of Logging module for readers of this guide? -->
  1408. </para>
  1409. <section>
  1410. <title>Loggers</title>
  1411. <para>
  1412. Within BIND 10, a message is logged through a component
  1413. called a "logger". Different parts of BIND 10 log messages
  1414. through different loggers, and each logger can be configured
  1415. independently of one another.
  1416. </para>
  1417. <para>
  1418. In the Logging module, you can specify the configuration
  1419. for zero or more loggers; any that are not specified will
  1420. take appropriate default values..
  1421. </para>
  1422. <para>
  1423. The three most important elements of a logger configuration
  1424. are the <option>name</option> (the component that is
  1425. generating the messages), the <option>severity</option>
  1426. (what to log), and the <option>output_options</option>
  1427. (where to log).
  1428. </para>
  1429. <section>
  1430. <title>name (string)</title>
  1431. <para>
  1432. Each logger in the system has a name, the name being that
  1433. of the component using it to log messages. For instance,
  1434. if you want to configure logging for the resolver module,
  1435. you add an entry for a logger named <quote>Resolver</quote>. This
  1436. configuration will then be used by the loggers in the
  1437. Resolver module, and all the libraries used by it.
  1438. </para>
  1439. <!-- TODO: later we will have a way to know names of all modules
  1440. Right now you can only see what their names are if they are running
  1441. (a simple 'help' without anything else in bindctl for instance).
  1442. -->
  1443. <para>
  1444. If you want to specify logging for one specific library
  1445. within the module, you set the name to
  1446. <replaceable>module.library</replaceable>. For example, the
  1447. logger used by the nameserver address store component
  1448. has the full name of <quote>Resolver.nsas</quote>. If
  1449. there is no entry in Logging for a particular library,
  1450. it will use the configuration given for the module.
  1451. <!-- TODO: how to know these specific names?
  1452. We will either have to document them or tell the administrator to
  1453. specify module-wide logging and see what appears...
  1454. -->
  1455. </para>
  1456. <para>
  1457. <!-- TODO: severity has not been covered yet -->
  1458. To illustrate this, suppose you want the cache library
  1459. to log messages of severity DEBUG, and the rest of the
  1460. resolver code to log messages of severity INFO. To achieve
  1461. this you specify two loggers, one with the name
  1462. <quote>Resolver</quote> and severity INFO, and one with
  1463. the name <quote>Resolver.cache</quote> with severity
  1464. DEBUG. As there are no entries for other libraries (e.g.
  1465. the nsas), they will use the configuration for the module
  1466. (<quote>Resolver</quote>), so giving the desired behavior.
  1467. </para>
  1468. <para>
  1469. One special case is that of a module name of <quote>*</quote>
  1470. (asterisks), which is interpreted as <emphasis>any</emphasis>
  1471. module. You can set global logging options by using this,
  1472. including setting the logging configuration for a library
  1473. that is used by multiple modules (e.g. <quote>*.config</quote>
  1474. specifies the configuration library code in whatever
  1475. module is using it).
  1476. </para>
  1477. <para>
  1478. If there are multiple logger specifications in the
  1479. configuration that might match a particular logger, the
  1480. specification with the more specific logger name takes
  1481. precedence. For example, if there are entries for for
  1482. both <quote>*</quote> and <quote>Resolver</quote>, the
  1483. resolver module &mdash; and all libraries it uses &mdash;
  1484. will log messages according to the configuration in the
  1485. second entry (<quote>Resolver</quote>). All other modules
  1486. will use the configuration of the first entry
  1487. (<quote>*</quote>). If there was also a configuration
  1488. entry for <quote>Resolver.cache</quote>, the cache library
  1489. within the resolver would use that in preference to the
  1490. entry for <quote>Resolver</quote>.
  1491. </para>
  1492. <para>
  1493. One final note about the naming. When specifying the
  1494. module name within a logger, use the name of the module
  1495. as specified in <command>bindctl</command>, e.g.
  1496. <quote>Resolver</quote> for the resolver module,
  1497. <quote>Xfrout</quote> for the xfrout module, etc. When
  1498. the message is logged, the message will include the name
  1499. of the logger generating the message, but with the module
  1500. name replaced by the name of the process implementing
  1501. the module (so for example, a message generated by the
  1502. <quote>Auth.cache</quote> logger will appear in the output
  1503. with a logger name of <quote>b10-auth.cache</quote>).
  1504. </para>
  1505. </section>
  1506. <section>
  1507. <title>severity (string)</title>
  1508. <para>
  1509. This specifies the category of messages logged.
  1510. Each message is logged with an associated severity which
  1511. may be one of the following (in descending order of
  1512. severity):
  1513. </para>
  1514. <itemizedlist>
  1515. <listitem>
  1516. <simpara> FATAL </simpara>
  1517. </listitem>
  1518. <listitem>
  1519. <simpara> ERROR </simpara>
  1520. </listitem>
  1521. <listitem>
  1522. <simpara> WARN </simpara>
  1523. </listitem>
  1524. <listitem>
  1525. <simpara> INFO </simpara>
  1526. </listitem>
  1527. <listitem>
  1528. <simpara> DEBUG </simpara>
  1529. </listitem>
  1530. </itemizedlist>
  1531. <para>
  1532. When the severity of a logger is set to one of these
  1533. values, it will only log messages of that severity, and
  1534. the severities above it. The severity may also be set to
  1535. NONE, in which case all messages from that logger are
  1536. inhibited.
  1537. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  1538. </para>
  1539. </section>
  1540. <section>
  1541. <title>output_options (list)</title>
  1542. <para>
  1543. Each logger can have zero or more
  1544. <option>output_options</option>. These specify where log
  1545. messages are sent to. These are explained in detail below.
  1546. </para>
  1547. <para>
  1548. The other options for a logger are:
  1549. </para>
  1550. </section>
  1551. <section>
  1552. <title>debuglevel (integer)</title>
  1553. <para>
  1554. When a logger's severity is set to DEBUG, this value
  1555. specifies what debug messages should be printed. It ranges
  1556. from 0 (least verbose) to 99 (most verbose).
  1557. </para>
  1558. <!-- TODO: complete this sentence:
  1559. The general classification of debug message types is
  1560. TODO; there's a ticket to determine these levels, see #1074
  1561. -->
  1562. <para>
  1563. If severity for the logger is not DEBUG, this value is ignored.
  1564. </para>
  1565. </section>
  1566. <section>
  1567. <title>additive (true or false)</title>
  1568. <para>
  1569. If this is true, the <option>output_options</option> from
  1570. the parent will be used. For example, if there are two
  1571. loggers configured; <quote>Resolver</quote> and
  1572. <quote>Resolver.cache</quote>, and <option>additive</option>
  1573. is true in the second, it will write the log messages
  1574. not only to the destinations specified for
  1575. <quote>Resolver.cache</quote>, but also to the destinations
  1576. as specified in the <option>output_options</option> in
  1577. the logger named <quote>Resolver</quote>.
  1578. <!-- TODO: check this -->
  1579. </para>
  1580. </section>
  1581. </section>
  1582. <section>
  1583. <title>Output Options</title>
  1584. <para>
  1585. The main settings for an output option are the
  1586. <option>destination</option> and a value called
  1587. <option>output</option>, the meaning of which depends on
  1588. the destination that is set.
  1589. </para>
  1590. <section>
  1591. <title>destination (string)</title>
  1592. <para>
  1593. The destination is the type of output. It can be one of:
  1594. </para>
  1595. <itemizedlist>
  1596. <listitem>
  1597. <simpara> console </simpara>
  1598. </listitem>
  1599. <listitem>
  1600. <simpara> file </simpara>
  1601. </listitem>
  1602. <listitem>
  1603. <simpara> syslog </simpara>
  1604. </listitem>
  1605. </itemizedlist>
  1606. </section>
  1607. <section>
  1608. <title>output (string)</title>
  1609. <para>
  1610. Depending on what is set as the output destination, this
  1611. value is interpreted as follows:
  1612. </para>
  1613. <variablelist>
  1614. <varlistentry>
  1615. <term><option>destination</option> is <quote>console</quote></term>
  1616. <listitem>
  1617. <simpara>
  1618. The value of output must be one of <quote>stdout</quote>
  1619. (messages printed to standard output) or
  1620. <quote>stderr</quote> (messages printed to standard
  1621. error).
  1622. </simpara>
  1623. </listitem>
  1624. </varlistentry>
  1625. <varlistentry>
  1626. <term><option>destination</option> is <quote>file</quote></term>
  1627. <listitem>
  1628. <simpara>
  1629. The value of output is interpreted as a file name;
  1630. log messages will be appended to this file.
  1631. </simpara>
  1632. </listitem>
  1633. </varlistentry>
  1634. <varlistentry>
  1635. <term><option>destination</option> is <quote>syslog</quote></term>
  1636. <listitem>
  1637. <simpara>
  1638. The value of output is interpreted as the
  1639. <command>syslog</command> facility (e.g.
  1640. <emphasis>local0</emphasis>) that should be used
  1641. for log messages.
  1642. </simpara>
  1643. </listitem>
  1644. </varlistentry>
  1645. </variablelist>
  1646. <para>
  1647. The other options for <option>output_options</option> are:
  1648. </para>
  1649. <section>
  1650. <title>flush (true of false)</title>
  1651. <para>
  1652. Flush buffers after each log message. Doing this will
  1653. reduce performance but will ensure that if the program
  1654. terminates abnormally, all messages up to the point of
  1655. termination are output.
  1656. </para>
  1657. </section>
  1658. <section>
  1659. <title>maxsize (integer)</title>
  1660. <para>
  1661. Only relevant when destination is file, this is maximum
  1662. file size of output files in bytes. When the maximum
  1663. size is reached, the file is renamed and a new file opened.
  1664. (For example, a ".1" is appended to the name &mdash;
  1665. if a ".1" file exists, it is renamed ".2",
  1666. etc.)
  1667. </para>
  1668. <para>
  1669. If this is 0, no maximum file size is used.
  1670. </para>
  1671. </section>
  1672. <section>
  1673. <title>maxver (integer)</title>
  1674. <para>
  1675. Maximum number of old log files to keep around when
  1676. rolling the output file. Only relevant when
  1677. <option>destination</option> is <quote>file</quote>.
  1678. </para>
  1679. </section>
  1680. </section>
  1681. </section>
  1682. <section>
  1683. <title>Example session</title>
  1684. <para>
  1685. In this example we want to set the global logging to
  1686. write to the file <filename>/var/log/my_bind10.log</filename>,
  1687. at severity WARN. We want the authoritative server to
  1688. log at DEBUG with debuglevel 40, to a different file
  1689. (<filename>/tmp/debug_messages</filename>).
  1690. </para>
  1691. <para>
  1692. Start <command>bindctl</command>.
  1693. </para>
  1694. <para>
  1695. <screen>["login success "]
  1696. &gt; <userinput>config show Logging</userinput>
  1697. Logging/loggers [] list
  1698. </screen>
  1699. </para>
  1700. <para>
  1701. By default, no specific loggers are configured, in which
  1702. case the severity defaults to INFO and the output is
  1703. written to stderr.
  1704. </para>
  1705. <para>
  1706. Let's first add a default logger:
  1707. </para>
  1708. <!-- TODO: adding the empty loggers makes no sense -->
  1709. <para>
  1710. <screen><userinput>&gt; config add Logging/loggers</userinput>
  1711. &gt; <userinput>config show Logging</userinput>
  1712. Logging/loggers/ list (modified)
  1713. </screen>
  1714. </para>
  1715. <para>
  1716. The loggers value line changed to indicate that it is no
  1717. longer an empty list:
  1718. </para>
  1719. <para>
  1720. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  1721. Logging/loggers[0]/name "" string (default)
  1722. Logging/loggers[0]/severity "INFO" string (default)
  1723. Logging/loggers[0]/debuglevel 0 integer (default)
  1724. Logging/loggers[0]/additive false boolean (default)
  1725. Logging/loggers[0]/output_options [] list (default)
  1726. </screen>
  1727. </para>
  1728. <para>
  1729. The name is mandatory, so we must set it. We will also
  1730. change the severity as well. Let's start with the global
  1731. logger.
  1732. </para>
  1733. <para>
  1734. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  1735. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  1736. &gt; <userinput>config show Logging/loggers</userinput>
  1737. Logging/loggers[0]/name "*" string (modified)
  1738. Logging/loggers[0]/severity "WARN" string (modified)
  1739. Logging/loggers[0]/debuglevel 0 integer (default)
  1740. Logging/loggers[0]/additive false boolean (default)
  1741. Logging/loggers[0]/output_options [] list (default)
  1742. </screen>
  1743. </para>
  1744. <para>
  1745. Of course, we need to specify where we want the log
  1746. messages to go, so we add an entry for an output option.
  1747. </para>
  1748. <para>
  1749. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  1750. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  1751. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  1752. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  1753. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1754. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  1755. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  1756. </screen>
  1757. </para>
  1758. <para>
  1759. These aren't the values we are looking for.
  1760. </para>
  1761. <para>
  1762. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  1763. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  1764. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 30000</userinput>
  1765. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  1766. </screen>
  1767. </para>
  1768. <para>
  1769. Which would make the entire configuration for this logger
  1770. look like:
  1771. </para>
  1772. <para>
  1773. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  1774. Logging/loggers[0]/name "*" string (modified)
  1775. Logging/loggers[0]/severity "WARN" string (modified)
  1776. Logging/loggers[0]/debuglevel 0 integer (default)
  1777. Logging/loggers[0]/additive false boolean (default)
  1778. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  1779. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  1780. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1781. Logging/loggers[0]/output_options[0]/maxsize 30000 integer (modified)
  1782. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  1783. </screen>
  1784. </para>
  1785. <para>
  1786. That looks OK, so let's commit it before we add the
  1787. configuration for the authoritative server's logger.
  1788. </para>
  1789. <para>
  1790. <screen>&gt; <userinput> config commit</userinput></screen>
  1791. </para>
  1792. <para>
  1793. Now that we have set it, and checked each value along
  1794. the way, adding a second entry is quite similar.
  1795. </para>
  1796. <para>
  1797. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  1798. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  1799. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  1800. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  1801. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  1802. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  1803. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  1804. &gt; <userinput> config commit</userinput>
  1805. </screen>
  1806. </para>
  1807. <para>
  1808. And that's it. Once we have found whatever it was we
  1809. needed the debug messages for, we can simply remove the
  1810. second logger to let the authoritative server use the
  1811. same settings as the rest.
  1812. </para>
  1813. <para>
  1814. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  1815. &gt; <userinput> config commit</userinput>
  1816. </screen>
  1817. </para>
  1818. <para>
  1819. And every module will now be using the values from the
  1820. logger named <quote>*</quote>.
  1821. </para>
  1822. </section>
  1823. </section>
  1824. <section>
  1825. <title>Logging Message Format</title>
  1826. <para>
  1827. Each message written by BIND 10 to the configured logging
  1828. destinations comprises a number of components that identify
  1829. the origin of the message and, if the message indicates
  1830. a problem, information about the problem that may be
  1831. useful in fixing it.
  1832. </para>
  1833. <para>
  1834. Consider the message below logged to a file:
  1835. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  1836. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  1837. </para>
  1838. <para>
  1839. Note: the layout of messages written to the system logging
  1840. file (syslog) may be slightly different. This message has
  1841. been split across two lines here for display reasons; in the
  1842. logging file, it will appear on one line.)
  1843. </para>
  1844. <para>
  1845. The log message comprises a number of components:
  1846. <variablelist>
  1847. <varlistentry>
  1848. <term>2011-06-15 13:48:22.034</term>
  1849. <!-- TODO: timestamp repeated even if using syslog? -->
  1850. <listitem><para>
  1851. The date and time at which the message was generated.
  1852. </para></listitem>
  1853. </varlistentry>
  1854. <varlistentry>
  1855. <term>ERROR</term>
  1856. <listitem><para>
  1857. The severity of the message.
  1858. </para></listitem>
  1859. </varlistentry>
  1860. <varlistentry>
  1861. <term>[b10-resolver.asiolink]</term>
  1862. <listitem><para>
  1863. The source of the message. This comprises two components:
  1864. the BIND 10 process generating the message (in this
  1865. case, <command>b10-resolver</command>) and the module
  1866. within the program from which the message originated
  1867. (which in the example is the asynchronous I/O link
  1868. module, asiolink).
  1869. </para></listitem>
  1870. </varlistentry>
  1871. <varlistentry>
  1872. <term>ASIODNS_OPENSOCK</term>
  1873. <listitem><para>
  1874. The message identification. Every message in BIND 10
  1875. has a unique identification, which can be used as an
  1876. index into the <ulink
  1877. url="bind10-messages.html"><citetitle>BIND 10 Messages
  1878. Manual</citetitle></ulink> (<ulink
  1879. url="http://bind10.isc.org/docs/bind10-messages.html"
  1880. />) from which more information can be obtained.
  1881. </para></listitem>
  1882. </varlistentry>
  1883. <varlistentry>
  1884. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  1885. <listitem><para>
  1886. A brief description of the cause of the problem.
  1887. Within this text, information relating to the condition
  1888. that caused the message to be logged will be included.
  1889. In this example, error number 111 (an operating
  1890. system-specific error number) was encountered when
  1891. trying to open a TCP connection to port 53 on the
  1892. local system (address 127.0.0.1). The next step
  1893. would be to find out the reason for the failure by
  1894. consulting your system's documentation to identify
  1895. what error number 111 means.
  1896. </para></listitem>
  1897. </varlistentry>
  1898. </variablelist>
  1899. </para>
  1900. </section>
  1901. </chapter>
  1902. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  1903. <!-- <index> <title>Index</title> </index> -->
  1904. </book>
  1905. <!--
  1906. TODO:
  1907. Overview
  1908. Getting BIND 10 Installed
  1909. Basics
  1910. Dependencies
  1911. Optional
  1912. Advanced
  1913. How Does Everything Work Together?
  1914. Need Help?
  1915. -->