bind10-guide.xml 130 KB

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