bind10-guide.xml 109 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226
  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-2012 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-2012</year><holder>Internet Systems Consortium, Inc.</holder>
  30. </copyright>
  31. <abstract>
  32. <para>BIND 10 is a framework that features Domain Name System
  33. (DNS) suite and Dynamic Host Configuration Protocol (DHCP)
  34. servers managed by Internet Systems Consortium (ISC). It
  35. includes DNS libraries, modular components for controlling
  36. authoritative and recursive DNS servers, and experimental DHCPv4
  37. and DHCPv6 servers.
  38. </para>
  39. <para>
  40. This is the reference guide for BIND 10 version &__VERSION__;.
  41. The most up-to-date version of this document (in PDF, HTML,
  42. and plain text formats), along with other documents for
  43. BIND 10, can be found at <ulink url="http://bind10.isc.org/docs"/>.
  44. </para> </abstract>
  45. <releaseinfo>This is the reference guide for BIND 10 version
  46. &__VERSION__;.</releaseinfo>
  47. </bookinfo>
  48. <preface>
  49. <title>Preface</title>
  50. <section id="acknowledgements">
  51. <title>Acknowledgements</title>
  52. <para>ISC would like to acknowledge generous support for
  53. BIND 10 development of DHCPv4 and DHCPv6 components provided
  54. by <ulink url="http://www.comcast.com/">Comcast</ulink>.</para>
  55. </section>
  56. </preface>
  57. <chapter id="intro">
  58. <title>Introduction</title>
  59. <para>
  60. BIND is the popular implementation of a DNS server, developer
  61. interfaces, and DNS tools.
  62. BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++ and Python
  63. and provides a modular environment for serving and maintaining DNS.
  64. BIND 10 provides a EDNS0- and DNSSEC-capable authoritative
  65. DNS server and a caching recursive name server which also
  66. provides forwarding.
  67. </para>
  68. <para>
  69. This guide covers the experimental prototype of
  70. BIND 10 version &__VERSION__;.
  71. </para>
  72. <section>
  73. <title>Supported Platforms</title>
  74. <para>
  75. BIND 10 builds have been tested on Debian GNU/Linux 5 and unstable,
  76. Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7 and 8, CentOS
  77. Linux 5.3, and MacOS 10.6.
  78. It has been tested on Sparc, i386, and amd64 hardware
  79. platforms.
  80. It is planned for BIND 10 to build, install and run on
  81. Windows and standard Unix-type platforms.
  82. </para>
  83. </section>
  84. <section id="required-software">
  85. <title>Required Software</title>
  86. <para>
  87. BIND 10 requires at least Python 3.1
  88. (<ulink url="http://www.python.org/"/>).
  89. It has also been tested with Python 3.2.
  90. </para>
  91. <para>
  92. BIND 10 uses the Botan crypto library for C++
  93. (<ulink url="http://botan.randombit.net/"/>).
  94. It requires at least Botan version 1.8.
  95. </para>
  96. <para>
  97. BIND 10 uses the log4cplus C++ logging library
  98. (<ulink url="http://log4cplus.sourceforge.net/"/>).
  99. It requires at least log4cplus version 1.0.3.
  100. </para>
  101. <para>
  102. The authoritative DNS server uses SQLite3
  103. (<ulink url="http://www.sqlite.org/"/>).
  104. <!-- TODO: is this still required? -->
  105. It needs at least SQLite version 3.3.9.
  106. </para>
  107. <para>
  108. The <command>b10-xfrin</command>, <command>b10-xfrout</command>,
  109. and <command>b10-zonemgr</command> components require the
  110. libpython3 library and the Python _sqlite3.so module
  111. (which is included with Python).
  112. The Python module needs to be built for the corresponding Python 3.
  113. </para>
  114. <!-- TODO: this will change ... -->
  115. <note>
  116. <para>
  117. Some operating systems do not provide these dependencies
  118. in their default installation nor standard packages
  119. collections.
  120. You may need to install them separately.
  121. </para>
  122. </note>
  123. </section>
  124. <section id="starting_stopping">
  125. <title>Starting and Stopping the Server</title>
  126. <para>
  127. BIND 10 is modular. Part of this modularity is
  128. accomplished using multiple cooperating processes which, together,
  129. provide the server functionality. This is a change from
  130. the previous generation of BIND software, which used a
  131. single process.
  132. </para>
  133. <para>
  134. At first, running many different processes may seem confusing.
  135. However, these processes are started, stopped, and maintained
  136. by a single command, <command>bind10</command>.
  137. This command starts a master process which will start other
  138. processes as needed.
  139. The processes started by the <command>bind10</command>
  140. command have names starting with "b10-", including:
  141. </para>
  142. <para>
  143. <itemizedlist>
  144. <listitem>
  145. <simpara>
  146. <command>b10-auth</command> &mdash;
  147. Authoritative DNS server.
  148. This process serves DNS requests.
  149. </simpara>
  150. </listitem>
  151. <listitem>
  152. <simpara>
  153. <command>b10-cfgmgr</command> &mdash;
  154. Configuration manager.
  155. This process maintains all of the configuration for BIND 10.
  156. </simpara>
  157. </listitem>
  158. <listitem>
  159. <simpara>
  160. <command>b10-cmdctl</command> &mdash;
  161. Command and control service.
  162. This process allows external control of the BIND 10 system.
  163. </simpara>
  164. </listitem>
  165. <listitem>
  166. <simpara>
  167. <command>b10-msgq</command> &mdash;
  168. Message bus daemon.
  169. This process coordinates communication between all of the other
  170. BIND 10 processes.
  171. </simpara>
  172. </listitem>
  173. <listitem>
  174. <simpara>
  175. <command>b10-resolver</command> &mdash;
  176. Recursive name server.
  177. This process handles incoming queries.
  178. <!-- TODO: -->
  179. </simpara>
  180. </listitem>
  181. <listitem>
  182. <simpara>
  183. <command>b10-sockcreator</command> &mdash;
  184. Socket creator daemon.
  185. This process creates sockets used by
  186. network-listening BIND 10 processes.
  187. </simpara>
  188. </listitem>
  189. <listitem>
  190. <simpara>
  191. <command>b10-stats</command> &mdash;
  192. Statistics collection daemon.
  193. This process collects and reports statistics data.
  194. </simpara>
  195. </listitem>
  196. <listitem>
  197. <simpara>
  198. <command>b10-stats-httpd</command> &mdash;
  199. HTTP server for statistics reporting.
  200. This process reports statistics data in XML format over HTTP.
  201. </simpara>
  202. </listitem>
  203. <listitem>
  204. <simpara>
  205. <command>b10-xfrin</command> &mdash;
  206. Incoming zone transfer service.
  207. This process is used to transfer a new copy
  208. of a zone into BIND 10, when acting as a secondary server.
  209. </simpara>
  210. </listitem>
  211. <listitem>
  212. <simpara>
  213. <command>b10-xfrout</command> &mdash;
  214. Outgoing zone transfer service.
  215. This process is used to handle transfer requests to
  216. send a local zone to a remote secondary server,
  217. when acting as a master server.
  218. </simpara>
  219. </listitem>
  220. <listitem>
  221. <simpara>
  222. <command>b10-zonemgr</command> &mdash;
  223. Secondary manager.
  224. This process keeps track of timers and other
  225. necessary information for BIND 10 to act as a slave server.
  226. </simpara>
  227. </listitem>
  228. </itemizedlist>
  229. </para>
  230. <para>
  231. These are ran automatically by <command>bind10</command>
  232. and do not need to be run manually.
  233. </para>
  234. </section>
  235. <section id="managing_once_running">
  236. <title>Managing BIND 10</title>
  237. <para>
  238. Once BIND 10 is running, a few commands are used to interact
  239. directly with the system:
  240. <itemizedlist>
  241. <listitem>
  242. <simpara>
  243. <command>bindctl</command> &mdash;
  244. interactive administration interface.
  245. This is a low-level command-line tool which allows
  246. a developer or an experienced administrator to control
  247. BIND 10.
  248. </simpara>
  249. </listitem>
  250. <listitem>
  251. <simpara>
  252. <command>b10-loadzone</command> &mdash;
  253. zone file loader.
  254. This tool will load standard masterfile-format zone files into
  255. BIND 10.
  256. </simpara>
  257. </listitem>
  258. <listitem>
  259. <simpara>
  260. <command>b10-cmdctl-usermgr</command> &mdash;
  261. user access control.
  262. This tool allows an administrator to authorize additional users
  263. to manage BIND 10.
  264. </simpara>
  265. </listitem>
  266. <!-- TODO usermgr -->
  267. </itemizedlist>
  268. </para>
  269. </section>
  270. <para>
  271. The tools and modules are covered in full detail in this guide.
  272. <!-- TODO point to these -->
  273. In addition, manual pages are also provided in the default installation.
  274. </para>
  275. <!--
  276. bin/
  277. bindctl*
  278. host*
  279. lib/
  280. libauth
  281. libdns
  282. libexceptions
  283. python3.1/site-packages/isc/{cc,config}
  284. sbin/
  285. bind10
  286. share/
  287. share/bind10/
  288. auth.spec
  289. b10-cmdctl.pem
  290. bob.spec
  291. passwd.csv
  292. man/
  293. var/
  294. bind10/b10-config.db
  295. -->
  296. <para>
  297. BIND 10 also provides libraries and programmer interfaces
  298. for C++ and Python for the message bus, configuration backend,
  299. and, of course, DNS. These include detailed developer
  300. documentation and code examples.
  301. <!-- TODO point to this -->
  302. </para>
  303. </chapter>
  304. <chapter id="installation">
  305. <title>Installation</title>
  306. <section id="build-requirements">
  307. <title>Building Requirements</title>
  308. <para>
  309. In addition to the run-time requirements, building BIND 10
  310. from source code requires various development include headers.
  311. </para>
  312. <note>
  313. <simpara>
  314. Some operating systems have split their distribution packages into
  315. a run-time and a development package. You will need to install
  316. the development package versions, which include header files and
  317. libraries, to build BIND 10 from source code.
  318. </simpara>
  319. </note>
  320. <para>
  321. Building from source code requires the Boost
  322. build-time headers
  323. (<ulink url="http://www.boost.org/"/>).
  324. At least Boost version 1.35 is required.
  325. <!-- TODO: we don't check for this version -->
  326. <!-- NOTE: jreed has tested with 1.34, 1.38, and 1.41. -->
  327. </para>
  328. <para>
  329. To build BIND 10, also install the Botan (at least version
  330. 1.8) and the log4cplus (at least version 1.0.3)
  331. development include headers.
  332. </para>
  333. <!--
  334. TODO
  335. Debian and Ubuntu:
  336. libgmp3-dev and libbz2-dev required for botan too
  337. -->
  338. <!-- NOTE: _sqlite3 is only needed at test time; it is already listed
  339. as a dependency earlier -->
  340. <para>
  341. Building BIND 10 also requires a C++ compiler and
  342. standard development headers, make, and pkg-config.
  343. BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
  344. 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10.
  345. </para>
  346. <para>
  347. Visit the wiki at <ulink
  348. url="http://bind10.isc.org/wiki/SystemSpecificNotes" />
  349. for system-specific installation tips.
  350. </para>
  351. </section>
  352. <section id="quickstart">
  353. <title>Quick start</title>
  354. <note>
  355. <simpara>
  356. This quickly covers the standard steps for installing
  357. and deploying BIND 10 as an authoritative name server using
  358. its defaults. For troubleshooting, full customizations and further
  359. details, see the respective chapters in the BIND 10 guide.
  360. </simpara>
  361. </note>
  362. <para>
  363. To quickly get started with BIND 10, follow these steps.
  364. </para>
  365. <orderedlist>
  366. <listitem>
  367. <simpara>
  368. Install required run-time and build dependencies.
  369. </simpara>
  370. </listitem>
  371. <listitem>
  372. <simpara>
  373. Download the BIND 10 source tar file from
  374. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  375. </simpara>
  376. </listitem>
  377. <listitem>
  378. <para>Extract the tar file:
  379. <screen>$ <userinput>gzcat bind10-<replaceable>VERSION</replaceable>.tar.gz | tar -xvf -</userinput></screen>
  380. </para>
  381. </listitem>
  382. <listitem>
  383. <para>Go into the source and run configure:
  384. <screen>$ <userinput>cd bind10-<replaceable>VERSION</replaceable></userinput>
  385. $ <userinput>./configure</userinput></screen>
  386. </para>
  387. </listitem>
  388. <listitem>
  389. <para>Build it:
  390. <screen>$ <userinput>make</userinput></screen>
  391. </para>
  392. </listitem>
  393. <listitem>
  394. <para>Install it (to default /usr/local):
  395. <screen>$ <userinput>make install</userinput></screen>
  396. </para>
  397. </listitem>
  398. <listitem>
  399. <para>Start the server:
  400. <screen>$ <userinput>/usr/local/sbin/bind10</userinput></screen>
  401. </para>
  402. </listitem>
  403. <listitem>
  404. <para>Test it; for example:
  405. <screen>$ <userinput>dig @127.0.0.1 -c CH -t TXT authors.bind</userinput></screen>
  406. </para>
  407. </listitem>
  408. <listitem>
  409. <para>Load desired zone file(s), for example:
  410. <screen>$ <userinput>b10-loadzone <replaceable>your.zone.example.org</replaceable></userinput></screen>
  411. </para>
  412. </listitem>
  413. <listitem>
  414. <simpara>
  415. Test the new zone.
  416. </simpara>
  417. </listitem>
  418. </orderedlist>
  419. </section>
  420. <section id="install">
  421. <title>Installation from source</title>
  422. <para>
  423. BIND 10 is open source software written in C++ and Python.
  424. It is freely available in source code form from ISC via
  425. the Git code revision control system or as a downloadable
  426. tar file. It may also be available in pre-compiled ready-to-use
  427. packages from operating system vendors.
  428. </para>
  429. <section>
  430. <title>Download Tar File</title>
  431. <para>
  432. Downloading a release tar file is the recommended method to
  433. obtain the source code.
  434. </para>
  435. <para>
  436. The BIND 10 releases are available as tar file downloads from
  437. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  438. Periodic development snapshots may also be available.
  439. </para>
  440. <!-- TODO -->
  441. </section>
  442. <section>
  443. <title>Retrieve from Git</title>
  444. <para>
  445. Downloading this "bleeding edge" code is recommended only for
  446. developers or advanced users. Using development code in a production
  447. environment is not recommended.
  448. </para>
  449. <note>
  450. <para>
  451. When using source code retrieved via Git additional
  452. software will be required: automake (v1.11 or newer),
  453. libtoolize, and autoconf (2.59 or newer).
  454. These may need to be installed.
  455. </para>
  456. </note>
  457. <para>
  458. The latest development code, including temporary experiments
  459. and un-reviewed code, is available via the BIND 10 code revision
  460. control system. This is powered by Git and all the BIND 10
  461. development is public.
  462. The leading development is done in the <quote>master</quote>.
  463. </para>
  464. <para>
  465. The code can be checked out from
  466. <filename>git://git.bind10.isc.org/bind10</filename>;
  467. for example:
  468. <screen>$ <userinput>git clone git://git.bind10.isc.org/bind10</userinput></screen>
  469. </para>
  470. <para>
  471. When checking out the code from
  472. the code version control system, it doesn't include the
  473. generated configure script, Makefile.in files, nor the
  474. related configure files.
  475. They can be created by running <command>autoreconf</command>
  476. with the <option>--install</option> switch.
  477. This will run <command>autoconf</command>,
  478. <command>aclocal</command>,
  479. <command>libtoolize</command>,
  480. <command>autoheader</command>,
  481. <command>automake</command>,
  482. and related commands.
  483. </para>
  484. </section>
  485. <section>
  486. <title>Configure before the build</title>
  487. <para>
  488. BIND 10 uses the GNU Build System to discover build environment
  489. details.
  490. To generate the makefiles using the defaults, simply run:
  491. <screen>$ <userinput>./configure</userinput></screen>
  492. </para>
  493. <para>
  494. Run <command>./configure</command> with the <option>--help</option>
  495. switch to view the different options. The commonly-used options are:
  496. <variablelist>
  497. <varlistentry>
  498. <term>--prefix</term>
  499. <listitem>
  500. <simpara>Define the installation location (the
  501. default is <filename>/usr/local/</filename>).
  502. </simpara>
  503. </listitem>
  504. </varlistentry>
  505. <varlistentry>
  506. <term>--with-boost-include</term>
  507. <listitem>
  508. <simpara>Define the path to find the Boost headers.
  509. </simpara>
  510. </listitem>
  511. </varlistentry>
  512. <varlistentry>
  513. <term>--with-pythonpath</term>
  514. <listitem>
  515. <simpara>Define the path to Python 3.1 if it is not in the
  516. standard execution path.
  517. </simpara>
  518. </listitem>
  519. </varlistentry>
  520. <varlistentry>
  521. <term>--with-gtest</term>
  522. <listitem>
  523. <simpara>Enable building the C++ Unit Tests using the
  524. Google Tests framework. Optionally this can define the
  525. path to the gtest header files and library.
  526. </simpara>
  527. </listitem>
  528. </varlistentry>
  529. </variablelist>
  530. </para>
  531. <!-- TODO: lcov -->
  532. <para>
  533. For example, the following configures it to
  534. find the Boost headers, find the
  535. Python interpreter, and sets the installation location:
  536. <screen>$ <userinput>./configure \
  537. --with-boost-include=/usr/pkg/include \
  538. --with-pythonpath=/usr/pkg/bin/python3.1 \
  539. --prefix=/opt/bind10</userinput></screen>
  540. </para>
  541. <para>
  542. If the configure fails, it may be due to missing or old
  543. dependencies.
  544. </para>
  545. </section>
  546. <section>
  547. <title>Build</title>
  548. <para>
  549. After the configure step is complete, to build the executables
  550. from the C++ code and prepare the Python scripts, run:
  551. <screen>$ <userinput>make</userinput></screen>
  552. </para>
  553. </section>
  554. <section>
  555. <title>Install</title>
  556. <para>
  557. To install the BIND 10 executables, support files,
  558. and documentation, run:
  559. <screen>$ <userinput>make install</userinput></screen>
  560. </para>
  561. <note>
  562. <para>The install step may require superuser privileges.</para>
  563. </note>
  564. </section>
  565. <!-- TODO: tests -->
  566. <section>
  567. <title>Install Hierarchy</title>
  568. <para>
  569. The following is the layout of the complete BIND 10 installation:
  570. <itemizedlist>
  571. <listitem>
  572. <simpara>
  573. <filename>bin/</filename> &mdash;
  574. general tools and diagnostic clients.
  575. </simpara>
  576. </listitem>
  577. <listitem>
  578. <simpara>
  579. <filename>etc/bind10-devel/</filename> &mdash;
  580. configuration files.
  581. </simpara>
  582. </listitem>
  583. <listitem>
  584. <simpara>
  585. <filename>lib/</filename> &mdash;
  586. libraries and python modules.
  587. </simpara>
  588. </listitem>
  589. <listitem>
  590. <simpara>
  591. <filename>libexec/bind10-devel/</filename> &mdash;
  592. executables that a user wouldn't normally run directly and
  593. are not run independently.
  594. These are the BIND 10 modules which are daemons started by
  595. the <command>bind10</command> tool.
  596. </simpara>
  597. </listitem>
  598. <listitem>
  599. <simpara>
  600. <filename>sbin/</filename> &mdash;
  601. commands used by the system administrator.
  602. </simpara>
  603. </listitem>
  604. <listitem>
  605. <simpara>
  606. <filename>share/bind10-devel/</filename> &mdash;
  607. configuration specifications.
  608. </simpara>
  609. </listitem>
  610. <listitem>
  611. <simpara>
  612. <filename>share/man/</filename> &mdash;
  613. manual pages (online documentation).
  614. </simpara>
  615. </listitem>
  616. <listitem>
  617. <simpara>
  618. <filename>var/bind10-devel/</filename> &mdash;
  619. data source and configuration databases.
  620. </simpara>
  621. </listitem>
  622. </itemizedlist>
  623. </para>
  624. </section>
  625. </section>
  626. <!--
  627. <section id="install.troubleshooting">
  628. <title>Troubleshooting</title>
  629. <para>
  630. </para>
  631. </section>
  632. -->
  633. </chapter>
  634. <chapter id="bind10">
  635. <title>Starting BIND10 with <command>bind10</command></title>
  636. <para>
  637. BIND 10 provides the <command>bind10</command> command which
  638. starts up the required processes.
  639. <command>bind10</command>
  640. will also restart some processes that exit unexpectedly.
  641. This is the only command needed to start the BIND 10 system.
  642. </para>
  643. <para>
  644. After starting the <command>b10-msgq</command> communications channel,
  645. <command>bind10</command> connects to it,
  646. runs the configuration manager, and reads its own configuration.
  647. Then it starts the other modules.
  648. </para>
  649. <para>
  650. The <command>b10-sockcreator</command>, <command>b10-msgq</command> and
  651. <command>b10-cfgmgr</command>
  652. services make up the core. The <command>b10-msgq</command> daemon
  653. provides the communication channel between every part of the system.
  654. The <command>b10-cfgmgr</command> daemon is always needed by every
  655. module, if only to send information about themselves somewhere,
  656. but more importantly to ask about their own settings, and
  657. about other modules. The <command>b10-sockcreator</command> will
  658. allocate sockets for the rest of the system.
  659. </para>
  660. <para>
  661. In its default configuration, the <command>bind10</command>
  662. master process will also start up
  663. <command>b10-cmdctl</command> for administration tools to
  664. communicate with the system,
  665. <command>b10-stats</command> for statistics collection, and
  666. <command>b10-stats-httpd</command> for statistics reporting.
  667. </para>
  668. <section id="start">
  669. <title>Starting BIND 10</title>
  670. <para>
  671. To start the BIND 10 service, simply run <command>bind10</command>.
  672. Run it with the <option>--verbose</option> switch to
  673. get additional debugging or diagnostic output.
  674. </para>
  675. <!-- TODO: note it doesn't go into background -->
  676. <note>
  677. <para>
  678. If the setproctitle Python module is detected at start up,
  679. the process names for the Python-based daemons will be renamed
  680. to better identify them instead of just <quote>python</quote>.
  681. This is not needed on some operating systems.
  682. </para>
  683. </note>
  684. </section>
  685. <section id="bind10.config">
  686. <title>Configuration of started processes</title>
  687. <para>
  688. The processes to be started can be configured, with the exception
  689. of the <command>b10-sockcreator</command>, <command>b10-msgq</command>
  690. and <command>b10-cfgmgr</command>.
  691. </para>
  692. <para>
  693. The configuration is in the Boss/components section. Each element
  694. represents one component, which is an abstraction of a process
  695. (currently there's also one component which doesn't represent
  696. a process).
  697. </para>
  698. <para>
  699. To add a process to the set, let's say the resolver (which not started
  700. by default), you would do this:
  701. <screen>&gt; <userinput>config add Boss/components b10-resolver</userinput>
  702. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  703. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  704. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  705. &gt; <userinput>config commit</userinput></screen></para>
  706. <para>
  707. Now, what it means. We add an entry called b10-resolver. It is both a
  708. name used to reference this component in the configuration and the
  709. name of the process to start. Then we set some parameters on how to
  710. start it.
  711. </para>
  712. <para>
  713. The special one is for components that need some kind of special care
  714. during startup or shutdown. Unless specified, the component is started
  715. in usual way. This is the list of components that need to be started
  716. in a special way, with the value of special used for them:
  717. <table>
  718. <tgroup cols='3' align='left'>
  719. <colspec colname='component'/>
  720. <colspec colname='special'/>
  721. <colspec colname='description'/>
  722. <thead><row><entry>Component</entry><entry>Special</entry><entry>Description</entry></row></thead>
  723. <tbody>
  724. <row><entry>b10-auth</entry><entry>auth</entry><entry>Authoritative server</entry></row>
  725. <row><entry>b10-resolver</entry><entry>resolver</entry><entry>The resolver</entry></row>
  726. <row><entry>b10-cmdctl</entry><entry>cmdctl</entry><entry>The command control (remote control interface)</entry></row>
  727. <!-- TODO Either add xfrin and xfrout as well or clean up the workarounds in boss before the release -->
  728. </tbody>
  729. </tgroup>
  730. </table>
  731. </para>
  732. <para>
  733. The kind specifies how a failure of the component should
  734. be handled. If it is set to <quote>dispensable</quote>
  735. (the default unless you set something else), it will get
  736. started again if it fails. If it is set to <quote>needed</quote>
  737. and it fails at startup, the whole <command>bind10</command>
  738. shuts down and exits with error exit code. But if it fails
  739. some time later, it is just started again. If you set it
  740. to <quote>core</quote>, you indicate that the system is
  741. not usable without the component and if such component
  742. fails, the system shuts down no matter when the failure
  743. happened. This is the behaviour of the core components
  744. (the ones you can't turn off), but you can declare any
  745. other components as core as well if you wish (but you can
  746. turn these off, they just can't fail).
  747. </para>
  748. <para>
  749. The priority defines order in which the components should start.
  750. The ones with higher number are started sooner than the ones with
  751. lower ones. If you don't set it, 0 (zero) is used as the priority.
  752. Usually, leaving it at the default is enough.
  753. </para>
  754. <para>
  755. There are other parameters we didn't use in our example.
  756. One of them is <quote>address</quote>. It is the address
  757. used by the component on the <command>b10-msgq</command>
  758. message bus. The special components already know their
  759. address, but the usual ones don't. The address is by
  760. convention the thing after <emphasis>b10-</emphasis>, with
  761. the first letter capital (eg. <command>b10-stats</command>
  762. would have <quote>Stats</quote> as its address).
  763. <!-- TODO: this should be simplified so we don't even have to document it -->
  764. </para>
  765. <!-- TODO: what does "The special components already know their
  766. address, but the usual ones don't." mean? -->
  767. <!-- TODO: document params when is enabled -->
  768. <para>
  769. The last one is process. It is the name of the process to be started.
  770. It defaults to the name of the component if not set, but you can use
  771. this to override it.
  772. </para>
  773. <!-- TODO Add parameters when they work, not implemented yet-->
  774. <note>
  775. <para>
  776. This system allows you to start the same component multiple times
  777. (by including it in the configuration with different names, but the
  778. same process setting). However, the rest of the system doesn't expect
  779. such a situation, so it would probably not do what you want. Such
  780. support is yet to be implemented.
  781. </para>
  782. </note>
  783. <note>
  784. <para>
  785. The configuration is quite powerful, but that includes
  786. a lot of space for mistakes. You could turn off the
  787. <command>b10-cmdctl</command>, but then you couldn't
  788. change it back the usual way, as it would require it to
  789. be running (you would have to find and edit the configuration
  790. directly). Also, some modules might have dependencies:
  791. <command>b10-stats-httpd</command> needs
  792. <command>b10-stats</command>, <command>b10-xfrout</command>
  793. needs <command>b10-auth</command> to be running, etc.
  794. <!-- TODO: should we define dependencies? -->
  795. </para>
  796. <para>
  797. In short, you should think twice before disabling something here.
  798. </para>
  799. </note>
  800. <para>
  801. It is possible to start some components multiple times (currently
  802. <command>b10-auth</command> and <command>b10-resolzer</command>).
  803. You might want to do that to gain more performance (each one uses only
  804. single core). Just put multiple entries under different names, like
  805. this, with the same config:
  806. <screen>&gt; <userinput>config add Boss/components b10-resolver-2</userinput>
  807. &gt; <userinput>config set Boss/components/b10-resolver-2/special resolver</userinput>
  808. &gt; <userinput>config set Boss/components/b10-resolver-2/kind needed</userinput>
  809. &gt; <userinput>config commit</userinput></screen>
  810. </para>
  811. <para>
  812. However, this is work in progress and the support is not yet complete.
  813. For example, each resolver will have its own cache, each authoritative
  814. server will keep its own copy of in-memory data and there could be
  815. problems with locking the sqlite database, if used. The configuration
  816. might be changed to something more convenient in future.
  817. </para>
  818. </section>
  819. </chapter>
  820. <chapter id="msgq">
  821. <title>Command channel</title>
  822. <para>
  823. The BIND 10 components use the <command>b10-msgq</command>
  824. message routing daemon to communicate with other BIND 10 components.
  825. The <command>b10-msgq</command> implements what is called the
  826. <quote>Command Channel</quote>.
  827. Processes intercommunicate by sending messages on the command
  828. channel.
  829. Example messages include shutdown, get configurations, and set
  830. configurations.
  831. This Command Channel is not used for DNS message passing.
  832. It is used only to control and monitor the BIND 10 system.
  833. </para>
  834. <para>
  835. Administrators do not communicate directly with the
  836. <command>b10-msgq</command> daemon.
  837. By default, BIND 10 uses port 9912 for the
  838. <command>b10-msgq</command> service.
  839. It listens on 127.0.0.1.
  840. </para>
  841. <!-- TODO: this is broken, see Trac #111
  842. <para>
  843. To select an alternate port for the <command>b10-msgq</command> to
  844. use, run <command>bind10</command> specifying the option:
  845. <screen> $ <userinput>bind10 -TODO-msgq-port 9912</userinput></screen>
  846. </para>
  847. -->
  848. <!-- TODO: upcoming plans:
  849. Unix domain sockets
  850. -->
  851. </chapter>
  852. <chapter id="cfgmgr">
  853. <title>Configuration manager</title>
  854. <para>
  855. The configuration manager, <command>b10-cfgmgr</command>,
  856. handles all BIND 10 system configuration. It provides
  857. persistent storage for configuration, and notifies running
  858. modules of configuration changes.
  859. </para>
  860. <para>
  861. The <command>b10-auth</command> and <command>b10-xfrin</command>
  862. daemons and other components receive their configurations
  863. from the configuration manager over the <command>b10-msgq</command>
  864. command channel.
  865. </para>
  866. <para>The administrator doesn't connect to it directly, but
  867. uses a user interface to communicate with the configuration
  868. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  869. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  870. </para>
  871. <!-- TODO -->
  872. <note>
  873. <para>
  874. The development prototype release only provides
  875. <command>bindctl</command> as a user interface to
  876. <command>b10-cmdctl</command>.
  877. Upcoming releases will provide another interactive command-line
  878. interface and a web-based interface.
  879. </para>
  880. </note>
  881. <para>
  882. The <command>b10-cfgmgr</command> daemon can send all
  883. specifications and all current settings to the
  884. <command>bindctl</command> client (via
  885. <command>b10-cmdctl</command>).
  886. </para>
  887. <para>
  888. <command>b10-cfgmgr</command> relays configurations received
  889. from <command>b10-cmdctl</command> to the appropriate modules.
  890. </para>
  891. <!-- TODO:
  892. Configuration settings for itself are defined as ConfigManager.
  893. TODO: show examples
  894. -->
  895. <!-- TODO:
  896. config changes are actually commands to cfgmgr
  897. -->
  898. <!-- TODO: what about run time config to change this? -->
  899. <!-- jelte: > config set cfgmgr/config_database <file> -->
  900. <!-- TODO: what about command line switch to change this? -->
  901. <para>
  902. The stored configuration file is at
  903. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  904. (The full path is what was defined at build configure time for
  905. <option>--localstatedir</option>.
  906. The default is <filename>/usr/local/var/</filename>.)
  907. The format is loosely based on JSON and is directly parseable
  908. python, but this may change in a future version.
  909. This configuration data file is not manually edited by the
  910. administrator.
  911. </para>
  912. <!--
  913. Well the specfiles have a more fixed format (they must contain specific
  914. stuff), but those are also directly parseable python structures (and
  915. 'coincidentally', our data::element string representation is the same)
  916. loosely based on json, tweaked to be directly parseable in python, but a
  917. subset of that.
  918. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  919. nope, spec files are written by module developers, and db should be done
  920. through bindctl and friends
  921. -->
  922. <para>
  923. The configuration manager does not have any command line arguments.
  924. Normally it is not started manually, but is automatically
  925. started using the <command>bind10</command> master process
  926. (as covered in <xref linkend="bind10"/>).
  927. </para>
  928. <!-- TODO: upcoming plans:
  929. configuration for configuration manager itself. And perhaps we might
  930. change the messaging protocol, but an admin should never see any of that
  931. -->
  932. <!-- TODO: show examples, test this -->
  933. <!--
  934. , so an admin can simply run bindctl,
  935. do config show, and it shows all modules; config show >module> shows all
  936. options for that module
  937. -->
  938. </chapter>
  939. <chapter id="cmdctl">
  940. <title>Remote control daemon</title>
  941. <para>
  942. <command>b10-cmdctl</command> is the gateway between
  943. administrators and the BIND 10 system.
  944. It is a HTTPS server that uses standard HTTP Digest
  945. Authentication for username and password validation.
  946. It provides a REST-ful interface for accessing and controlling
  947. BIND 10.
  948. </para>
  949. <!-- TODO: copy examples from wiki, try with wget -->
  950. <para>
  951. When <command>b10-cmdctl</command> starts, it firsts
  952. asks <command>b10-cfgmgr</command> about what modules are
  953. running and what their configuration is (over the
  954. <command>b10-msgq</command> channel). Then it will start listening
  955. on HTTPS for clients &mdash; the user interface &mdash; such
  956. as <command>bindctl</command>.
  957. </para>
  958. <para>
  959. <command>b10-cmdctl</command> directly sends commands
  960. (received from the user interface) to the specified component.
  961. Configuration changes are actually commands to
  962. <command>b10-cfgmgr</command> so are sent there.
  963. </para>
  964. <!--
  965. TODO:
  966. "For bindctl to list a module's available configurations and
  967. available commands, it communicates over the cmdctl REST interface.
  968. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  969. asks the module for its specification and also cfgmgr looks in its
  970. own configuration database for current values."
  971. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  972. GET, but rather requests it once and then listens in for updates,
  973. but you might wanna check with likun
  974. -->
  975. <!-- TODO: replace /usr/local -->
  976. <!-- TODO: permissions -->
  977. <para>The HTTPS server requires a private key,
  978. such as a RSA PRIVATE KEY.
  979. The default location is at
  980. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  981. (A sample key is at
  982. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  983. It also uses a certificate located at
  984. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  985. (A sample certificate is at
  986. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  987. This may be a self-signed certificate or purchased from a
  988. certification authority.
  989. </para>
  990. <note><para>
  991. The HTTPS server doesn't support a certificate request from a
  992. client (at this time).
  993. <!-- TODO: maybe allow request from server side -->
  994. The <command>b10-cmdctl</command> daemon does not provide a
  995. public service. If any client wants to control BIND 10, then
  996. a certificate needs to be first received from the BIND 10
  997. administrator.
  998. The BIND 10 installation provides a sample PEM bundle that matches
  999. the sample key and certificate.
  1000. </para></note>
  1001. <!-- TODO: cross-ref -->
  1002. <!-- TODO
  1003. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  1004. but that is a single file, maybethis should go back to that format?
  1005. -->
  1006. <!--
  1007. <para>
  1008. (08:20:56) shane: It is in theory possible to run without cmdctl.
  1009. (08:21:02) shane: I think we discussed this.
  1010. </para>
  1011. -->
  1012. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  1013. <para>
  1014. The <command>b10-cmdctl</command> daemon also requires
  1015. the user account file located at
  1016. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  1017. This comma-delimited file lists the accounts with a user name,
  1018. hashed password, and salt.
  1019. (A sample file is at
  1020. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  1021. It contains the user named <quote>root</quote> with the password
  1022. <quote>bind10</quote>.)
  1023. </para>
  1024. <para>
  1025. The administrator may create a user account with the
  1026. <command>b10-cmdctl-usermgr</command> tool.
  1027. </para>
  1028. <!-- TODO: show example -->
  1029. <!-- TODO: does cmdctl need to be restarted to change cert or key
  1030. or accounts database -->
  1031. <para>
  1032. By default the HTTPS server listens on the localhost port 8080.
  1033. The port can be set by using the <option>--port</option> command line option.
  1034. The address to listen on can be set using the <option>--address</option> command
  1035. line argument.
  1036. Each HTTPS connection is stateless and times out in 1200 seconds
  1037. by default. This can be
  1038. redefined by using the <option>--idle-timeout</option> command line argument.
  1039. </para>
  1040. <section id="cmdctl.spec">
  1041. <title>Configuration specification for b10-cmdctl</title>
  1042. <para>
  1043. The configuration items for <command>b10-cmdctl</command> are:
  1044. key_file
  1045. cert_file
  1046. accounts_file
  1047. </para>
  1048. <!-- TODO -->
  1049. <para>
  1050. The control commands are:
  1051. print_settings
  1052. <!-- TODO: remove that -->
  1053. shutdown
  1054. </para>
  1055. <!-- TODO -->
  1056. </section>
  1057. <!--
  1058. TODO
  1059. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  1060. (12:21:33) jinmei: btw
  1061. -->
  1062. </chapter>
  1063. <chapter id="bindctl">
  1064. <title>Control and configure user interface</title>
  1065. <note><para>
  1066. For this development prototype release, <command>bindctl</command>
  1067. is the only user interface. It is expected that upcoming
  1068. releases will provide another interactive command-line
  1069. interface and a web-based interface for controlling and
  1070. configuring BIND 10.
  1071. </para></note>
  1072. <para>
  1073. The <command>bindctl</command> tool provides an interactive
  1074. prompt for configuring, controlling, and querying the BIND 10
  1075. components.
  1076. It communicates directly with a REST-ful interface over HTTPS
  1077. provided by <command>b10-cmdctl</command>. It doesn't
  1078. communicate to any other components directly.
  1079. </para>
  1080. <!-- TODO: explain and show interface -->
  1081. <para>
  1082. Configuration changes are actually commands to
  1083. <command>b10-cfgmgr</command>. So when <command>bindctl</command>
  1084. sends a configuration, it is sent to <command>b10-cmdctl</command>
  1085. (over a HTTPS connection); then <command>b10-cmdctl</command>
  1086. sends the command (over a <command>b10-msgq</command> command
  1087. channel) to <command>b10-cfgmgr</command> which then stores
  1088. the details and relays (over a <command>b10-msgq</command> command
  1089. channel) the configuration on to the specified module.
  1090. </para>
  1091. <para>
  1092. </para>
  1093. </chapter>
  1094. <chapter id="authserver">
  1095. <title>Authoritative Server</title>
  1096. <para>
  1097. The <command>b10-auth</command> is the authoritative DNS server.
  1098. It supports EDNS0 and DNSSEC. It supports IPv6.
  1099. Normally it is started by the <command>bind10</command> master
  1100. process.
  1101. </para>
  1102. <section>
  1103. <title>Server Configurations</title>
  1104. <!-- TODO: offers command line options but not used
  1105. since we used bind10 -->
  1106. <para>
  1107. <command>b10-auth</command> is configured via the
  1108. <command>b10-cfgmgr</command> configuration manager.
  1109. The module name is <quote>Auth</quote>.
  1110. The configuration data items are:
  1111. <variablelist>
  1112. <varlistentry>
  1113. <term>database_file</term>
  1114. <listitem>
  1115. <simpara>This is an optional string to define the path to find
  1116. the SQLite3 database file.
  1117. <!-- TODO: -->
  1118. Note: Later the DNS server will use various data source backends.
  1119. This may be a temporary setting until then.
  1120. </simpara>
  1121. </listitem>
  1122. </varlistentry>
  1123. <!-- NOTE: docs pulled in verbatim from the b10-auth.xml manual page.
  1124. TODO: automate this if want this or rewrite
  1125. -->
  1126. <varlistentry>
  1127. <term>datasources</term>
  1128. <listitem>
  1129. <simpara>
  1130. <varname>datasources</varname> configures data sources.
  1131. The list items include:
  1132. <varname>type</varname> to define the required data source type
  1133. (such as <quote>memory</quote>);
  1134. <varname>class</varname> to optionally select the class
  1135. (it defaults to <quote>IN</quote>);
  1136. and
  1137. <varname>zones</varname> to define the
  1138. <varname>file</varname> path name and the
  1139. <varname>origin</varname> (default domain).
  1140. By default, this is empty.
  1141. <note><simpara>
  1142. In this development version, currently this is only used for the
  1143. memory data source.
  1144. Only the IN class is supported at this time.
  1145. By default, the memory data source is disabled.
  1146. Also, currently the zone file must be canonical such as
  1147. generated by <command>named-compilezone -D</command>.
  1148. </simpara></note>
  1149. </simpara>
  1150. </listitem>
  1151. </varlistentry>
  1152. <varlistentry>
  1153. <term>listen_on</term>
  1154. <listitem>
  1155. <simpara>
  1156. <varname>listen_on</varname> is a list of addresses and ports for
  1157. <command>b10-auth</command> to listen on.
  1158. The list items are the <varname>address</varname> string
  1159. and <varname>port</varname> number.
  1160. By default, <command>b10-auth</command> listens on port 53
  1161. on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
  1162. </simpara>
  1163. </listitem>
  1164. </varlistentry>
  1165. <varlistentry>
  1166. <term>statistics-interval</term>
  1167. <listitem>
  1168. <simpara>
  1169. <varname>statistics-interval</varname> is the timer interval
  1170. in seconds for <command>b10-auth</command> to share its
  1171. statistics information to
  1172. <citerefentry><refentrytitle>b10-stats</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
  1173. Statistics updates can be disabled by setting this to 0.
  1174. The default is 60.
  1175. </simpara>
  1176. </listitem>
  1177. </varlistentry>
  1178. </variablelist>
  1179. </para>
  1180. <para>
  1181. The configuration commands are:
  1182. <variablelist>
  1183. <varlistentry>
  1184. <term>loadzone</term>
  1185. <listitem>
  1186. <simpara>
  1187. <command>loadzone</command> tells <command>b10-auth</command>
  1188. to load or reload a zone file. The arguments include:
  1189. <varname>class</varname> which optionally defines the class
  1190. (it defaults to <quote>IN</quote>);
  1191. <varname>origin</varname> is the domain name of the zone;
  1192. and
  1193. <varname>datasrc</varname> optionally defines the type of datasource
  1194. (it defaults to <quote>memory</quote>).
  1195. <note><simpara>
  1196. In this development version, currently this only supports the
  1197. IN class and the memory data source.
  1198. </simpara></note>
  1199. </simpara>
  1200. </listitem>
  1201. </varlistentry>
  1202. <varlistentry>
  1203. <term>sendstats</term>
  1204. <listitem>
  1205. <simpara>
  1206. <command>sendstats</command> tells <command>b10-auth</command>
  1207. to send its statistics data to
  1208. <citerefentry><refentrytitle>b10-stats</refentrytitle><manvolnum>8</manvolnum></citerefentry>
  1209. immediately.
  1210. </simpara>
  1211. </listitem>
  1212. </varlistentry>
  1213. <varlistentry>
  1214. <term>shutdown</term>
  1215. <listitem>
  1216. <simpara>Stop the authoritative DNS server.
  1217. This has an optional <varname>pid</varname> argument to
  1218. select the process ID to stop.
  1219. (Note that the BIND 10 boss process may restart this service
  1220. if configured.)
  1221. </simpara>
  1222. </listitem>
  1223. </varlistentry>
  1224. </variablelist>
  1225. </para>
  1226. <!-- TODO: examples of setting or running above? -->
  1227. </section>
  1228. <section>
  1229. <title>Data Source Backends</title>
  1230. <note><para>
  1231. For the development prototype release, <command>b10-auth</command>
  1232. supports a SQLite3 data source backend and in-memory data source
  1233. backend.
  1234. Upcoming versions will be able to use multiple different
  1235. data sources, such as MySQL and Berkeley DB.
  1236. </para></note>
  1237. <para>
  1238. By default, the SQLite3 backend uses the data file located at
  1239. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  1240. (The full path is what was defined at build configure time for
  1241. <option>--localstatedir</option>.
  1242. The default is <filename>/usr/local/var/</filename>.)
  1243. This data file location may be changed by defining the
  1244. <quote>database_file</quote> configuration.
  1245. </para>
  1246. <section id="in-memory-datasource">
  1247. <title>In-memory Data Source</title>
  1248. <para>
  1249. <!-- How to configure it. -->
  1250. The following commands to <command>bindctl</command>
  1251. provide an example of configuring an in-memory data
  1252. source containing the <quote>example.com</quote> zone
  1253. with the zone file named <quote>example.com.zone</quote>:
  1254. <!--
  1255. <screen>&gt; <userinput> config set Auth/datasources/ [{"type": "memory", "zones": [{"origin": "example.com", "file": "example.com.zone"}]}]</userinput></screen>
  1256. -->
  1257. <screen>&gt; <userinput>config add Auth/datasources</userinput>
  1258. &gt; <userinput>config set Auth/datasources[0]/type "<option>memory</option>"</userinput>
  1259. &gt; <userinput>config add Auth/datasources[0]/zones</userinput>
  1260. &gt; <userinput>config set Auth/datasources[0]/zones[0]/origin "<option>example.com</option>"</userinput>
  1261. &gt; <userinput>config set Auth/datasources[0]/zones[0]/file "<option>example.com.zone</option>"</userinput>
  1262. &gt; <userinput>config commit</userinput></screen>
  1263. The authoritative server will begin serving it immediately
  1264. after it is loaded.
  1265. </para>
  1266. <para>
  1267. Use the <command>Auth loadzone</command> command in
  1268. <command>bindctl</command> to reload a changed master
  1269. file into memory; for example:
  1270. <screen>&gt; <userinput>Auth loadzone origin="example.com"</userinput>
  1271. </screen>
  1272. </para>
  1273. <!--
  1274. <para>
  1275. The <varname>file</varname> may be an absolute path to the
  1276. master zone file or it is relative to the directory BIND 10 is
  1277. started from.
  1278. </para>
  1279. -->
  1280. <para>
  1281. By default, the memory data source is disabled; it must be
  1282. configured explicitly. To disable all the in-memory zones,
  1283. specify a null list for <varname>Auth/datasources</varname>:
  1284. <!-- TODO: this assumes that Auth/datasources is for memory only -->
  1285. <screen>&gt; <userinput>config set Auth/datasources/ []</userinput>
  1286. &gt; <userinput>config commit</userinput></screen>
  1287. </para>
  1288. <para>
  1289. The following example stops serving a specific zone:
  1290. <screen>&gt; <userinput>config remove Auth/datasources[<option>0</option>]/zones[<option>0</option>]</userinput>
  1291. &gt; <userinput>config commit</userinput></screen>
  1292. (Replace the list number(s) in
  1293. <varname>datasources[<replaceable>0</replaceable>]</varname>
  1294. and/or <varname>zones[<replaceable>0</replaceable>]</varname>
  1295. for the relevant zone as needed.)
  1296. </para>
  1297. </section>
  1298. </section>
  1299. <section>
  1300. <title>Loading Master Zones Files</title>
  1301. <para>
  1302. RFC 1035 style DNS master zone files may imported
  1303. into a BIND 10 SQLite3 data source by using the
  1304. <command>b10-loadzone</command> utility.
  1305. </para>
  1306. <para>
  1307. <command>b10-loadzone</command> supports the following
  1308. special directives (control entries):
  1309. <variablelist>
  1310. <varlistentry>
  1311. <term>$INCLUDE</term>
  1312. <listitem>
  1313. <simpara>Loads an additional zone file. This may be recursive.
  1314. </simpara>
  1315. </listitem>
  1316. </varlistentry>
  1317. <varlistentry>
  1318. <term>$ORIGIN</term>
  1319. <listitem>
  1320. <simpara>Defines the relative domain name.
  1321. </simpara>
  1322. </listitem>
  1323. </varlistentry>
  1324. <varlistentry>
  1325. <term>$TTL</term>
  1326. <listitem>
  1327. <simpara>Defines the time-to-live value used for following
  1328. records that don't include a TTL.
  1329. </simpara>
  1330. </listitem>
  1331. </varlistentry>
  1332. </variablelist>
  1333. </para>
  1334. <para>
  1335. The <option>-o</option> argument may be used to define the
  1336. default origin for loaded zone file records.
  1337. </para>
  1338. <note>
  1339. <para>
  1340. In the development prototype release, only the SQLite3 back
  1341. end is used by <command>b10-loadzone</command>.
  1342. By default, it stores the zone data in
  1343. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  1344. unless the <option>-d</option> switch is used to set the
  1345. database filename.
  1346. Multiple zones are stored in a single SQLite3 zone database.
  1347. </para>
  1348. </note>
  1349. <para>
  1350. If you reload a zone already existing in the database,
  1351. all records from that prior zone disappear and a whole new set
  1352. appears.
  1353. </para>
  1354. <!--TODO: permissions for xfrin or loadzone to create the file -->
  1355. </section>
  1356. <!--
  1357. TODO
  1358. <section>
  1359. <title>Troubleshooting</title>
  1360. <para>
  1361. </para>
  1362. </section>
  1363. -->
  1364. </chapter>
  1365. <chapter id="xfrin">
  1366. <title>Incoming Zone Transfers</title>
  1367. <para>
  1368. Incoming zones are transferred using the <command>b10-xfrin</command>
  1369. process which is started by <command>bind10</command>.
  1370. When received, the zone is stored in the corresponding BIND 10
  1371. data source, and its records can be served by
  1372. <command>b10-auth</command>.
  1373. In combination with <command>b10-zonemgr</command> (for
  1374. automated SOA checks), this allows the BIND 10 server to
  1375. provide <quote>secondary</quote> service.
  1376. </para>
  1377. <para>
  1378. The <command>b10-xfrin</command> process supports both AXFR and
  1379. IXFR. Due to some implementation limitations of the current
  1380. development release, however, it only tries AXFR by default,
  1381. and care should be taken to enable IXFR.
  1382. </para>
  1383. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1384. <note><simpara>
  1385. In the current development release of BIND 10, incoming zone
  1386. transfers are only available for SQLite3-based data sources,
  1387. that is, they don't work for an in-memory data source.
  1388. </simpara></note>
  1389. <section>
  1390. <title>Configuration for Incoming Zone Transfers</title>
  1391. <para>
  1392. In practice, you need to specify a list of secondary zones to
  1393. enable incoming zone transfers for these zones (you can still
  1394. trigger a zone transfer manually, without a prior configuration
  1395. (see below)).
  1396. </para>
  1397. <para>
  1398. For example, to enable zone transfers for a zone named "example.com"
  1399. (whose master address is assumed to be 2001:db8::53 here),
  1400. run the following at the <command>bindctl</command> prompt:
  1401. <screen>&gt; <userinput>config add Xfrin/zones</userinput>
  1402. &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
  1403. &gt; <userinput>config set Xfrin/zones[0]/master_addr "<option>2001:db8::53</option>"</userinput>
  1404. &gt; <userinput>config commit</userinput></screen>
  1405. (We assume there has been no zone configuration before).
  1406. </para>
  1407. </section>
  1408. <section>
  1409. <title>Enabling IXFR</title>
  1410. <para>
  1411. As noted above, <command>b10-xfrin</command> uses AXFR for
  1412. zone transfers by default. To enable IXFR for zone transfers
  1413. for a particular zone, set the <userinput>use_ixfr</userinput>
  1414. configuration parameter to <userinput>true</userinput>.
  1415. In the above example of configuration sequence, you'll need
  1416. to add the following before performing <userinput>commit</userinput>:
  1417. <screen>&gt; <userinput>config set Xfrin/zones[0]/use_ixfr true</userinput></screen>
  1418. </para>
  1419. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1420. <note><simpara>
  1421. One reason why IXFR is disabled by default in the current
  1422. release is because it does not support automatic fallback from IXFR to
  1423. AXFR when it encounters a primary server that doesn't support
  1424. outbound IXFR (and, not many existing implementations support
  1425. it). Another, related reason is that it does not use AXFR even
  1426. if it has no knowledge about the zone (like at the very first
  1427. time the secondary server is set up). IXFR requires the
  1428. "current version" of the zone, so obviously it doesn't work
  1429. in this situation and AXFR is the only workable choice.
  1430. The current release of <command>b10-xfrin</command> does not
  1431. make this selection automatically.
  1432. These features will be implemented in a near future
  1433. version, at which point we will enable IXFR by default.
  1434. </simpara></note>
  1435. </section>
  1436. <!-- TODO:
  1437. how to tell bind10 you are a secondary?
  1438. when will it first attempt to check for new zone? (using REFRESH?)
  1439. what if zonemgr is not running?
  1440. what if a NOTIFY is sent?
  1441. -->
  1442. <section id="zonemgr">
  1443. <title>Secondary Manager</title>
  1444. <para>
  1445. The <command>b10-zonemgr</command> process is started by
  1446. <command>bind10</command>.
  1447. It keeps track of SOA refresh, retry, and expire timers
  1448. and other details for BIND 10 to perform as a slave.
  1449. When the <command>b10-auth</command> authoritative DNS server
  1450. receives a NOTIFY message, <command>b10-zonemgr</command>
  1451. may tell <command>b10-xfrin</command> to do a refresh
  1452. to start an inbound zone transfer.
  1453. The secondary manager resets its counters when a new zone is
  1454. transferred in.
  1455. </para>
  1456. <note><simpara>
  1457. Access control (such as allowing notifies) is not yet provided.
  1458. The primary/secondary service is not yet complete.
  1459. </simpara></note>
  1460. <para>
  1461. The following example shows using <command>bindctl</command>
  1462. to configure the server to be a secondary for the example zone:
  1463. <screen>&gt; <userinput>config add Zonemgr/secondary_zones</userinput>
  1464. &gt; <userinput>config set Zonemgr/secondary_zones[0]/name "<option>example.com</option>"</userinput>
  1465. &gt; <userinput>config set Zonemgr/secondary_zones[0]/class "<option>IN</option>"</userinput>
  1466. &gt; <userinput>config commit</userinput></screen>
  1467. <!-- TODO: remove the IN class example above when it is the default -->
  1468. </para>
  1469. <para>
  1470. If the zone does not exist in the data source already
  1471. (i.e. no SOA record for it), <command>b10-zonemgr</command>
  1472. will automatically tell <command>b10-xfrin</command>
  1473. to transfer the zone in.
  1474. </para>
  1475. </section>
  1476. <section>
  1477. <title>Trigger an Incoming Zone Transfer Manually</title>
  1478. <para>
  1479. To manually trigger a zone transfer to retrieve a remote zone,
  1480. you may use the <command>bindctl</command> utility.
  1481. For example, at the <command>bindctl</command> prompt run:
  1482. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  1483. </para>
  1484. </section>
  1485. <!-- TODO: can that retransfer be used to identify a new zone? -->
  1486. <!-- TODO: what if doesn't exist at that master IP? -->
  1487. </chapter>
  1488. <chapter id="xfrout">
  1489. <title>Outbound Zone Transfers</title>
  1490. <para>
  1491. The <command>b10-xfrout</command> process is started by
  1492. <command>bind10</command>.
  1493. When the <command>b10-auth</command> authoritative DNS server
  1494. receives an AXFR or IXFR request, <command>b10-auth</command>
  1495. internally forwards the request to <command>b10-xfrout</command>,
  1496. which handles the rest of request processing.
  1497. This is used to provide primary DNS service to share zones
  1498. to secondary name servers.
  1499. The <command>b10-xfrout</command> is also used to send
  1500. NOTIFY messages to secondary servers.
  1501. </para>
  1502. <para>
  1503. A global or per zone <option>transfer_acl</option> configuration
  1504. can be used to control accessibility of the outbound zone
  1505. transfer service.
  1506. By default, <command>b10-xfrout</command> allows any clients to
  1507. perform zone transfers for any zones:
  1508. </para>
  1509. <screen>&gt; <userinput>config show Xfrout/transfer_acl</userinput>
  1510. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</screen>
  1511. <para>
  1512. You can change this to, for example, rejecting all transfer
  1513. requests by default while allowing requests for the transfer
  1514. of zone "example.com" from 192.0.2.1 and 2001:db8::1 as follows:
  1515. </para>
  1516. <screen>&gt; <userinput>config set Xfrout/transfer_acl[0] {"action": "REJECT"}</userinput>
  1517. &gt; <userinput>config add Xfrout/zone_config</userinput>
  1518. &gt; <userinput>config set Xfrout/zone_config[0]/origin "example.com"</userinput>
  1519. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1"},</userinput>
  1520. <userinput> {"action": "ACCEPT", "from": "2001:db8::1"}]</userinput>
  1521. &gt; <userinput>config commit</userinput></screen>
  1522. <note><simpara>
  1523. In the above example the lines
  1524. for <option>transfer_acl</option> were divided for
  1525. readability. In the actual input it must be in a single line.
  1526. </simpara></note>
  1527. <para>
  1528. If you want to require TSIG in access control, a system wide TSIG
  1529. "key ring" must be configured.
  1530. For example, to change the previous example to allowing requests
  1531. from 192.0.2.1 signed by a TSIG with a key name of
  1532. "key.example", you'll need to do this:
  1533. </para>
  1534. <screen>&gt; <userinput>config set tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</userinput>
  1535. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]</userinput>
  1536. &gt; <userinput>config commit</userinput></screen>
  1537. <para>Both Xfrout and Auth will use the system wide keyring to check
  1538. TSIGs in the incoming messages and to sign responses.</para>
  1539. <note><simpara>
  1540. The way to specify zone specific configuration (ACLs, etc) is
  1541. likely to be changed.
  1542. </simpara></note>
  1543. <!--
  1544. TODO:
  1545. xfrout section:
  1546. auth servers checks for AXFR query
  1547. sends the XFR query to the xfrout module
  1548. uses /tmp/auth_xfrout_conn which is a socket
  1549. what is XfroutClient xfr_client??
  1550. /tmp/auth_xfrout_conn is not removed
  1551. -->
  1552. </chapter>
  1553. <chapter id="resolverserver">
  1554. <title>Recursive Name Server</title>
  1555. <para>
  1556. The <command>b10-resolver</command> process is started by
  1557. <command>bind10</command>.
  1558. <!-- TODO
  1559. It provides a resolver so DNS clients can ask it to do recursion
  1560. and it will return answers.
  1561. -->
  1562. </para>
  1563. <para>
  1564. The main <command>bind10</command> process can be configured
  1565. to select to run either the authoritative or resolver or both.
  1566. By default, it doesn't start either one. You may change this using
  1567. <command>bindctl</command>, for example:
  1568. <screen>
  1569. &gt; <userinput>config add Boss/components b10-resolver</userinput>
  1570. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  1571. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  1572. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  1573. &gt; <userinput>config commit</userinput>
  1574. </screen>
  1575. </para>
  1576. <para>
  1577. The master <command>bind10</command> will stop and start
  1578. the desired services.
  1579. </para>
  1580. <para>
  1581. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  1582. The following example shows how it can be configured to
  1583. listen on an additional address (and port):
  1584. <screen>
  1585. &gt; <userinput>config add Resolver/listen_on</userinput>
  1586. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
  1587. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
  1588. &gt; <userinput>config commit</userinput>
  1589. </screen>
  1590. </para>
  1591. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  1592. as needed; run <quote><userinput>config show
  1593. Resolver/listen_on</userinput></quote> if needed.)</simpara>
  1594. <!-- TODO: this example should not include the port, ticket #1185 -->
  1595. <section>
  1596. <title>Access Control</title>
  1597. <para>
  1598. By default, the <command>b10-resolver</command> daemon only accepts
  1599. DNS queries from the localhost (127.0.0.1 and ::1).
  1600. The <option>Resolver/query_acl</option> configuration may
  1601. be used to reject, drop, or allow specific IPs or networks.
  1602. This configuration list is first match.
  1603. </para>
  1604. <para>
  1605. The configuration's <option>action</option> item may be
  1606. set to <quote>ACCEPT</quote> to allow the incoming query,
  1607. <quote>REJECT</quote> to respond with a DNS REFUSED return
  1608. code, or <quote>DROP</quote> to ignore the query without
  1609. any response (such as a blackhole). For more information,
  1610. see the respective debugging messages: <ulink
  1611. url="bind10-messages.html#RESOLVER_QUERY_ACCEPTED">RESOLVER_QUERY_ACCEPTED</ulink>,
  1612. <ulink
  1613. url="bind10-messages.html#RESOLVER_QUERY_REJECTED">RESOLVER_QUERY_REJECTED</ulink>,
  1614. and <ulink
  1615. url="bind10-messages.html#RESOLVER_QUERY_DROPPED">RESOLVER_QUERY_DROPPED</ulink>.
  1616. </para>
  1617. <para>
  1618. The required configuration's <option>from</option> item is set
  1619. to an IPv4 or IPv6 address, addresses with an network mask, or to
  1620. the special lowercase keywords <quote>any6</quote> (for
  1621. any IPv6 address) or <quote>any4</quote> (for any IPv4
  1622. address).
  1623. </para>
  1624. <!-- TODO:
  1625. /0 is for any address in that address family
  1626. does that need any address too?
  1627. TODO: tsig
  1628. -->
  1629. <para>
  1630. For example to allow the <replaceable>192.168.1.0/24</replaceable>
  1631. network to use your recursive name server, at the
  1632. <command>bindctl</command> prompt run:
  1633. </para>
  1634. <screen>
  1635. &gt; <userinput>config add Resolver/query_acl</userinput>
  1636. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/action "ACCEPT"</userinput>
  1637. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/from "<replaceable>192.168.1.0/24</replaceable>"</userinput>
  1638. &gt; <userinput>config commit</userinput>
  1639. </screen>
  1640. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  1641. as needed; run <quote><userinput>config show
  1642. Resolver/query_acl</userinput></quote> if needed.)</simpara>
  1643. <!-- TODO: check this -->
  1644. <note><simpara>This prototype access control configuration
  1645. syntax may be changed.</simpara></note>
  1646. </section>
  1647. <section>
  1648. <title>Forwarding</title>
  1649. <para>
  1650. To enable forwarding, the upstream address and port must be
  1651. configured to forward queries to, such as:
  1652. <screen>
  1653. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  1654. &gt; <userinput>config commit</userinput>
  1655. </screen>
  1656. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  1657. full resolver.)
  1658. </para>
  1659. <para>
  1660. Normal iterative name service can be re-enabled by clearing the
  1661. forwarding address(es); for example:
  1662. <screen>
  1663. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  1664. &gt; <userinput>config commit</userinput>
  1665. </screen>
  1666. </para>
  1667. </section>
  1668. <!-- TODO: later try this
  1669. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  1670. > config set Resolver/forward_addresses[0]/port 53
  1671. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1672. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1673. -->
  1674. </chapter>
  1675. <chapter id="dhcp4">
  1676. <title>DHCPv4 Server</title>
  1677. <para>Dynamic Host Configuration Protocol for IPv4 (DHCP or
  1678. DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  1679. are protocols that allow one node (server) to provision
  1680. configuration parameters to many hosts and devices (clients). To
  1681. ease deployment in larger networks, additional nodes (relays) may
  1682. be deployed that facilitate communication between servers and
  1683. clients. Even though principles of both DHCPv4 and DHCPv6 are
  1684. somewhat similar, these are two radically different
  1685. protocols. BIND10 offers server implementations for both DHCPv4
  1686. and DHCPv6. This chapter is about DHCP for IPv4. For a description
  1687. of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para>
  1688. <para>The DHCPv4 server component is currently under intense
  1689. development. You may want to check out <ulink
  1690. url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
  1691. and recent posts on <ulink
  1692. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
  1693. developers mailing list</ulink>.</para>
  1694. <para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
  1695. internally code named <quote>Kea</quote>.</para>
  1696. <note>
  1697. <para>
  1698. As of December 2011, both DHCPv4 and DHCPv6 components are
  1699. skeleton servers. That means that while they are capable of
  1700. performing DHCP configuration, they are not fully functional
  1701. yet. In particular, neither has functional lease
  1702. databases. This means that they will assign the same, fixed,
  1703. hardcoded addresses to any client that will ask. See <xref
  1704. linkend="dhcp4-limit"/> and <xref linkend="dhcp6-limit"/> for
  1705. detailed description.
  1706. </para>
  1707. </note>
  1708. <section id="dhcp4-usage">
  1709. <title>DHCPv4 Server Usage</title>
  1710. <para>BIND10 provides the DHCPv4 server component since December
  1711. 2011. It is a skeleton server and can be described as an early
  1712. prototype that is not fully functional yet. It is mature enough
  1713. to conduct first tests in lab environment, but it has
  1714. significant limitations. See <xref linkend="dhcp4-limit"/> for
  1715. details.
  1716. </para>
  1717. <para>
  1718. The DHCPv4 server is implemented as <command>b10-dhcp4</command>
  1719. daemon. As it is not configurable yet, it is fully autonomous,
  1720. that is it does not interact with <command>b10-cfgmgr</command>.
  1721. To start DHCPv4 server, simply input:
  1722. <screen>
  1723. #<userinput>cd src/bin/dhcp4</userinput>
  1724. #<userinput>./b10-dhcp4</userinput>
  1725. </screen>
  1726. Depending on your installation, <command>b10-dhcp4</command>
  1727. binary may reside in src/bin/dhcp4 in your source code
  1728. directory, in /usr/local/bin/b10-dhcp4 or other directory
  1729. you specified during compilation.
  1730. At start, the server will detect available network interfaces
  1731. and will attempt to open UDP sockets on all interfaces that
  1732. are up, running, are not loopback, and have IPv4 address
  1733. assigned.
  1734. The server will then listen to incoming traffic. Currently
  1735. supported client messages are DISCOVER and REQUEST. The server
  1736. will respond to them with OFFER and ACK, respectively.
  1737. Since the DHCPv4 server opens privileged ports, it requires root
  1738. access. Make sure you run this daemon as root.</para>
  1739. <note>
  1740. <para>
  1741. Integration with <command>bind10</command> is
  1742. planned. Ultimately, <command>b10-dhcp4</command> will not
  1743. be started directly, but rather via
  1744. <command>bind10</command>. Please be aware of this planned
  1745. change.
  1746. </para>
  1747. </note>
  1748. </section>
  1749. <section id="dhcp4-config">
  1750. <title>DHCPv4 Server Configuration</title>
  1751. <para>
  1752. The DHCPv4 server does not have a lease database implemented yet
  1753. nor any support for configuration, so every time the same set
  1754. of configuration options (including the same fixed address)
  1755. will be assigned every time.
  1756. </para>
  1757. <para>
  1758. At this stage of development, the only way to alter the server
  1759. configuration is to tweak its source code. To do so, please
  1760. edit src/bin/dhcp4/dhcp4_srv.cc file and modify following
  1761. parameters and recompile:
  1762. <screen>
  1763. const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
  1764. const std::string HARDCODED_NETMASK = "255.255.255.0";
  1765. const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds
  1766. const std::string HARDCODED_GATEWAY = "192.0.2.1";
  1767. const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
  1768. const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
  1769. const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
  1770. Lease database and configuration support is planned for 2012.
  1771. </para>
  1772. </section>
  1773. <section id="dhcp4-std">
  1774. <title>Supported standards</title>
  1775. <para>The following standards and draft standards are currently
  1776. supported:</para>
  1777. <itemizedlist>
  1778. <listitem>
  1779. <simpara>RFC2131: Supported messages are DISCOVER, OFFER,
  1780. REQUEST, and ACK.</simpara>
  1781. </listitem>
  1782. <listitem>
  1783. <simpara>RFC2132: Supported options are: PAD (0),
  1784. END(255), Message Type(53), DHCP Server Identifier (54),
  1785. Domain Name (15), DNS Servers (6), IP Address Lease Time
  1786. (51), Subnet mask (1), and Routers (3).</simpara>
  1787. </listitem>
  1788. </itemizedlist>
  1789. </section>
  1790. <section id="dhcp4-limit">
  1791. <title>DHCPv4 Server Limitations</title>
  1792. <para>These are the current limitations of the DHCPv4 server
  1793. software. Most of them are reflections of the early stage of
  1794. development and should be treated as <quote>not implemented
  1795. yet</quote>, rather than actual limitations.</para>
  1796. <itemizedlist>
  1797. <listitem>
  1798. <simpara>During initial IPv4 node configuration, the
  1799. server is expected to send packets to a node that does not
  1800. have IPv4 address assigned yet. The server requires
  1801. certain tricks (or hacks) to transmit such packets. This
  1802. is not implemented yet, therefore DHCPv4 server supports
  1803. relayed traffic only (that is, normal point to point
  1804. communication).</simpara>
  1805. </listitem>
  1806. <listitem>
  1807. <simpara><command>b10-dhcp4</command> provides a single,
  1808. fixed, hardcoded lease to any client that asks. There is
  1809. no lease manager implemented. If two clients request
  1810. addresses, they will both get the same fixed
  1811. address.</simpara>
  1812. </listitem>
  1813. <listitem>
  1814. <simpara><command>b10-dhcp4</command> does not support any
  1815. configuration mechanisms yet. The whole configuration is
  1816. currently hardcoded. The only way to tweak configuration
  1817. is to directly modify source code. See see <xref
  1818. linkend="dhcp4-config"/> for details.</simpara>
  1819. </listitem>
  1820. <listitem>
  1821. <simpara>Upon start, the server will open sockets on all
  1822. interfaces that are not loopback, are up and running and
  1823. have IPv4 address. Support for multiple interfaces is not
  1824. coded in reception routines yet, so if you are running
  1825. this code on a machine that has many interfaces and
  1826. <command>b10-dhcp4</command> happens to listen on wrong
  1827. interface, the easiest way to work around this problem is
  1828. to turn down other interfaces. This limitation will be
  1829. fixed shortly.</simpara>
  1830. </listitem>
  1831. <listitem>
  1832. <simpara>PRL (Parameter Request List, a list of options
  1833. requested by a client) is currently ignored and server
  1834. assigns DNS SERVER and DOMAIN NAME options.</simpara>
  1835. </listitem>
  1836. <listitem>
  1837. <simpara><command>b10-dhcp4</command> does not support
  1838. BOOTP. That is a design choice. This limitation is
  1839. permanent. If you have legacy nodes that can't use DHCP and
  1840. require BOOTP support, please use latest version of ISC DHCP
  1841. <ulink url="http://www.isc.org/software/dhcp"/>.</simpara>
  1842. </listitem>
  1843. <listitem>
  1844. <simpara>Interface detection is currently working on Linux
  1845. only. See <xref linkend="iface-detect"/> for details.</simpara>
  1846. </listitem>
  1847. <listitem>
  1848. <simpara><command>b10-dhcp4</command> does not verify that
  1849. assigned address is unused. According to RFC2131, the
  1850. allocating server should verify that address is no used by
  1851. sending ICMP echo request.</simpara>
  1852. </listitem>
  1853. <listitem>
  1854. <simpara>Address renewal (RENEW), rebinding (REBIND),
  1855. confirmation (CONFIRM), duplication report (DECLINE) and
  1856. release (RELEASE) are not supported yet.</simpara>
  1857. </listitem>
  1858. <listitem>
  1859. <simpara>DNS Update is not supported yet.</simpara>
  1860. </listitem>
  1861. <listitem>
  1862. <simpara>-v (verbose) command line option is currently
  1863. the default, and cannot be disabled.</simpara>
  1864. </listitem>
  1865. </itemizedlist>
  1866. </section>
  1867. </chapter>
  1868. <chapter id="dhcp6">
  1869. <title>DHCPv6 Server</title>
  1870. <para>Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is
  1871. specified in RFC3315. BIND10 provides DHCPv6 server implementation
  1872. that is described in this chapter. For a description of the DHCPv4
  1873. server implementation, see <xref linkend="dhcp4"/>.
  1874. </para>
  1875. <para>The DHCPv6 server component is currently under intense
  1876. development. You may want to check out <ulink
  1877. url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
  1878. and recent posts on <ulink
  1879. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
  1880. developers mailing list</ulink>.</para>
  1881. <para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
  1882. internally code named <quote>Kea</quote>.</para>
  1883. <note>
  1884. <para>
  1885. As of December 2011, both DHCPv4 and DHCPv6 components are
  1886. skeleton servers. That means that while they are capable of
  1887. performing DHCP configuration, they are not fully functional
  1888. yet. In particular, neither has functional lease
  1889. databases. This means that they will assign the same, fixed,
  1890. hardcoded addresses to any client that will ask. See <xref
  1891. linkend="dhcp4-limit"/> and <xref linkend="dhcp6-limit"/> for
  1892. detailed description.
  1893. </para>
  1894. </note>
  1895. <section id="dhcp6-usage">
  1896. <title>DHCPv6 Server Usage</title>
  1897. <para>
  1898. BIND10 provides the DHCPv6 server component since September
  1899. 2011. It is a skeleton server and can be described as an early
  1900. prototype that is not fully functional yet. It is mature
  1901. enough to conduct first tests in lab environment, but it has
  1902. significant limitations. See <xref linkend="dhcp6-limit"/> for
  1903. details.
  1904. </para>
  1905. <para>
  1906. The DHCPv6 server is implemented as <command>b10-dhcp6</command>
  1907. daemon. As it is not configurable yet, it is fully autonomous,
  1908. that is it does not interact with <command>b10-cfgmgr</command>.
  1909. To start DHCPv6 server, simply input:
  1910. <screen>
  1911. #<userinput>cd src/bin/dhcp6</userinput>
  1912. #<userinput>./b10-dhcp6</userinput>
  1913. </screen>
  1914. Depending on your installation, <command>b10-dhcp6</command>
  1915. binary may reside in src/bin/dhcp6 in your source code
  1916. directory, in /usr/local/bin/b10-dhcp6 or other directory
  1917. you specified during compilation.
  1918. At start, server will detect available network interfaces
  1919. and will attempt to open UDP sockets on all interfaces that
  1920. are up, running, are not loopback, are multicast-capable, and
  1921. have IPv6 address assigned.
  1922. The server will then listen to incoming traffic. Currently
  1923. supported client messages are SOLICIT and REQUEST. The server
  1924. will respond to them with ADVERTISE and REPLY, respectively.
  1925. Since the DHCPv6 server opens privileged ports, it requires root
  1926. access. Make sure you run this daemon as root.
  1927. </para>
  1928. <note>
  1929. <para>
  1930. Integration with <command>bind10</command> is
  1931. planned. Ultimately, <command>b10-dhcp6</command> will not
  1932. be started directly, but rather via
  1933. <command>bind10</command>. Please be aware of this planned
  1934. change.
  1935. </para>
  1936. </note>
  1937. </section>
  1938. <section id="dhcp6-config">
  1939. <title>DHCPv6 Server Configuration</title>
  1940. <para>
  1941. The DHCPv6 server does not have lease database implemented yet
  1942. or any support for configuration, so every time the same set
  1943. of configuration options (including the same fixed address)
  1944. will be assigned every time.
  1945. </para>
  1946. <para>
  1947. At this stage of development, the only way to alter server
  1948. configuration is to tweak its source code. To do so, please
  1949. edit src/bin/dhcp6/dhcp6_srv.cc file and modify following
  1950. parameters and recompile:
  1951. <screen>
  1952. const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
  1953. const uint32_t HARDCODED_T1 = 1500; // in seconds
  1954. const uint32_t HARDCODED_T2 = 2600; // in seconds
  1955. const uint32_t HARDCODED_PREFERRED_LIFETIME = 3600; // in seconds
  1956. const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds
  1957. const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";</screen>
  1958. Lease database and configuration support is planned for 2012.
  1959. </para>
  1960. </section>
  1961. <section id="dhcp6-std">
  1962. <title>Supported DHCPv6 Standards</title>
  1963. <para>The following standards and draft standards are currently
  1964. supported:</para>
  1965. <itemizedlist>
  1966. <listitem>
  1967. <simpara>RFC3315: Supported messages are SOLICIT,
  1968. ADVERTISE, REQUEST, and REPLY. Supported options are
  1969. SERVER_ID, CLIENT_ID, IA_NA, and IAADDRESS.</simpara>
  1970. </listitem>
  1971. <listitem>
  1972. <simpara>RFC3646: Supported option is DNS_SERVERS.</simpara>
  1973. </listitem>
  1974. </itemizedlist>
  1975. </section>
  1976. <section id="dhcp6-limit">
  1977. <title>DHCPv6 Server Limitations</title>
  1978. <para> These are the current limitations of the DHCPv6 server
  1979. software. Most of them are reflections of the early stage of
  1980. development and should be treated as <quote>not implemented
  1981. yet</quote>, rather than actual limitations.</para>
  1982. <para>
  1983. <itemizedlist>
  1984. <listitem>
  1985. <simpara>Relayed traffic is not supported.</simpara>
  1986. </listitem>
  1987. <listitem>
  1988. <simpara><command>b10-dhcp6</command> provides a single,
  1989. fixed, hardcoded lease to any client that asks. There is no
  1990. lease manager implemented. If two clients request addresses,
  1991. they will both get the same fixed address.</simpara>
  1992. </listitem>
  1993. <listitem>
  1994. <simpara><command>b10-dhcp6</command> does not support any
  1995. configuration mechanisms yet. The whole configuration is
  1996. currently hardcoded. The only way to tweak configuration
  1997. is to directly modify source code. See see <xref
  1998. linkend="dhcp6-config"/> for details.</simpara>
  1999. </listitem>
  2000. <listitem>
  2001. <simpara>Upon start, the server will open sockets on all
  2002. interfaces that are not loopback, are up, running and are
  2003. multicast capable and have IPv6 address. Support for
  2004. multiple interfaces is not coded in reception routines yet,
  2005. so if you are running this code on a machine that has many
  2006. interfaces and <command>b10-dhcp6</command> happens to
  2007. listen on wrong interface, the easiest way to work around
  2008. this problem is to turn down other interfaces. This
  2009. limitation will be fixed shortly.</simpara>
  2010. </listitem>
  2011. <listitem>
  2012. <simpara>ORO (Option Request Option, a list of options
  2013. requested by a client) is currently ignored and server
  2014. assigns DNS SERVER option.</simpara>
  2015. </listitem>
  2016. <listitem>
  2017. <simpara>Temporary addresses are not supported yet.</simpara>
  2018. </listitem>
  2019. <listitem>
  2020. <simpara>Prefix delegation is not supported yet.</simpara>
  2021. </listitem>
  2022. <listitem>
  2023. <simpara>Address renewal (RENEW), rebinding (REBIND),
  2024. confirmation (CONFIRM), duplication report (DECLINE) and
  2025. release (RELEASE) are not supported yet.</simpara>
  2026. </listitem>
  2027. <listitem>
  2028. <simpara>DNS Update is not supported yet.</simpara>
  2029. </listitem>
  2030. <listitem>
  2031. <simpara>Interface detection is currently working on Linux
  2032. only. See <xref linkend="iface-detect"/> for details.</simpara>
  2033. </listitem>
  2034. <listitem>
  2035. <simpara>-v (verbose) command line option is currently the
  2036. default, and cannot be disabled.</simpara>
  2037. </listitem>
  2038. </itemizedlist>
  2039. </para>
  2040. </section>
  2041. </chapter>
  2042. <chapter id="libdhcp">
  2043. <title>libdhcp++ library</title>
  2044. <para>libdhcp++ is a common library written in C++ that handles
  2045. many DHCP-related tasks, like DHCPv4 and DHCPv6 packets parsing,
  2046. manipulation and assembly, option parsing, manipulation and
  2047. assembly, network interface detection and socket operations, like
  2048. socket creations, data transmission and reception and socket
  2049. closing.
  2050. </para>
  2051. <para>
  2052. While this library is currently used by
  2053. <command>b10-dhcp4</command> and <command>b10-dhcp6</command>
  2054. only, it is designed to be portable, universal library useful for
  2055. any kind of DHCP-related software.
  2056. </para>
  2057. <section id="iface-detect">
  2058. <title>Interface detection</title>
  2059. <para>Both DHCPv4 and DHCPv6 components share network
  2060. interface detection routines. Interface detection is
  2061. currently only supported on Linux systems.</para>
  2062. <para>For non-Linux systems, there is currently stub
  2063. implementation provided. As DHCP servers need to know available
  2064. addresses, there is a simple mechanism implemented to provide
  2065. that information. User is expected to create interfaces.txt
  2066. file. Format of this file is simple. It contains list of
  2067. interfaces along with available address on each interface. This
  2068. mechanism is temporary and is going to be removed as soon as
  2069. interface detection becomes available on non-Linux
  2070. systems. Here is an example of the interfaces.txt file:
  2071. <screen>
  2072. # For DHCPv6, please specify link-local address (starts with fe80::)
  2073. # If in doubt, check output of 'ifconfig -a' command.
  2074. eth0 fe80::21e:8cff:fe9b:7349
  2075. # For DHCPv4, please use following format:
  2076. #eth0 192.0.2.5</screen>
  2077. </para>
  2078. </section>
  2079. <section id="packet-handling">
  2080. <title>DHCPv4/DHCPv6 packet handling</title>
  2081. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  2082. </section>
  2083. </chapter>
  2084. <chapter id="statistics">
  2085. <title>Statistics</title>
  2086. <para>
  2087. The <command>b10-stats</command> process is started by
  2088. <command>bind10</command>.
  2089. It periodically collects statistics data from various modules
  2090. and aggregates it.
  2091. <!-- TODO -->
  2092. </para>
  2093. <para>
  2094. This stats daemon provides commands to identify if it is
  2095. running, show specified or all statistics data, show specified
  2096. or all statistics data schema, and set specified statistics
  2097. data.
  2098. For example, using <command>bindctl</command>:
  2099. <screen>
  2100. &gt; <userinput>Stats show</userinput>
  2101. {
  2102. "Auth": {
  2103. "opcode.iquery": 0,
  2104. "opcode.notify": 10,
  2105. "opcode.query": 869617,
  2106. ...
  2107. "queries.tcp": 1749,
  2108. "queries.udp": 867868
  2109. },
  2110. "Boss": {
  2111. "boot_time": "2011-01-20T16:59:03Z"
  2112. },
  2113. "Stats": {
  2114. "boot_time": "2011-01-20T16:59:05Z",
  2115. "last_update_time": "2011-01-20T17:04:05Z",
  2116. "lname": "4d3869d9_a@jreed.example.net",
  2117. "report_time": "2011-01-20T17:04:06Z",
  2118. "timestamp": 1295543046.823504
  2119. }
  2120. }
  2121. </screen>
  2122. </para>
  2123. </chapter>
  2124. <chapter id="logging">
  2125. <title>Logging</title>
  2126. <section>
  2127. <title>Logging configuration</title>
  2128. <para>
  2129. The logging system in BIND 10 is configured through the
  2130. Logging module. All BIND 10 modules will look at the
  2131. configuration in Logging to see what should be logged and
  2132. to where.
  2133. <!-- TODO: what is context of Logging module for readers of this guide? -->
  2134. </para>
  2135. <section>
  2136. <title>Loggers</title>
  2137. <para>
  2138. Within BIND 10, a message is logged through a component
  2139. called a "logger". Different parts of BIND 10 log messages
  2140. through different loggers, and each logger can be configured
  2141. independently of one another.
  2142. </para>
  2143. <para>
  2144. In the Logging module, you can specify the configuration
  2145. for zero or more loggers; any that are not specified will
  2146. take appropriate default values.
  2147. </para>
  2148. <para>
  2149. The three most important elements of a logger configuration
  2150. are the <option>name</option> (the component that is
  2151. generating the messages), the <option>severity</option>
  2152. (what to log), and the <option>output_options</option>
  2153. (where to log).
  2154. </para>
  2155. <section>
  2156. <title>name (string)</title>
  2157. <para>
  2158. Each logger in the system has a name, the name being that
  2159. of the component using it to log messages. For instance,
  2160. if you want to configure logging for the resolver module,
  2161. you add an entry for a logger named <quote>Resolver</quote>. This
  2162. configuration will then be used by the loggers in the
  2163. Resolver module, and all the libraries used by it.
  2164. </para>
  2165. <!-- TODO: later we will have a way to know names of all modules
  2166. Right now you can only see what their names are if they are running
  2167. (a simple 'help' without anything else in bindctl for instance).
  2168. -->
  2169. <para>
  2170. If you want to specify logging for one specific library
  2171. within the module, you set the name to
  2172. <replaceable>module.library</replaceable>. For example, the
  2173. logger used by the nameserver address store component
  2174. has the full name of <quote>Resolver.nsas</quote>. If
  2175. there is no entry in Logging for a particular library,
  2176. it will use the configuration given for the module.
  2177. <!-- TODO: how to know these specific names?
  2178. We will either have to document them or tell the administrator to
  2179. specify module-wide logging and see what appears...
  2180. -->
  2181. </para>
  2182. <para>
  2183. <!-- TODO: severity has not been covered yet -->
  2184. To illustrate this, suppose you want the cache library
  2185. to log messages of severity DEBUG, and the rest of the
  2186. resolver code to log messages of severity INFO. To achieve
  2187. this you specify two loggers, one with the name
  2188. <quote>Resolver</quote> and severity INFO, and one with
  2189. the name <quote>Resolver.cache</quote> with severity
  2190. DEBUG. As there are no entries for other libraries (e.g.
  2191. the nsas), they will use the configuration for the module
  2192. (<quote>Resolver</quote>), so giving the desired behavior.
  2193. </para>
  2194. <para>
  2195. One special case is that of a module name of <quote>*</quote>
  2196. (asterisks), which is interpreted as <emphasis>any</emphasis>
  2197. module. You can set global logging options by using this,
  2198. including setting the logging configuration for a library
  2199. that is used by multiple modules (e.g. <quote>*.config</quote>
  2200. specifies the configuration library code in whatever
  2201. module is using it).
  2202. </para>
  2203. <para>
  2204. If there are multiple logger specifications in the
  2205. configuration that might match a particular logger, the
  2206. specification with the more specific logger name takes
  2207. precedence. For example, if there are entries for for
  2208. both <quote>*</quote> and <quote>Resolver</quote>, the
  2209. resolver module &mdash; and all libraries it uses &mdash;
  2210. will log messages according to the configuration in the
  2211. second entry (<quote>Resolver</quote>). All other modules
  2212. will use the configuration of the first entry
  2213. (<quote>*</quote>). If there was also a configuration
  2214. entry for <quote>Resolver.cache</quote>, the cache library
  2215. within the resolver would use that in preference to the
  2216. entry for <quote>Resolver</quote>.
  2217. </para>
  2218. <para>
  2219. One final note about the naming. When specifying the
  2220. module name within a logger, use the name of the module
  2221. as specified in <command>bindctl</command>, e.g.
  2222. <quote>Resolver</quote> for the resolver module,
  2223. <quote>Xfrout</quote> for the xfrout module, etc. When
  2224. the message is logged, the message will include the name
  2225. of the logger generating the message, but with the module
  2226. name replaced by the name of the process implementing
  2227. the module (so for example, a message generated by the
  2228. <quote>Auth.cache</quote> logger will appear in the output
  2229. with a logger name of <quote>b10-auth.cache</quote>).
  2230. </para>
  2231. </section>
  2232. <section>
  2233. <title>severity (string)</title>
  2234. <para>
  2235. This specifies the category of messages logged.
  2236. Each message is logged with an associated severity which
  2237. may be one of the following (in descending order of
  2238. severity):
  2239. </para>
  2240. <itemizedlist>
  2241. <listitem>
  2242. <simpara> FATAL </simpara>
  2243. </listitem>
  2244. <listitem>
  2245. <simpara> ERROR </simpara>
  2246. </listitem>
  2247. <listitem>
  2248. <simpara> WARN </simpara>
  2249. </listitem>
  2250. <listitem>
  2251. <simpara> INFO </simpara>
  2252. </listitem>
  2253. <listitem>
  2254. <simpara> DEBUG </simpara>
  2255. </listitem>
  2256. </itemizedlist>
  2257. <para>
  2258. When the severity of a logger is set to one of these
  2259. values, it will only log messages of that severity, and
  2260. the severities above it. The severity may also be set to
  2261. NONE, in which case all messages from that logger are
  2262. inhibited.
  2263. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  2264. </para>
  2265. </section>
  2266. <section>
  2267. <title>output_options (list)</title>
  2268. <para>
  2269. Each logger can have zero or more
  2270. <option>output_options</option>. These specify where log
  2271. messages are sent to. These are explained in detail below.
  2272. </para>
  2273. <para>
  2274. The other options for a logger are:
  2275. </para>
  2276. </section>
  2277. <section>
  2278. <title>debuglevel (integer)</title>
  2279. <para>
  2280. When a logger's severity is set to DEBUG, this value
  2281. specifies what debug messages should be printed. It ranges
  2282. from 0 (least verbose) to 99 (most verbose).
  2283. </para>
  2284. <!-- TODO: complete this sentence:
  2285. The general classification of debug message types is
  2286. TODO; there's a ticket to determine these levels, see #1074
  2287. -->
  2288. <para>
  2289. If severity for the logger is not DEBUG, this value is ignored.
  2290. </para>
  2291. </section>
  2292. <section>
  2293. <title>additive (true or false)</title>
  2294. <para>
  2295. If this is true, the <option>output_options</option> from
  2296. the parent will be used. For example, if there are two
  2297. loggers configured; <quote>Resolver</quote> and
  2298. <quote>Resolver.cache</quote>, and <option>additive</option>
  2299. is true in the second, it will write the log messages
  2300. not only to the destinations specified for
  2301. <quote>Resolver.cache</quote>, but also to the destinations
  2302. as specified in the <option>output_options</option> in
  2303. the logger named <quote>Resolver</quote>.
  2304. <!-- TODO: check this -->
  2305. </para>
  2306. </section>
  2307. </section>
  2308. <section>
  2309. <title>Output Options</title>
  2310. <para>
  2311. The main settings for an output option are the
  2312. <option>destination</option> and a value called
  2313. <option>output</option>, the meaning of which depends on
  2314. the destination that is set.
  2315. </para>
  2316. <section>
  2317. <title>destination (string)</title>
  2318. <para>
  2319. The destination is the type of output. It can be one of:
  2320. </para>
  2321. <itemizedlist>
  2322. <listitem>
  2323. <simpara> console </simpara>
  2324. </listitem>
  2325. <listitem>
  2326. <simpara> file </simpara>
  2327. </listitem>
  2328. <listitem>
  2329. <simpara> syslog </simpara>
  2330. </listitem>
  2331. </itemizedlist>
  2332. </section>
  2333. <section>
  2334. <title>output (string)</title>
  2335. <para>
  2336. Depending on what is set as the output destination, this
  2337. value is interpreted as follows:
  2338. </para>
  2339. <variablelist>
  2340. <varlistentry>
  2341. <term><option>destination</option> is <quote>console</quote></term>
  2342. <listitem>
  2343. <simpara>
  2344. The value of output must be one of <quote>stdout</quote>
  2345. (messages printed to standard output) or
  2346. <quote>stderr</quote> (messages printed to standard
  2347. error).
  2348. </simpara>
  2349. </listitem>
  2350. </varlistentry>
  2351. <varlistentry>
  2352. <term><option>destination</option> is <quote>file</quote></term>
  2353. <listitem>
  2354. <simpara>
  2355. The value of output is interpreted as a file name;
  2356. log messages will be appended to this file.
  2357. </simpara>
  2358. </listitem>
  2359. </varlistentry>
  2360. <varlistentry>
  2361. <term><option>destination</option> is <quote>syslog</quote></term>
  2362. <listitem>
  2363. <simpara>
  2364. The value of output is interpreted as the
  2365. <command>syslog</command> facility (e.g.
  2366. <emphasis>local0</emphasis>) that should be used
  2367. for log messages.
  2368. </simpara>
  2369. </listitem>
  2370. </varlistentry>
  2371. </variablelist>
  2372. <para>
  2373. The other options for <option>output_options</option> are:
  2374. </para>
  2375. <section>
  2376. <title>flush (true of false)</title>
  2377. <para>
  2378. Flush buffers after each log message. Doing this will
  2379. reduce performance but will ensure that if the program
  2380. terminates abnormally, all messages up to the point of
  2381. termination are output.
  2382. </para>
  2383. </section>
  2384. <section>
  2385. <title>maxsize (integer)</title>
  2386. <para>
  2387. Only relevant when destination is file, this is maximum
  2388. file size of output files in bytes. When the maximum
  2389. size is reached, the file is renamed and a new file opened.
  2390. (For example, a ".1" is appended to the name &mdash;
  2391. if a ".1" file exists, it is renamed ".2",
  2392. etc.)
  2393. </para>
  2394. <para>
  2395. If this is 0, no maximum file size is used.
  2396. </para>
  2397. </section>
  2398. <section>
  2399. <title>maxver (integer)</title>
  2400. <para>
  2401. Maximum number of old log files to keep around when
  2402. rolling the output file. Only relevant when
  2403. <option>destination</option> is <quote>file</quote>.
  2404. </para>
  2405. </section>
  2406. </section>
  2407. </section>
  2408. <section>
  2409. <title>Example session</title>
  2410. <para>
  2411. In this example we want to set the global logging to
  2412. write to the file <filename>/var/log/my_bind10.log</filename>,
  2413. at severity WARN. We want the authoritative server to
  2414. log at DEBUG with debuglevel 40, to a different file
  2415. (<filename>/tmp/debug_messages</filename>).
  2416. </para>
  2417. <para>
  2418. Start <command>bindctl</command>.
  2419. </para>
  2420. <para>
  2421. <screen>["login success "]
  2422. &gt; <userinput>config show Logging</userinput>
  2423. Logging/loggers [] list
  2424. </screen>
  2425. </para>
  2426. <para>
  2427. By default, no specific loggers are configured, in which
  2428. case the severity defaults to INFO and the output is
  2429. written to stderr.
  2430. </para>
  2431. <para>
  2432. Let's first add a default logger:
  2433. </para>
  2434. <!-- TODO: adding the empty loggers makes no sense -->
  2435. <para>
  2436. <screen><userinput>&gt; config add Logging/loggers</userinput>
  2437. &gt; <userinput>config show Logging</userinput>
  2438. Logging/loggers/ list (modified)
  2439. </screen>
  2440. </para>
  2441. <para>
  2442. The loggers value line changed to indicate that it is no
  2443. longer an empty list:
  2444. </para>
  2445. <para>
  2446. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  2447. Logging/loggers[0]/name "" string (default)
  2448. Logging/loggers[0]/severity "INFO" string (default)
  2449. Logging/loggers[0]/debuglevel 0 integer (default)
  2450. Logging/loggers[0]/additive false boolean (default)
  2451. Logging/loggers[0]/output_options [] list (default)
  2452. </screen>
  2453. </para>
  2454. <para>
  2455. The name is mandatory, so we must set it. We will also
  2456. change the severity as well. Let's start with the global
  2457. logger.
  2458. </para>
  2459. <para>
  2460. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  2461. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  2462. &gt; <userinput>config show Logging/loggers</userinput>
  2463. Logging/loggers[0]/name "*" string (modified)
  2464. Logging/loggers[0]/severity "WARN" string (modified)
  2465. Logging/loggers[0]/debuglevel 0 integer (default)
  2466. Logging/loggers[0]/additive false boolean (default)
  2467. Logging/loggers[0]/output_options [] list (default)
  2468. </screen>
  2469. </para>
  2470. <para>
  2471. Of course, we need to specify where we want the log
  2472. messages to go, so we add an entry for an output option.
  2473. </para>
  2474. <para>
  2475. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  2476. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  2477. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  2478. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  2479. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  2480. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  2481. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  2482. </screen>
  2483. </para>
  2484. <para>
  2485. These aren't the values we are looking for.
  2486. </para>
  2487. <para>
  2488. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  2489. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  2490. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  2491. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  2492. </screen>
  2493. </para>
  2494. <para>
  2495. Which would make the entire configuration for this logger
  2496. look like:
  2497. </para>
  2498. <para>
  2499. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  2500. Logging/loggers[0]/name "*" string (modified)
  2501. Logging/loggers[0]/severity "WARN" string (modified)
  2502. Logging/loggers[0]/debuglevel 0 integer (default)
  2503. Logging/loggers[0]/additive false boolean (default)
  2504. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  2505. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  2506. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  2507. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  2508. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  2509. </screen>
  2510. </para>
  2511. <para>
  2512. That looks OK, so let's commit it before we add the
  2513. configuration for the authoritative server's logger.
  2514. </para>
  2515. <para>
  2516. <screen>&gt; <userinput> config commit</userinput></screen>
  2517. </para>
  2518. <para>
  2519. Now that we have set it, and checked each value along
  2520. the way, adding a second entry is quite similar.
  2521. </para>
  2522. <para>
  2523. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  2524. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  2525. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  2526. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  2527. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  2528. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  2529. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  2530. &gt; <userinput> config commit</userinput>
  2531. </screen>
  2532. </para>
  2533. <para>
  2534. And that's it. Once we have found whatever it was we
  2535. needed the debug messages for, we can simply remove the
  2536. second logger to let the authoritative server use the
  2537. same settings as the rest.
  2538. </para>
  2539. <para>
  2540. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  2541. &gt; <userinput> config commit</userinput>
  2542. </screen>
  2543. </para>
  2544. <para>
  2545. And every module will now be using the values from the
  2546. logger named <quote>*</quote>.
  2547. </para>
  2548. </section>
  2549. </section>
  2550. <section>
  2551. <title>Logging Message Format</title>
  2552. <para>
  2553. Each message written by BIND 10 to the configured logging
  2554. destinations comprises a number of components that identify
  2555. the origin of the message and, if the message indicates
  2556. a problem, information about the problem that may be
  2557. useful in fixing it.
  2558. </para>
  2559. <para>
  2560. Consider the message below logged to a file:
  2561. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  2562. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  2563. </para>
  2564. <para>
  2565. Note: the layout of messages written to the system logging
  2566. file (syslog) may be slightly different. This message has
  2567. been split across two lines here for display reasons; in the
  2568. logging file, it will appear on one line.)
  2569. </para>
  2570. <para>
  2571. The log message comprises a number of components:
  2572. <variablelist>
  2573. <varlistentry>
  2574. <term>2011-06-15 13:48:22.034</term>
  2575. <!-- TODO: timestamp repeated even if using syslog? -->
  2576. <listitem><para>
  2577. The date and time at which the message was generated.
  2578. </para></listitem>
  2579. </varlistentry>
  2580. <varlistentry>
  2581. <term>ERROR</term>
  2582. <listitem><para>
  2583. The severity of the message.
  2584. </para></listitem>
  2585. </varlistentry>
  2586. <varlistentry>
  2587. <term>[b10-resolver.asiolink]</term>
  2588. <listitem><para>
  2589. The source of the message. This comprises two components:
  2590. the BIND 10 process generating the message (in this
  2591. case, <command>b10-resolver</command>) and the module
  2592. within the program from which the message originated
  2593. (which in the example is the asynchronous I/O link
  2594. module, asiolink).
  2595. </para></listitem>
  2596. </varlistentry>
  2597. <varlistentry>
  2598. <term>ASIODNS_OPENSOCK</term>
  2599. <listitem><para>
  2600. The message identification. Every message in BIND 10
  2601. has a unique identification, which can be used as an
  2602. index into the <ulink
  2603. url="bind10-messages.html"><citetitle>BIND 10 Messages
  2604. Manual</citetitle></ulink> (<ulink
  2605. url="http://bind10.isc.org/docs/bind10-messages.html"
  2606. />) from which more information can be obtained.
  2607. </para></listitem>
  2608. </varlistentry>
  2609. <varlistentry>
  2610. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  2611. <listitem><para>
  2612. A brief description of the cause of the problem.
  2613. Within this text, information relating to the condition
  2614. that caused the message to be logged will be included.
  2615. In this example, error number 111 (an operating
  2616. system-specific error number) was encountered when
  2617. trying to open a TCP connection to port 53 on the
  2618. local system (address 127.0.0.1). The next step
  2619. would be to find out the reason for the failure by
  2620. consulting your system's documentation to identify
  2621. what error number 111 means.
  2622. </para></listitem>
  2623. </varlistentry>
  2624. </variablelist>
  2625. </para>
  2626. </section>
  2627. </chapter>
  2628. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  2629. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  2630. <!-- <index> <title>Index</title> </index> -->
  2631. </book>
  2632. <!--
  2633. TODO:
  2634. Overview
  2635. Getting BIND 10 Installed
  2636. Basics
  2637. Dependencies
  2638. Optional
  2639. Advanced
  2640. How Does Everything Work Together?
  2641. Need Help?
  2642. -->