bind10-guide.xml 126 KB

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