bind10-guide.xml 168 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2014;" >
  5. <!ENTITY % version SYSTEM "version.ent">
  6. %version;
  7. ]>
  8. <!--
  9. - Copyright (C) 2010-2012 Internet Systems Consortium, Inc. ("ISC")
  10. -
  11. - Permission to use, copy, modify, and/or distribute this software for any
  12. - purpose with or without fee is hereby granted, provided that the above
  13. - copyright notice and this permission notice appear in all copies.
  14. -
  15. - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  16. - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  17. - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  18. - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  19. - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  20. - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21. - PERFORMANCE OF THIS SOFTWARE.
  22. -->
  23. <book>
  24. <?xml-stylesheet href="bind10-guide.css" type="text/css"?>
  25. <bookinfo>
  26. <title>BIND 10 Guide</title>
  27. <subtitle>Administrator Reference for BIND 10</subtitle>
  28. <copyright>
  29. <year>2010-2012</year><holder>Internet Systems Consortium, Inc.</holder>
  30. </copyright>
  31. <abstract>
  32. <para>BIND 10 is a framework that features Domain Name System
  33. (DNS) suite and Dynamic Host Configuration Protocol (DHCP)
  34. servers with development managed by Internet Systems Consortium (ISC).
  35. It includes DNS libraries, modular components for controlling
  36. authoritative and recursive DNS servers, and experimental DHCPv4
  37. and DHCPv6 servers.
  38. </para>
  39. <para>
  40. This is the reference guide for BIND 10 version &__VERSION__;.
  41. The most up-to-date version of this document (in PDF, HTML,
  42. and plain text formats), along with other documents for
  43. BIND 10, can be found at <ulink url="http://bind10.isc.org/docs"/>.
  44. </para> </abstract>
  45. <releaseinfo>This is the reference guide for BIND 10 version
  46. &__VERSION__;.</releaseinfo>
  47. </bookinfo>
  48. <preface>
  49. <title>Preface</title>
  50. <section id="acknowledgements">
  51. <title>Acknowledgements</title>
  52. <!-- TODO: acknowledge all sponsors and CNNIC and CZNIC too -->
  53. <para>ISC would like to acknowledge generous support for
  54. BIND 10 development of DHCPv4 and DHCPv6 components provided
  55. by <ulink url="http://www.comcast.com/">Comcast</ulink>.</para>
  56. </section>
  57. </preface>
  58. <chapter id="intro">
  59. <title>Introduction</title>
  60. <para>
  61. BIND is the popular implementation of a DNS server, developer
  62. interfaces, and DNS tools.
  63. BIND 10 is a rewrite of BIND 9 and ISC DHCP.
  64. BIND 10 is written in C++ and Python and provides a modular
  65. environment for serving, maintaining, and developing DNS and DHCP.
  66. BIND 10 provides a EDNS0- and DNSSEC-capable authoritative
  67. DNS server and a caching recursive name server which also
  68. provides forwarding.
  69. It also provides experimental DHCPv4 and DHCPv6 servers.
  70. </para>
  71. <para>
  72. This guide covers the experimental prototype of
  73. BIND 10 version &__VERSION__;.
  74. </para>
  75. <section>
  76. <title>Supported Platforms</title>
  77. <para>
  78. BIND 10 builds have been tested on (in no particular order)
  79. Debian GNU/Linux 6 and unstable, Ubuntu 9.10, NetBSD 5,
  80. Solaris 10 and 11, FreeBSD 7 and 8, CentOS Linux 5.3,
  81. MacOS 10.6 and 10.7, and OpenBSD 5.1.
  82. It has been tested on Sparc, i386, and amd64 hardware
  83. platforms.
  84. It is planned for BIND 10 to build, install and run on
  85. Windows and standard Unix-type platforms.
  86. </para>
  87. </section>
  88. <section id="required-software">
  89. <title>Required Software at Run-time</title>
  90. <para>
  91. Running BIND 10 uses various extra software which may
  92. not be provided in some operating systems' default
  93. installations nor standard packages collections. You may
  94. need to install this required software separately.
  95. (For the build requirements, also see
  96. <xref linkend="build-requirements"/>.)
  97. </para>
  98. <para>
  99. BIND 10 requires at least Python 3.1
  100. (<ulink url="http://www.python.org/"/>).
  101. It also works with Python 3.2.
  102. </para>
  103. <para>
  104. BIND 10 uses the Botan crypto library for C++
  105. (<ulink url="http://botan.randombit.net/"/>).
  106. It requires at least Botan version 1.8.
  107. </para>
  108. <para>
  109. BIND 10 uses the log4cplus C++ logging library
  110. (<ulink url="http://log4cplus.sourceforge.net/"/>).
  111. It requires at least log4cplus version 1.0.3.
  112. <!-- TODO: It is recommended to use at least version .... -->
  113. </para>
  114. <para>
  115. The authoritative DNS server uses SQLite3
  116. (<ulink url="http://www.sqlite.org/"/>).
  117. <!-- TODO: is this still required? -->
  118. It needs at least SQLite version 3.3.9.
  119. </para>
  120. <para>
  121. The <command>b10-ddns</command>, <command>b10-xfrin</command>,
  122. <command>b10-xfrout</command>, and <command>b10-zonemgr</command>
  123. components require the libpython3 library and the Python
  124. _sqlite3.so module (which is included with Python).
  125. Python modules need to be built for the corresponding Python 3.
  126. </para>
  127. <!-- TODO: this will change ... -->
  128. </section>
  129. <section id="starting_stopping">
  130. <title>Starting and Stopping the Server</title>
  131. <para>
  132. BIND 10 is modular. Part of this modularity is
  133. accomplished using multiple cooperating processes which, together,
  134. provide the server functionality. This is a change from
  135. the previous generation of BIND software, which used a
  136. single process.
  137. </para>
  138. <para>
  139. At first, running many different processes may seem confusing.
  140. However, these processes are started, stopped, and maintained
  141. by a single command, <command>bind10</command>.
  142. This command starts a master process which will start other
  143. processes as needed.
  144. The processes started by the <command>bind10</command>
  145. command have names starting with "b10-", including:
  146. </para>
  147. <para>
  148. <itemizedlist>
  149. <listitem>
  150. <simpara>
  151. <command>b10-auth</command> &mdash;
  152. Authoritative DNS server.
  153. This process serves DNS requests.
  154. </simpara>
  155. </listitem>
  156. <listitem>
  157. <simpara>
  158. <command>b10-cfgmgr</command> &mdash;
  159. Configuration manager.
  160. This process maintains all of the configuration for BIND 10.
  161. </simpara>
  162. </listitem>
  163. <listitem>
  164. <simpara>
  165. <command>b10-cmdctl</command> &mdash;
  166. Command and control service.
  167. This process allows external control of the BIND 10 system.
  168. </simpara>
  169. </listitem>
  170. <listitem>
  171. <simpara>
  172. <command>b10-ddns</command> &mdash;
  173. Dynamic DNS update service.
  174. This process is used to handle incoming DNS update
  175. requests to allow granted clients to update zones
  176. for which BIND 10 is serving as a primary server.
  177. </simpara>
  178. </listitem>
  179. <listitem>
  180. <simpara>
  181. <command>b10-msgq</command> &mdash;
  182. Message bus daemon.
  183. This process coordinates communication between all of the other
  184. BIND 10 processes.
  185. </simpara>
  186. </listitem>
  187. <listitem>
  188. <simpara>
  189. <command>b10-resolver</command> &mdash;
  190. Recursive name server.
  191. This process handles incoming DNS queries and provides
  192. answers from its cache or by recursively doing remote lookups.
  193. </simpara>
  194. </listitem>
  195. <listitem>
  196. <simpara>
  197. <command>b10-sockcreator</command> &mdash;
  198. Socket creator daemon.
  199. This process creates sockets used by
  200. network-listening BIND 10 processes.
  201. </simpara>
  202. </listitem>
  203. <listitem>
  204. <simpara>
  205. <command>b10-stats</command> &mdash;
  206. Statistics collection daemon.
  207. This process collects and reports statistics data.
  208. </simpara>
  209. </listitem>
  210. <listitem>
  211. <simpara>
  212. <command>b10-stats-httpd</command> &mdash;
  213. HTTP server for statistics reporting.
  214. This process reports statistics data in XML format over HTTP.
  215. </simpara>
  216. </listitem>
  217. <listitem>
  218. <simpara>
  219. <command>b10-xfrin</command> &mdash;
  220. Incoming zone transfer service.
  221. This process is used to transfer a new copy
  222. of a zone into BIND 10, when acting as a secondary server.
  223. </simpara>
  224. </listitem>
  225. <listitem>
  226. <simpara>
  227. <command>b10-xfrout</command> &mdash;
  228. Outgoing zone transfer service.
  229. This process is used to handle transfer requests to
  230. send a local zone to a remote secondary server.
  231. </simpara>
  232. </listitem>
  233. <listitem>
  234. <simpara>
  235. <command>b10-zonemgr</command> &mdash;
  236. Secondary zone manager.
  237. This process keeps track of timers and other
  238. necessary information for BIND 10 to act as a slave server.
  239. </simpara>
  240. </listitem>
  241. </itemizedlist>
  242. </para>
  243. <para>
  244. These are ran by <command>bind10</command>
  245. and do not need to be manually started independently.
  246. </para>
  247. </section>
  248. <section id="managing_once_running">
  249. <title>Managing BIND 10</title>
  250. <para>
  251. Once BIND 10 is running, a few commands are used to interact
  252. directly with the system:
  253. <itemizedlist>
  254. <listitem>
  255. <simpara>
  256. <command>bindctl</command> &mdash;
  257. Interactive administration interface.
  258. This is a low-level command-line tool which allows
  259. a developer or an experienced administrator to control
  260. BIND 10.
  261. </simpara>
  262. </listitem>
  263. <listitem>
  264. <simpara>
  265. <command>b10-loadzone</command> &mdash;
  266. Zone file loader.
  267. This tool will load standard masterfile-format zone files into
  268. BIND 10.
  269. </simpara>
  270. </listitem>
  271. <listitem>
  272. <simpara>
  273. <command>b10-cmdctl-usermgr</command> &mdash;
  274. User access control.
  275. This tool allows an administrator to authorize additional users
  276. to manage BIND 10.
  277. </simpara>
  278. </listitem>
  279. <!-- TODO usermgr -->
  280. </itemizedlist>
  281. </para>
  282. </section>
  283. <para>
  284. The tools and modules are covered in full detail in this guide.
  285. <!-- TODO point to these -->
  286. In addition, manual pages are also provided in the default installation.
  287. </para>
  288. <!--
  289. bin/
  290. bindctl*
  291. host*
  292. lib/
  293. libauth
  294. libdns
  295. libexceptions
  296. python3.1/site-packages/isc/{cc,config}
  297. sbin/
  298. bind10
  299. share/
  300. share/bind10/
  301. auth.spec
  302. b10-cmdctl.pem
  303. bob.spec
  304. passwd.csv
  305. man/
  306. var/
  307. bind10/b10-config.db
  308. -->
  309. <para>
  310. BIND 10 also provides libraries and programmer interfaces
  311. for C++ and Python for the message bus, configuration backend,
  312. and, of course, DNS. These include detailed developer
  313. documentation and code examples.
  314. <!-- TODO: DHCP also but no Python yet. -->
  315. <!-- TODO point to this -->
  316. </para>
  317. </chapter>
  318. <chapter id="installation">
  319. <title>Installation</title>
  320. <section id="packages">
  321. <title>Packages</title>
  322. <para>
  323. Some operating systems or softare package vendors may
  324. provide ready-to-use, pre-built software packages for
  325. the BIND 10 suite.
  326. Installing a pre-built package means you do not need to
  327. install build-only prerequisites and do not need to
  328. <emphasis>make</emphasis> the software.
  329. </para>
  330. <para>
  331. FreeBSD ports, NetBSD pkgsrc, and Debian
  332. <emphasis>testing</emphasis> package collections provide
  333. all the prerequisite packages.
  334. </para>
  335. </section>
  336. <section id="install-hierarchy">
  337. <title>Install Hierarchy</title>
  338. <para>
  339. The following is the standard, common layout of the
  340. complete BIND 10 installation:
  341. <itemizedlist>
  342. <listitem>
  343. <simpara>
  344. <filename>bin/</filename> &mdash;
  345. general tools and diagnostic clients.
  346. </simpara>
  347. </listitem>
  348. <listitem>
  349. <simpara>
  350. <filename>etc/bind10-devel/</filename> &mdash;
  351. configuration files.
  352. </simpara>
  353. </listitem>
  354. <listitem>
  355. <simpara>
  356. <filename>lib/</filename> &mdash;
  357. libraries and python modules.
  358. </simpara>
  359. </listitem>
  360. <listitem>
  361. <simpara>
  362. <filename>libexec/bind10-devel/</filename> &mdash;
  363. executables that a user wouldn't normally run directly and
  364. are not run independently.
  365. These are the BIND 10 modules which are daemons started by
  366. the <command>bind10</command> tool.
  367. </simpara>
  368. </listitem>
  369. <listitem>
  370. <simpara>
  371. <filename>sbin/</filename> &mdash;
  372. commands used by the system administrator.
  373. </simpara>
  374. </listitem>
  375. <listitem>
  376. <simpara>
  377. <filename>share/bind10-devel/</filename> &mdash;
  378. configuration specifications.
  379. </simpara>
  380. </listitem>
  381. <listitem>
  382. <simpara>
  383. <filename>share/doc/bind10-devel/</filename> &mdash;
  384. this guide and other supplementary documentation.
  385. </simpara>
  386. </listitem>
  387. <listitem>
  388. <simpara>
  389. <filename>share/man/</filename> &mdash;
  390. manual pages (online documentation).
  391. </simpara>
  392. </listitem>
  393. <listitem>
  394. <simpara>
  395. <filename>var/bind10-devel/</filename> &mdash;
  396. data source and configuration databases.
  397. </simpara>
  398. </listitem>
  399. </itemizedlist>
  400. </para>
  401. </section>
  402. <section id="build-requirements">
  403. <title>Building Requirements</title>
  404. <para>
  405. In addition to the run-time requirements (listed in
  406. <xref linkend="required-software"/>), building BIND 10
  407. from source code requires various development include headers and
  408. program development tools.
  409. </para>
  410. <note>
  411. <simpara>
  412. Some operating systems have split their distribution packages into
  413. a run-time and a development package. You will need to install
  414. the development package versions, which include header files and
  415. libraries, to build BIND 10 from source code.
  416. </simpara>
  417. </note>
  418. <para>
  419. Building from source code requires the Boost
  420. build-time headers
  421. (<ulink url="http://www.boost.org/"/>).
  422. At least Boost version 1.35 is required.
  423. <!-- TODO: we don't check for this version -->
  424. <!-- NOTE: jreed has tested with 1.34, 1.38, and 1.41. -->
  425. </para>
  426. <para>
  427. To build BIND 10, also install the Botan (at least version
  428. 1.8) and the log4cplus (at least version 1.0.3)
  429. development include headers.
  430. </para>
  431. <!--
  432. TODO
  433. Debian and Ubuntu:
  434. libgmp3-dev and libbz2-dev required for botan too
  435. -->
  436. <!-- NOTE: _sqlite3 is only needed at test time; it is already listed
  437. as a dependency earlier -->
  438. <para>
  439. Building BIND 10 also requires a C++ compiler and
  440. standard development headers, make, and pkg-config.
  441. BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
  442. 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10.
  443. </para>
  444. <para>
  445. Visit the user-contributed wiki at <ulink
  446. url="http://bind10.isc.org/wiki/SystemSpecificNotes" />
  447. for system-specific installation tips.
  448. </para>
  449. </section>
  450. <section id="quickstart">
  451. <title>Quick start</title>
  452. <note>
  453. <simpara>
  454. This quickly covers the standard steps for installing
  455. and deploying BIND 10 as an authoritative name server using
  456. its defaults. For troubleshooting, full customizations and further
  457. details, see the respective chapters in the BIND 10 guide.
  458. </simpara>
  459. </note>
  460. <para>
  461. To quickly get started with BIND 10, follow these steps.
  462. </para>
  463. <orderedlist>
  464. <listitem>
  465. <simpara>
  466. Install required run-time and build dependencies.
  467. </simpara>
  468. </listitem>
  469. <listitem>
  470. <simpara>
  471. Download the BIND 10 source tar file from
  472. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  473. </simpara>
  474. </listitem>
  475. <listitem>
  476. <para>Extract the tar file:
  477. <screen>$ <userinput>gzcat bind10-<replaceable>VERSION</replaceable>.tar.gz | tar -xvf -</userinput></screen>
  478. </para>
  479. </listitem>
  480. <listitem>
  481. <para>Go into the source and run configure:
  482. <screen>$ <userinput>cd bind10-<replaceable>VERSION</replaceable></userinput>
  483. $ <userinput>./configure</userinput></screen>
  484. </para>
  485. </listitem>
  486. <listitem>
  487. <para>Build it:
  488. <screen>$ <userinput>make</userinput></screen>
  489. </para>
  490. </listitem>
  491. <listitem>
  492. <para>Install it (to default /usr/local):
  493. <screen>$ <userinput>make install</userinput></screen>
  494. </para>
  495. </listitem>
  496. <listitem>
  497. <para>Start the server:
  498. <screen>$ <userinput>/usr/local/sbin/bind10</userinput></screen>
  499. </para>
  500. </listitem>
  501. <listitem>
  502. <!-- TODO: this is wrong; b10-auth is not started by default any more -->
  503. <para>Test it; for example:
  504. <screen>$ <userinput>dig @127.0.0.1 -c CH -t TXT authors.bind</userinput></screen>
  505. </para>
  506. </listitem>
  507. <listitem>
  508. <para>Load desired zone file(s), for example:
  509. <screen>$ <userinput>b10-loadzone <replaceable>your.zone.example.org</replaceable></userinput></screen>
  510. </para>
  511. </listitem>
  512. <listitem>
  513. <simpara>
  514. Test the new zone.
  515. </simpara>
  516. </listitem>
  517. </orderedlist>
  518. </section>
  519. <section id="install">
  520. <title>Installation from source</title>
  521. <para>
  522. BIND 10 is open source software written in C++ and Python.
  523. It is freely available in source code form from ISC as a
  524. downloadable tar file or via BIND 10's Git code revision control
  525. service. (It may also be available in pre-compiled ready-to-use
  526. packages from operating system vendors.)
  527. </para>
  528. <section>
  529. <title>Download Tar File</title>
  530. <para>
  531. Downloading a release tar file is the recommended method to
  532. obtain the source code.
  533. </para>
  534. <para>
  535. The BIND 10 releases are available as tar file downloads from
  536. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  537. Periodic development snapshots may also be available.
  538. </para>
  539. <!-- TODO -->
  540. </section>
  541. <section>
  542. <title>Retrieve from Git</title>
  543. <para>
  544. Downloading this "bleeding edge" code is recommended only for
  545. developers or advanced users. Using development code in a production
  546. environment is not recommended.
  547. </para>
  548. <note>
  549. <para>
  550. When using source code retrieved via Git, additional
  551. software will be required: automake (v1.11 or newer),
  552. libtoolize, and autoconf (2.59 or newer).
  553. These may need to be installed.
  554. </para>
  555. </note>
  556. <para>
  557. The latest development code (and temporary experiments
  558. and un-reviewed code) is available via the BIND 10 code revision
  559. control system. This is powered by Git and all the BIND 10
  560. development is public.
  561. The leading development is done in the <quote>master</quote>
  562. branch.
  563. </para>
  564. <para>
  565. The code can be checked out from
  566. <filename>git://git.bind10.isc.org/bind10</filename>;
  567. for example:
  568. <screen>$ <userinput>git clone git://git.bind10.isc.org/bind10</userinput></screen>
  569. </para>
  570. <para>
  571. When checking out the code from
  572. the code version control system, it doesn't include the
  573. generated configure script, Makefile.in files, nor their
  574. related build files.
  575. They can be created by running <command>autoreconf</command>
  576. with the <option>--install</option> switch.
  577. This will run <command>autoconf</command>,
  578. <command>aclocal</command>,
  579. <command>libtoolize</command>,
  580. <command>autoheader</command>,
  581. <command>automake</command>,
  582. and related commands.
  583. </para>
  584. </section>
  585. <section>
  586. <title>Configure before the build</title>
  587. <para>
  588. BIND 10 uses the GNU Build System to discover build environment
  589. details.
  590. To generate the makefiles using the defaults, simply run:
  591. <screen>$ <userinput>./configure</userinput></screen>
  592. </para>
  593. <para>
  594. Run <command>./configure</command> with the <option>--help</option>
  595. switch to view the different options. Some commonly-used options are:
  596. <variablelist>
  597. <varlistentry>
  598. <term>--prefix</term>
  599. <listitem>
  600. <simpara>Define the installation location (the
  601. default is <filename>/usr/local/</filename>).
  602. </simpara>
  603. </listitem>
  604. </varlistentry>
  605. <varlistentry>
  606. <term>--with-boost-include</term>
  607. <listitem>
  608. <simpara>Define the path to find the Boost headers.
  609. </simpara>
  610. </listitem>
  611. </varlistentry>
  612. <varlistentry>
  613. <term>--with-pythonpath</term>
  614. <listitem>
  615. <simpara>Define the path to Python 3.1 if it is not in the
  616. standard execution path.
  617. </simpara>
  618. </listitem>
  619. </varlistentry>
  620. <varlistentry>
  621. <term>--with-gtest</term>
  622. <listitem>
  623. <simpara>Enable building the C++ Unit Tests using the
  624. Google Tests framework. Optionally this can define the
  625. path to the gtest header files and library.
  626. </simpara>
  627. </listitem>
  628. </varlistentry>
  629. </variablelist>
  630. </para>
  631. <!-- TODO: lcov -->
  632. <para>
  633. For example, the following configures it to
  634. find the Boost headers, find the
  635. Python interpreter, and sets the installation location:
  636. <screen>$ <userinput>./configure \
  637. --with-boost-include=/usr/pkg/include \
  638. --with-pythonpath=/usr/pkg/bin/python3.1 \
  639. --prefix=/opt/bind10</userinput></screen>
  640. </para>
  641. <para>
  642. If the configure fails, it may be due to missing or old
  643. dependencies.
  644. </para>
  645. </section>
  646. <section>
  647. <title>Build</title>
  648. <para>
  649. After the configure step is complete, to build the executables
  650. from the C++ code and prepare the Python scripts, run:
  651. <screen>$ <userinput>make</userinput></screen>
  652. </para>
  653. </section>
  654. <section>
  655. <title>Install</title>
  656. <para>
  657. To install the BIND 10 executables, support files,
  658. and documentation, run:
  659. <screen>$ <userinput>make install</userinput></screen>
  660. </para>
  661. <note>
  662. <para>The install step may require superuser privileges.</para>
  663. </note>
  664. </section>
  665. <!-- TODO: tests -->
  666. </section>
  667. <!--
  668. <section id="install.troubleshooting">
  669. <title>Troubleshooting</title>
  670. <para>
  671. </para>
  672. </section>
  673. -->
  674. </chapter>
  675. <chapter id="bind10">
  676. <title>Starting BIND 10 with <command>bind10</command></title>
  677. <para>
  678. BIND 10 provides the <command>bind10</command> command which
  679. starts up the required processes.
  680. <command>bind10</command>
  681. will also restart some processes that exit unexpectedly.
  682. This is the only command needed to start the BIND 10 system.
  683. </para>
  684. <para>
  685. After starting the <command>b10-msgq</command> communications channel,
  686. <command>bind10</command> connects to it,
  687. runs the configuration manager, and reads its own configuration.
  688. Then it starts the other modules.
  689. </para>
  690. <para>
  691. The <command>b10-sockcreator</command>, <command>b10-msgq</command> and
  692. <command>b10-cfgmgr</command>
  693. services make up the core. The <command>b10-msgq</command> daemon
  694. provides the communication channel between every part of the system.
  695. The <command>b10-cfgmgr</command> daemon is always needed by every
  696. module, if only to send information about themselves somewhere,
  697. but more importantly to ask about their own settings, and
  698. about other modules. The <command>b10-sockcreator</command> daemon
  699. helps allocate Internet addresses and ports as needed for BIND 10
  700. network services.
  701. </para>
  702. <para>
  703. In its default configuration, the <command>bind10</command>
  704. master process will also start up
  705. <command>b10-cmdctl</command> for administration tools to
  706. communicate with the system, and
  707. <command>b10-stats</command> for statistics collection.
  708. </para>
  709. <section id="start">
  710. <title>Starting BIND 10</title>
  711. <para>
  712. To start the BIND 10 service, simply run <command>bind10</command>.
  713. Run it with the <option>--verbose</option> switch to
  714. get additional debugging or diagnostic output.
  715. </para>
  716. <!-- TODO: note it doesn't go into background -->
  717. <note>
  718. <para>
  719. If the setproctitle Python module is detected at start up,
  720. the process names for the Python-based daemons will be renamed
  721. to better identify them instead of just <quote>python</quote>.
  722. This is not needed on some operating systems.
  723. </para>
  724. </note>
  725. </section>
  726. <section id="bind10.config">
  727. <title>Configuration to start processes</title>
  728. <para>
  729. The processes to be used can be configured for
  730. <command>bind10</command> to start, with the exception
  731. of the required <command>b10-sockcreator</command>,
  732. <command>b10-msgq</command> and <command>b10-cfgmgr</command>
  733. components.
  734. The configuration is in the <varname>Boss/components</varname>
  735. section. Each element represents one component, which is
  736. an abstraction of a process.
  737. </para>
  738. <para>
  739. To add a process to the set, let's say the resolver (which
  740. is not started by default), you would do this:
  741. <screen>&gt; <userinput>config add Boss/components b10-resolver</userinput>
  742. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  743. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  744. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  745. &gt; <userinput>config commit</userinput></screen></para>
  746. <para>
  747. Now, what it means. We add an entry called
  748. <quote>b10-resolver</quote>. It is both a name used to
  749. reference this component in the configuration and the name
  750. of the process to start. Then we set some parameters on
  751. how to start it.
  752. </para>
  753. <para>
  754. The <varname>special</varname> setting is for components
  755. that need some kind of special care during startup or
  756. shutdown. Unless specified, the component is started in a
  757. usual way. This is the list of components that need to be
  758. started in a special way, with the value of special used
  759. for them:
  760. <!-- TODO: this still doesn't explain why they are special -->
  761. <table>
  762. <title>Special startup components</title>
  763. <tgroup cols='3' align='left'>
  764. <colspec colname='component'/>
  765. <colspec colname='special'/>
  766. <colspec colname='description'/>
  767. <thead><row><entry>Component</entry><entry>Special</entry><entry>Description</entry></row></thead>
  768. <tbody>
  769. <row><entry>b10-auth</entry><entry>auth</entry><entry>Authoritative DNS server</entry></row>
  770. <row><entry>b10-resolver</entry><entry>resolver</entry><entry>DNS resolver</entry></row>
  771. <row><entry>b10-cmdctl</entry><entry>cmdctl</entry><entry>Command control (remote control interface)</entry></row>
  772. <!-- TODO Either add xfrin and xfrout as well or clean up the workarounds in boss before the release -->
  773. </tbody>
  774. </tgroup>
  775. </table>
  776. </para>
  777. <para>
  778. The <varname>kind</varname> specifies how a failure of the
  779. component should be handled. If it is set to
  780. <quote>dispensable</quote> (the default unless you set
  781. something else), it will get started again if it fails. If
  782. it is set to <quote>needed</quote> and it fails at startup,
  783. the whole <command>bind10</command> shuts down and exits
  784. with an error exit code. But if it fails some time later, it
  785. is just started again. If you set it to <quote>core</quote>,
  786. you indicate that the system is not usable without the
  787. component and if such component fails, the system shuts
  788. down no matter when the failure happened. This is the
  789. behaviour of the core components (the ones you can't turn
  790. off), but you can declare any other components as core as
  791. well if you wish (but you can turn these off, they just
  792. can't fail).
  793. </para>
  794. <para>
  795. The <varname>priority</varname> defines order in which the
  796. components should start. The ones with higher numbers are
  797. started sooner than the ones with lower ones. If you don't
  798. set it, 0 (zero) is used as the priority. Usually, leaving
  799. it at the default is enough.
  800. </para>
  801. <para>
  802. There are other parameters we didn't use in our example.
  803. One of them is <varname>address</varname>. It is the address
  804. used by the component on the <command>b10-msgq</command>
  805. message bus. The special components already know their
  806. address, but the usual ones don't. The address is by
  807. convention the thing after <emphasis>b10-</emphasis>, with
  808. the first letter capitalized (eg. <command>b10-stats</command>
  809. would have <quote>Stats</quote> as its address).
  810. <!-- TODO: this should be simplified so we don't even have to document it -->
  811. </para>
  812. <!-- TODO: what does "The special components already know their
  813. address, but the usual ones don't." mean? -->
  814. <!-- TODO: document params when is enabled -->
  815. <para>
  816. The last one is <varname>process</varname>. It is the name
  817. of the process to be started. It defaults to the name of
  818. the component if not set, but you can use this to override
  819. it. (The special components also already know their
  820. executable name.)
  821. </para>
  822. <!-- TODO Add parameters when they work, not implemented yet-->
  823. <note>
  824. <para>
  825. The configuration is quite powerful, but that includes
  826. a lot of space for mistakes. You could turn off the
  827. <command>b10-cmdctl</command>, but then you couldn't
  828. change it back the usual way, as it would require it to
  829. be running (you would have to find and edit the configuration
  830. directly). Also, some modules might have dependencies:
  831. <command>b10-stats-httpd</command> needs
  832. <command>b10-stats</command>, <command>b10-xfrout</command>
  833. needs <command>b10-auth</command> to be running, etc.
  834. <!-- TODO: should we define dependencies? -->
  835. </para>
  836. <para>
  837. In short, you should think twice before disabling something here.
  838. </para>
  839. </note>
  840. <para>
  841. It is possible to start some components multiple times (currently
  842. <command>b10-auth</command> and <command>b10-resolver</command>).
  843. You might want to do that to gain more performance (each one uses only
  844. single core). Just put multiple entries under different names, like
  845. this, with the same config:
  846. <screen>&gt; <userinput>config add Boss/components b10-resolver-2</userinput>
  847. &gt; <userinput>config set Boss/components/b10-resolver-2/special resolver</userinput>
  848. &gt; <userinput>config set Boss/components/b10-resolver-2/kind needed</userinput>
  849. &gt; <userinput>config commit</userinput></screen>
  850. </para>
  851. <para>
  852. However, this is work in progress and the support is not yet complete.
  853. For example, each resolver will have its own cache, each authoritative
  854. server will keep its own copy of in-memory data and there could be
  855. problems with locking the sqlite database, if used. The configuration
  856. might be changed to something more convenient in future.
  857. Other components don't expect such a situation, so it would
  858. probably not do what you want. Such support is yet to be
  859. implemented.
  860. </para>
  861. </section>
  862. </chapter>
  863. <chapter id="msgq">
  864. <title>Command channel</title>
  865. <para>
  866. The BIND 10 components use the <command>b10-msgq</command>
  867. message routing daemon to communicate with other BIND 10 components.
  868. The <command>b10-msgq</command> implements what is called the
  869. <quote>Command Channel</quote>.
  870. Processes intercommunicate by sending messages on the command
  871. channel.
  872. Example messages include shutdown, get configurations, and set
  873. configurations.
  874. This Command Channel is not used for DNS message passing.
  875. It is used only to control and monitor the BIND 10 system.
  876. </para>
  877. <para>
  878. Administrators do not communicate directly with the
  879. <command>b10-msgq</command> daemon.
  880. By default, BIND 10 uses a UNIX domain socket file named
  881. <filename>/usr/local/var/bind10-devel/msg_socket</filename>
  882. for this interprocess communication.
  883. </para>
  884. </chapter>
  885. <chapter id="cfgmgr">
  886. <title>Configuration manager</title>
  887. <para>
  888. The configuration manager, <command>b10-cfgmgr</command>,
  889. handles all BIND 10 system configuration. It provides
  890. persistent storage for configuration, and notifies running
  891. modules of configuration changes.
  892. </para>
  893. <para>
  894. The <command>b10-auth</command> and <command>b10-xfrin</command>
  895. daemons and other components receive their configurations
  896. from the configuration manager over the <command>b10-msgq</command>
  897. command channel.
  898. </para>
  899. <para>The administrator doesn't connect to it directly, but
  900. uses a user interface to communicate with the configuration
  901. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  902. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  903. </para>
  904. <!-- TODO -->
  905. <note>
  906. <para>
  907. The development prototype release only provides
  908. <command>bindctl</command> as a user interface to
  909. <command>b10-cmdctl</command>.
  910. Upcoming releases will provide another interactive command-line
  911. interface and a web-based interface.
  912. </para>
  913. </note>
  914. <para>
  915. The <command>b10-cfgmgr</command> daemon can send all
  916. specifications and all current settings to the
  917. <command>bindctl</command> client (via
  918. <command>b10-cmdctl</command>).
  919. <command>b10-cfgmgr</command> relays configurations received
  920. from <command>b10-cmdctl</command> to the appropriate modules.
  921. </para>
  922. <!-- TODO:
  923. Configuration settings for itself are defined as ConfigManager.
  924. TODO: show examples
  925. -->
  926. <!-- TODO:
  927. config changes are actually commands to cfgmgr
  928. -->
  929. <!-- TODO: what about run time config to change this? -->
  930. <!-- jelte: > config set cfgmgr/config_database <file> -->
  931. <!-- TODO: what about command line switch to change this? -->
  932. <para>
  933. The stored configuration file is at
  934. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  935. (The directory is what was defined at build configure time for
  936. <option>--localstatedir</option>.
  937. The default is <filename>/usr/local/var/</filename>.)
  938. The format is loosely based on JSON and is directly parseable
  939. python, but this may change in a future version.
  940. This configuration data file is not manually edited by the
  941. administrator.
  942. </para>
  943. <!--
  944. Well the specfiles have a more fixed format (they must contain specific
  945. stuff), but those are also directly parseable python structures (and
  946. 'coincidentally', our data::element string representation is the same)
  947. loosely based on json, tweaked to be directly parseable in python, but a
  948. subset of that.
  949. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  950. nope, spec files are written by module developers, and db should be done
  951. through bindctl and friends
  952. -->
  953. <para>
  954. The configuration manager does not have any command line arguments.
  955. Normally it is not started manually, but is automatically
  956. started using the <command>bind10</command> master process
  957. (as covered in <xref linkend="bind10"/>).
  958. </para>
  959. <!-- TODO: upcoming plans:
  960. configuration for configuration manager itself. And perhaps we might
  961. change the messaging protocol, but an admin should never see any of that
  962. -->
  963. <!-- TODO: show examples, test this -->
  964. <!--
  965. , so an admin can simply run bindctl,
  966. do config show, and it shows all modules; config show >module> shows all
  967. options for that module
  968. -->
  969. </chapter>
  970. <chapter id="cmdctl">
  971. <title>Remote control daemon</title>
  972. <para>
  973. <command>b10-cmdctl</command> is the gateway between
  974. administrators and the BIND 10 system.
  975. It is a HTTPS server that uses standard HTTP Digest
  976. Authentication for username and password validation.
  977. It provides a REST-ful interface for accessing and controlling
  978. BIND 10.
  979. </para>
  980. <!-- TODO: copy examples from wiki, try with wget -->
  981. <para>
  982. When <command>b10-cmdctl</command> starts, it firsts
  983. asks <command>b10-cfgmgr</command> about what modules are
  984. running and what their configuration is (over the
  985. <command>b10-msgq</command> channel). Then it will start listening
  986. on HTTPS for clients &mdash; the user interface &mdash; such
  987. as <command>bindctl</command>.
  988. </para>
  989. <para>
  990. <command>b10-cmdctl</command> directly sends commands
  991. (received from the user interface) to the specified component.
  992. Configuration changes are actually commands to
  993. <command>b10-cfgmgr</command> so are sent there.
  994. </para>
  995. <!--
  996. TODO:
  997. "For bindctl to list a module's available configurations and
  998. available commands, it communicates over the cmdctl REST interface.
  999. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  1000. asks the module for its specification and also cfgmgr looks in its
  1001. own configuration database for current values."
  1002. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  1003. GET, but rather requests it once and then listens in for updates,
  1004. but you might wanna check with likun
  1005. -->
  1006. <!-- TODO: replace /usr/local -->
  1007. <!-- TODO: permissions -->
  1008. <para>The HTTPS server requires a private key,
  1009. such as a RSA PRIVATE KEY.
  1010. The default location is at
  1011. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  1012. (A sample key is at
  1013. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  1014. It also uses a certificate located at
  1015. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  1016. (A sample certificate is at
  1017. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  1018. This may be a self-signed certificate or purchased from a
  1019. certification authority.
  1020. </para>
  1021. <note><para>
  1022. The HTTPS server doesn't support a certificate request from a
  1023. client (at this time).
  1024. <!-- TODO: maybe allow request from server side -->
  1025. The <command>b10-cmdctl</command> daemon does not provide a
  1026. public service. If any client wants to control BIND 10, then
  1027. a certificate needs to be first received from the BIND 10
  1028. administrator.
  1029. The BIND 10 installation provides a sample PEM bundle that matches
  1030. the sample key and certificate.
  1031. </para></note>
  1032. <!-- TODO: cross-ref -->
  1033. <!-- TODO
  1034. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  1035. but that is a single file, maybe this should go back to that format?
  1036. -->
  1037. <!--
  1038. <para>
  1039. (08:20:56) shane: It is in theory possible to run without cmdctl.
  1040. (08:21:02) shane: I think we discussed this.
  1041. </para>
  1042. -->
  1043. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  1044. <para>
  1045. The <command>b10-cmdctl</command> daemon also requires
  1046. the user account file located at
  1047. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  1048. This comma-delimited file lists the accounts with a user name,
  1049. hashed password, and salt.
  1050. (A sample file is at
  1051. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  1052. It contains the user named <quote>root</quote> with the password
  1053. <quote>bind10</quote>.)
  1054. </para>
  1055. <para>
  1056. The administrator may create a user account with the
  1057. <command>b10-cmdctl-usermgr</command> tool.
  1058. </para>
  1059. <!-- TODO: show example -->
  1060. <!-- TODO: does cmdctl need to be restarted to change cert or key
  1061. or accounts database -->
  1062. <para>
  1063. By default the HTTPS server listens on the localhost port 8080.
  1064. The port can be set by using the <option>--port</option> command line option.
  1065. The address to listen on can be set using the <option>--address</option> command
  1066. line argument.
  1067. Each HTTPS connection is stateless and times out in 1200 seconds
  1068. by default. This can be
  1069. redefined by using the <option>--idle-timeout</option> command line argument.
  1070. </para>
  1071. <section id="cmdctl.spec">
  1072. <title>Configuration specification for b10-cmdctl</title>
  1073. <para>
  1074. The configuration items for <command>b10-cmdctl</command> are:
  1075. <varname>accounts_file</varname> which defines the path to the
  1076. user accounts database (the default is
  1077. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>);
  1078. <varname>cert_file</varname> which defines the path to the
  1079. PEM certificate file (the default is
  1080. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>);
  1081. and
  1082. <varname>key_file</varname> which defines the path to the
  1083. PEM private key file (the default is
  1084. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>).
  1085. </para>
  1086. </section>
  1087. <!--
  1088. TODO
  1089. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  1090. -->
  1091. </chapter>
  1092. <chapter id="bindctl">
  1093. <title>Control and configure user interface</title>
  1094. <note><para>
  1095. For this development prototype release, <command>bindctl</command>
  1096. is the only user interface. It is expected that upcoming
  1097. releases will provide another interactive command-line
  1098. interface and a web-based interface for controlling and
  1099. configuring BIND 10.
  1100. </para></note>
  1101. <note><para>
  1102. <command>bindctl</command> has an internal command history, as
  1103. well as tab-completion for most of the commands and arguments.
  1104. However, these are only enabled if the python readline module
  1105. is available on the system. If not, neither of these
  1106. features will be supported.
  1107. </para></note>
  1108. <para>
  1109. The <command>bindctl</command> tool provides an interactive
  1110. prompt for configuring, controlling, and querying the BIND 10
  1111. components.
  1112. It communicates directly with a REST-ful interface over HTTPS
  1113. provided by <command>b10-cmdctl</command>. It doesn't
  1114. communicate to any other components directly.
  1115. </para>
  1116. <section id="bindctl_commandline_options">
  1117. <title>bindctl command-line options</title>
  1118. <variablelist>
  1119. <varlistentry>
  1120. <term>-a <replaceable>&lt;address&gt;</replaceable>, --address=<replaceable>&lt;address&gt;</replaceable></term>
  1121. <listitem>
  1122. <simpara>
  1123. IP address that BIND 10's <command>b10-cmdctl</command>
  1124. module is listening on. By default, this is 127.0.0.1.
  1125. </simpara>
  1126. </listitem>
  1127. </varlistentry>
  1128. <varlistentry>
  1129. <term>-c <replaceable>&lt;certificate file&gt;</replaceable>, --certificate-chain=<replaceable>&lt;certificate file&gt;</replaceable></term>
  1130. <listitem>
  1131. <simpara>
  1132. PEM-formatted server certificate file. When this option is
  1133. given, <command>bindctl</command> will verify the server
  1134. certificate using the given file as the root of the
  1135. certificate chain. If not specified, <command>bindctl
  1136. </command> does not validate the certificate.
  1137. </simpara>
  1138. </listitem>
  1139. </varlistentry>
  1140. <varlistentry>
  1141. <term>--csv-file-dir=<replaceable>&lt;csv file&gt;</replaceable></term>
  1142. <listitem>
  1143. <simpara>
  1144. <command>bindctl</command> stores the username and
  1145. password for logging in in a file called
  1146. <filename>default_user.csv</filename>;
  1147. this option specifies the directory where this file is
  1148. stored and read from. When not specified,
  1149. <filename>~/.bind10/</filename> is used.
  1150. <note>Currently, this file contains an unencrypted password.</note>
  1151. </simpara>
  1152. </listitem>
  1153. </varlistentry>
  1154. <varlistentry>
  1155. <term>-h, --help</term>
  1156. <listitem>
  1157. <simpara>
  1158. Shows a short overview of the command-line options of
  1159. <command>bindctl</command>, and exits.
  1160. </simpara>
  1161. </listitem>
  1162. </varlistentry>
  1163. <varlistentry>
  1164. <term>--version</term>
  1165. <listitem>
  1166. <simpara>
  1167. Shows the version of <command>bindctl</command>, and exits.
  1168. </simpara>
  1169. </listitem>
  1170. </varlistentry>
  1171. <varlistentry>
  1172. <term>-p <replaceable>&lt;port number&gt;</replaceable>, --port=<replaceable>&lt;port number&gt;</replaceable></term>
  1173. <listitem>
  1174. <simpara>
  1175. Port number that BIND 10's <command>b10-cmdctl</command>
  1176. module is listening on. By default, this is port 8080.
  1177. </simpara>
  1178. </listitem>
  1179. </varlistentry>
  1180. </variablelist>
  1181. </section>
  1182. <section id="bindctl_general_syntax">
  1183. <title>General syntax of bindctl commands</title>
  1184. The <command>bindctl</command> tool is an interactive
  1185. command-line tool, with dynamic commands depending on the
  1186. BIND 10 modules that are running. There are a number of
  1187. fixed commands that have no module and that are always
  1188. available.
  1189. The general syntax of a command is
  1190. <screen><userinput>&lt;module&gt; &lt;command&gt; <replaceable>[argument(s)]</replaceable></userinput></screen>
  1191. For example, the Boss module has a 'shutdown' command to shut down
  1192. BIND 10, with an optional argument 'help':
  1193. <screen><userinput>> Boss shutdown help</userinput>
  1194. Command shutdown (Shut down BIND 10)
  1195. help (Get help for command)
  1196. This command has no parameters
  1197. </screen>
  1198. There are no mandatory arguments, only the optional 'help'.
  1199. </section>
  1200. <section id="bindctl_help">
  1201. <title>Bindctl help</title>
  1202. <command>help</command> is both a command and an option that is available to all other commands. When run as a command directly, it shows the available modules.
  1203. <screen>&gt; <userinput>help</userinput>
  1204. usage: &lt;module name&gt; &lt;command name&gt; [param1 = value1 [, param2 = value2]]
  1205. Type Tab character to get the hint of module/command/parameters.
  1206. Type "help(? h)" for help on bindctl.
  1207. Type "&lt;module_name&gt; help" for help on the specific module.
  1208. Type "&lt;module_name&gt; &lt;command_name&gt; help" for help on the specific command.
  1209. Available module names:
  1210. <emphasis>(list of modules)</emphasis>
  1211. </screen>
  1212. When 'help' is used as a command to a module, it shows the supported commands for the module; for example:
  1213. <screen>&gt; <userinput>Boss help</userinput>
  1214. Module Boss Master process
  1215. Available commands:
  1216. help Get help for module.
  1217. shutdown Shut down BIND 10
  1218. ping Ping the boss process
  1219. show_processes
  1220. List the running BIND 10 processes
  1221. </screen>
  1222. And when added to a module command, it shows the description and parameters of that specific command; for example:
  1223. <screen>&gt; <userinput>Auth loadzone help</userinput>
  1224. Command loadzone ((Re)load a specified zone)
  1225. help (Get help for command)
  1226. Parameters:
  1227. class (string, optional)
  1228. origin (string, mandatory)
  1229. </screen>
  1230. </section>
  1231. <section id="bindctl_command_arguments">
  1232. <title>Command arguments</title>
  1233. <simpara>
  1234. Commands can have arguments, which can be either optional or
  1235. mandatory. They can be specified by name
  1236. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument name&gt;=&lt;argument value&gt;</replaceable></command>), or positionally,
  1237. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument value 1&gt;</replaceable> <replaceable>&lt;argument value 2&gt;</replaceable></command>).
  1238. </simpara>
  1239. <simpara>
  1240. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>help</replaceable></command>
  1241. shows the arguments a command supports and which of those are
  1242. mandatory, and in which order the arguments are expected if
  1243. positional arguments are used.
  1244. </simpara>
  1245. <simpara>
  1246. For example, the <command>loadzone</command> command of the Auth
  1247. module, as shown in the last example of the previous section, has
  1248. two arguments, one of which is optional. The positional arguments in
  1249. this case are class first and origin second; for example:
  1250. <screen>&gt; <userinput>Auth loadzone IN example.com.</userinput></screen>
  1251. But since the class is optional (defaulting to IN), leaving it out
  1252. works as well:
  1253. <screen>&gt; <userinput>Auth loadzone example.com.</userinput></screen>
  1254. </simpara>
  1255. <simpara>
  1256. The arguments can also be provided with their names, in which
  1257. case the order does not matter:
  1258. <screen>&gt; <userinput>Auth loadzone origin="example.com." class="IN"</userinput></screen>
  1259. </simpara>
  1260. </section>
  1261. <section id="bindctl_module_commands">
  1262. <title>Module commands</title>
  1263. Each module has its own set of commands (if any), which will only be
  1264. available if the module is running. For instance, the
  1265. Auth module has a <command>loadzone</command> command.
  1266. The commands a module provides are documented in
  1267. this guide in the section of that module or in the module's
  1268. corresponding manual page.
  1269. </section>
  1270. <section>
  1271. <title>Configuration commands</title>
  1272. Configuration commands are used to view and change the configuration
  1273. of BIND 10 and its modules. Module configuration is only shown if
  1274. that module is running, but similar to commands, there are a number
  1275. of top-level configuration items that are always available (for
  1276. instance <varname>tsig_keys</varname> and
  1277. <varname>data_sources</varname>).
  1278. Configuration changes (set, unset, add and remove) are done locally
  1279. first, and have no immediate effect. The changes can be viewed with
  1280. <command>config diff</command>, and either reverted
  1281. (<command>config revert</command>), or committed
  1282. (<command>config commit</command>).
  1283. In the latter case, all local changes are submitted
  1284. to the configuration manager, which verifies them, and if they are
  1285. accepted, applied and saved in persistent storage.
  1286. When identifying items in configuration commands, the format is
  1287. <screen><userinput>Module/example/item</userinput></screen>
  1288. Sub-elements of names, lists and sets (see <xref linkend=
  1289. "bindctl_configuration_data_types"/>) are separated with the '/'
  1290. character, and list indices are identified with [<replaceable>&lt;index&gt;</replaceable>]; for example:
  1291. <screen><userinput>Module/example/list[2]/foo</userinput></screen>
  1292. <section id="bindctl_configuration_command_list">
  1293. <title>List of configuration commands</title>
  1294. The following configuration commands are available:
  1295. <variablelist>
  1296. <varlistentry>
  1297. <term>show [all] [item name]</term>
  1298. <listitem>
  1299. <simpara>
  1300. Shows the current configuration of the given item. If 'all'
  1301. is given, it will recurse through the entire set, and show
  1302. every nested value.
  1303. </simpara>
  1304. </listitem>
  1305. </varlistentry>
  1306. <varlistentry>
  1307. <term>show_json [item name]</term>
  1308. <listitem>
  1309. <simpara>
  1310. Shows the full configuration of the given item in JSON format.
  1311. </simpara>
  1312. </listitem>
  1313. </varlistentry>
  1314. <varlistentry>
  1315. <term>add &lt;item name&gt; [value]</term>
  1316. <listitem>
  1317. <simpara>
  1318. Add an entry to configuration list or a named set (see <xref
  1319. linkend="bindctl_configuration_data_types"/>).
  1320. When adding to a list, the command has one optional
  1321. argument, a value to add to the list. The value must
  1322. be in correct JSON and complete. When adding to a
  1323. named set, it has one mandatory parameter (the name to
  1324. add), and an optional parameter value, similar to when
  1325. adding to a list. In either case, when no value is
  1326. given, an entry will be constructed with default
  1327. values.
  1328. </simpara>
  1329. </listitem>
  1330. </varlistentry>
  1331. <varlistentry>
  1332. <term>remove</term>
  1333. <listitem>
  1334. <simpara>
  1335. Remove an item from a configuration list or a named set.
  1336. When removing an item for a list, either the index needs to
  1337. be specified, or the complete value of the element to remove
  1338. must be specified (in JSON format).
  1339. </simpara>
  1340. </listitem>
  1341. </varlistentry>
  1342. <varlistentry>
  1343. <term>set &lt;item name&gt; &lt;value&gt;</term>
  1344. <listitem>
  1345. <simpara>
  1346. Directly set the value of the given item to the given value.
  1347. </simpara>
  1348. </listitem>
  1349. </varlistentry>
  1350. <varlistentry>
  1351. <term>unset &lt;item name&gt;</term>
  1352. <listitem>
  1353. <simpara>
  1354. Remove any user-specified value for the given item.
  1355. </simpara>
  1356. </listitem>
  1357. </varlistentry>
  1358. <varlistentry>
  1359. <term>diff</term>
  1360. <listitem>
  1361. <simpara>
  1362. Show all current local changes that have not been
  1363. committed yet.
  1364. </simpara>
  1365. </listitem>
  1366. </varlistentry>
  1367. <varlistentry>
  1368. <term>revert</term>
  1369. <listitem>
  1370. <simpara>
  1371. Revert all local changes without committing them.
  1372. </simpara>
  1373. </listitem>
  1374. </varlistentry>
  1375. <varlistentry>
  1376. <term>commit</term>
  1377. <listitem>
  1378. <simpara>
  1379. Send all local changes to the configuration manager, which
  1380. will validate them, and apply them if validation succeeds.
  1381. </simpara>
  1382. </listitem>
  1383. </varlistentry>
  1384. <varlistentry>
  1385. <term>go</term>
  1386. <listitem>
  1387. <simpara>
  1388. Go to a specific configuration part, similar to the 'cd'
  1389. command in a shell.
  1390. <note>There are a number of problems with the current
  1391. implementation of go within <command>bindctl</command>,
  1392. and we recommend not using it for general cases.</note>
  1393. </simpara>
  1394. </listitem>
  1395. </varlistentry>
  1396. </variablelist>
  1397. </section>
  1398. <section id="bindctl_configuration_data_types">
  1399. <title>Configuration data types</title>
  1400. Configuration data can be of different types, which can be modified
  1401. in ways that depend on the types. There are a few syntax
  1402. restrictions on these types, but only basic ones. Modules may impose
  1403. additional restrictions on the values of elements.
  1404. <variablelist>
  1405. <varlistentry>
  1406. <term>integer</term>
  1407. <listitem>
  1408. <simpara>
  1409. A basic integer; can be set directly with <command>config set</command>, to any integer value.
  1410. </simpara>
  1411. </listitem>
  1412. </varlistentry>
  1413. <varlistentry>
  1414. <term>real</term>
  1415. <listitem>
  1416. <simpara>
  1417. A basic floating point number; can be set directly with <command>config set</command>, to any floating point value.
  1418. </simpara>
  1419. </listitem>
  1420. </varlistentry>
  1421. <varlistentry>
  1422. <term>boolean</term>
  1423. <listitem>
  1424. <simpara>
  1425. A basic boolean value; can be set directly with <command>config set</command>, to either <command>true</command> or <command>false</command>.
  1426. </simpara>
  1427. </listitem>
  1428. </varlistentry>
  1429. <varlistentry>
  1430. <term>string</term>
  1431. <listitem>
  1432. <simpara>
  1433. A basic string value; can be set directly with <command>config set,</command> so any string. Double quotation marks are optional.
  1434. </simpara>
  1435. </listitem>
  1436. </varlistentry>
  1437. <varlistentry>
  1438. <term>null</term>
  1439. <listitem>
  1440. <simpara>
  1441. This is a special type representing 'no value at all'; usable in compound structures that have optional elements that are not set.
  1442. </simpara>
  1443. </listitem>
  1444. </varlistentry>
  1445. <varlistentry>
  1446. <term>maps</term>
  1447. <listitem>
  1448. <simpara>
  1449. Maps are (pre-defined) compound collections of other
  1450. elements of any other type. They are not usually
  1451. modified directly, but their elements are. Every
  1452. top-level element for a module is a map containing
  1453. the configuration values for that map, which can
  1454. themselves be maps again. For instance, the Auth
  1455. module configuration is a map containing the
  1456. elements '<varname>listen_on</varname>' (list) and '<varname>tcp_recv_timeout</varname>'
  1457. (integer). When changing one of its values, they can
  1458. be modified directly with <command>config set
  1459. Auth/tcp_recv_timeout 3000</command>.
  1460. </simpara>
  1461. <simpara>
  1462. Some map entries are optional. If they are, and
  1463. currently have a value, the value can be unset by
  1464. using either <command>config unset
  1465. <replaceable>&lt;item name&gt;</replaceable>
  1466. </command> or <command>config set
  1467. <replaceable>&lt;item name&gt;</replaceable>
  1468. null</command>.
  1469. </simpara>
  1470. <simpara>
  1471. Maps <emphasis>can</emphasis> be modified as a whole,
  1472. but using the full JSON representation of
  1473. the entire map to set.
  1474. Since this involves a lot of text, this is usually
  1475. not recommended.
  1476. </simpara>
  1477. <simpara>
  1478. Another example is the Logging virtual module, which
  1479. is, like any module, a map, but it only contains one
  1480. element: a list of loggers. Normally, an
  1481. administrator would only modify that list (or its
  1482. elements) directly, but it is possible to set the
  1483. entire map in one command; for example:
  1484. <command> config set Logging { "loggers": [] } </command>
  1485. </simpara>
  1486. </listitem>
  1487. </varlistentry>
  1488. <varlistentry>
  1489. <term>list</term>
  1490. <listitem>
  1491. <simpara>
  1492. A list is a compound list of other elements of the
  1493. same type. Elements can be added with <command>config
  1494. add <replaceable>&lt;list name&gt; [value]</replaceable></command>, and removed with
  1495. <command>config remove <replaceable>&lt;list name&gt; [value]</replaceable></command> or
  1496. <command>config remove <replaceable>&lt;list name&gt;</replaceable><replaceable>&lt;index&gt;</replaceable></command>.
  1497. The index is of the form <emphasis>square bracket, number,
  1498. square bracket</emphasis> (e.g.
  1499. <command>[0]</command>), and it immediately follows
  1500. the list name (there is no separator or space
  1501. between them). List indices start with 0 for the
  1502. first element.
  1503. </simpara>
  1504. <simpara>
  1505. For addition, if the value is omitted, an entry with
  1506. default values will be added. For removal, either
  1507. the index or the full value (in JSON format) needs
  1508. to be specified.
  1509. </simpara>
  1510. <simpara>
  1511. Lists can also be used with
  1512. <command>config set</command>,
  1513. but like maps, only by specifying the
  1514. entire list value in JSON format.
  1515. </simpara>
  1516. <simpara>
  1517. For example, this command shows the port number used for the second element of the list <varname>listen_on</varname> in the Auth module:
  1518. <command> config show Auth/listen_on[1]/port</command>
  1519. </simpara>
  1520. </listitem>
  1521. </varlistentry>
  1522. <varlistentry>
  1523. <term>named set</term>
  1524. <listitem>
  1525. <simpara>
  1526. Named sets are similar to lists, in that they are
  1527. sets of elements of the same type, but they are not
  1528. indexed by numbers, but by strings.
  1529. </simpara>
  1530. <simpara>
  1531. Values can be added with
  1532. <command>config add <replaceable>&lt;item name&gt; &lt;string&gt; [value]</replaceable></command>
  1533. where 'string' is the name of the element. If 'value'
  1534. is ommitted, default values will be used. Elements
  1535. can be removed with <command>config remove
  1536. <replaceable>&lt;item
  1537. name&gt; &lt;string&gt;</replaceable></command>
  1538. </simpara>
  1539. <simpara>
  1540. Elements in a named set can be addressed similarly
  1541. to maps.
  1542. </simpara>
  1543. <simpara>
  1544. For example, the <command>Boss/components</command>
  1545. elements is a named set;
  1546. adding, showing, and then removing an element
  1547. can be done with the following three commands (note
  1548. the '/'-character versus the space before
  1549. 'example_module'):
  1550. </simpara>
  1551. <simpara>
  1552. <command>config add Boss/components example_module</command>
  1553. </simpara>
  1554. <simpara>
  1555. <command>config show Boss/components/example_module</command>
  1556. </simpara>
  1557. <simpara>
  1558. <command>config remove Boss/components example_module</command>
  1559. </simpara>
  1560. </listitem>
  1561. </varlistentry>
  1562. <varlistentry>
  1563. <term>any</term>
  1564. <listitem>
  1565. <simpara>
  1566. The 'any' type is a special type that can have any
  1567. form. Apart from that, it must consist of elements as
  1568. described in this chapter, there is no restriction
  1569. on which element types are used. This type is used
  1570. in places where different data formats could be
  1571. used. Element modification commands depend on the
  1572. actual type of the value. For instance, if the value
  1573. of an 'any' element is a list, <command>config add
  1574. </command> and <command>config remove</command> work
  1575. as for other lists.
  1576. </simpara>
  1577. </listitem>
  1578. </varlistentry>
  1579. </variablelist>
  1580. </section>
  1581. </section>
  1582. <section>
  1583. <title>The execute command</title>
  1584. The <command>execute</command> command executes a set of commands,
  1585. either from a file
  1586. or from a pre-defined set. Currently, the only predefined set is
  1587. <command>init_authoritative_server</command>, which adds
  1588. <command>b10-auth</command>, <command>b10-xfrin</command>, and
  1589. <command>b10-xfrout</command> to the set of components to be
  1590. started by BIND 10. This
  1591. pre-defined set does not commit the changes, so these modules do not
  1592. show up for commands or configuration until the user enters
  1593. <command>config commit</command> after
  1594. <command>execute init_authoritative_server</command>. For example:
  1595. <screen>&gt; <userinput>execute init_authoritative_server</userinput></screen>
  1596. <screen>&gt; <userinput>execute file /tmp/example_commands</userinput></screen>
  1597. The optional argument <command>show</command> displays the exact set of
  1598. commands that would be executed; for example:
  1599. <screen>&gt; <userinput>execute init_authoritative_server show</userinput>
  1600. !echo adding Authoritative server component
  1601. config add /Boss/components b10-auth
  1602. config set /Boss/components/b10-auth/kind needed
  1603. config set /Boss/components/b10-auth/special auth
  1604. !echo adding Xfrin component
  1605. config add /Boss/components b10-xfrin
  1606. config set /Boss/components/b10-xfrin/address Xfrin
  1607. config set /Boss/components/b10-xfrin/kind dispensable
  1608. !echo adding Xfrout component
  1609. config add /Boss/components b10-xfrout
  1610. config set /Boss/components/b10-xfrout/address Xfrout
  1611. config set /Boss/components/b10-xfrout/kind dispensable
  1612. !echo adding Zone Manager component
  1613. config add /Boss/components b10-zonemgr
  1614. config set /Boss/components/b10-zonemgr/address Zonemgr
  1615. config set /Boss/components/b10-zonemgr/kind dispensable
  1616. !echo Components added. Please enter "config commit" to
  1617. !echo finalize initial setup and run the components.
  1618. </screen>
  1619. The optional <command>show</command> argument may also be used when
  1620. executing a script from a file; for example:
  1621. <screen><userinput>> execute file /tmp/example_commands show</userinput></screen>
  1622. <section id="bindctl_execute_directives">
  1623. <title>Execute directives</title>
  1624. Within sets of commands to be run with the <command>execute</command>
  1625. command, a number of directives are supported:
  1626. <variablelist>
  1627. <varlistentry>
  1628. <term>!echo <replaceable>&lt;string&gt;</replaceable></term>
  1629. <listitem>
  1630. <simpara>
  1631. Prints the given string to <command>bindctl</command>'s
  1632. output.
  1633. </simpara>
  1634. </listitem>
  1635. </varlistentry>
  1636. <varlistentry>
  1637. <term>!verbose on</term>
  1638. <listitem>
  1639. <simpara>
  1640. Enables verbose mode; all following commands that are to
  1641. be executed are also printed.
  1642. </simpara>
  1643. </listitem>
  1644. </varlistentry>
  1645. <varlistentry>
  1646. <term>!verbose off</term>
  1647. <listitem>
  1648. <simpara>
  1649. Disables verbose mode; following commands that are to
  1650. be executed are no longer printed.
  1651. </simpara>
  1652. </listitem>
  1653. </varlistentry>
  1654. </variablelist>
  1655. </section>
  1656. <section id="bindctl_execute_notes">
  1657. <title>Notes on execute scripts</title>
  1658. Within scripts, you can add or remove modules with the normal
  1659. configuration commands for <command>Boss/components</command>.
  1660. However, as module
  1661. configuration and commands do not show up until the module is
  1662. running, it is currently not possible to add a module and set
  1663. its configuration in one script. This will be addressed in the
  1664. future, but for now the only option is to add and configure
  1665. modules in separate commands and execute scripts.
  1666. </section>
  1667. </section>
  1668. </chapter>
  1669. <chapter id="common">
  1670. <title>Common configuration elements</title>
  1671. <para>
  1672. Some things are configured in the same or similar manner across
  1673. many modules. So we show them here in one place.
  1674. </para>
  1675. <section id='common-tsig'>
  1676. <title>TSIG keys</title>
  1677. <para>
  1678. TSIG is a way to sign requests and responses in DNS. It is defined in
  1679. RFC 2845 and uses symmetric cryptography to sign the DNS messages. If
  1680. you want to make any use of TSIG (to authenticate transfers or DDNS,
  1681. for example), you need to set up shared secrets between the endpoints.
  1682. </para>
  1683. <para>
  1684. BIND 10 uses a global key ring for the secrets. It doesn't currently
  1685. mean they would be stored differently, they are just in one place of
  1686. the configuration.
  1687. </para>
  1688. <section id='tsig-key-syntax'>
  1689. <title>Key anatomy and syntax</title>
  1690. <para>
  1691. Each key has three attributes. One is a name by which it is referred
  1692. both in DNS packets and the rest of the configuration. Another is the
  1693. algorithm used to compute the signature. And the last part is a
  1694. base64 encoded secret, which might be any blob of data.
  1695. </para>
  1696. <para>
  1697. The parts are written into a string, concatenated together by colons.
  1698. So if you wanted to have a key called "example.key", used as a
  1699. HMAC-MD5 key with secret "secret", you'd write it as:
  1700. <screen>"example.key.:c2VjcmV0:hmac-md5"</screen>
  1701. </para>
  1702. <para>
  1703. The HMAC-MD5 algorithm is the default, so you can omit it. You could
  1704. write the same key as:
  1705. <screen>"example.key.:c2VjcmV0"</screen>
  1706. </para>
  1707. <para>
  1708. You can also use these algorithms (which may not be omitted from the
  1709. key definition if used):
  1710. <itemizedlist>
  1711. <listitem>hmac-sha1</listitem>
  1712. <listitem>hmac-sha224</listitem>
  1713. <listitem>hmac-sha256</listitem>
  1714. <listitem>hmac-sha384</listitem>
  1715. <listitem>hmac-sha512</listitem>
  1716. </itemizedlist>
  1717. </para>
  1718. <para>
  1719. The name of the key must be a valid DNS name.
  1720. </para>
  1721. </section>
  1722. <section id='tsig-key-ring'>
  1723. <title>Key ring</title>
  1724. <para>
  1725. The key ring lives in the configuration in "tsig_keys/keys". Most of
  1726. the system uses the keys from there &mdash; ACLs, authoritative server to
  1727. sign responses to signed queries, and <command>b10-xfrout</command>
  1728. to sign transfers. The <command>b10-xfrin</command> uses its own
  1729. configuration for keys, but that will be fixed in Trac ticket
  1730. <ulink url="http://bind10.isc.org/ticket/1351">#1351</ulink>.
  1731. </para>
  1732. <para>
  1733. The key ring is just a list of strings, each describing one key. So,
  1734. to add a new key, you can do this:
  1735. <screen>&gt; <userinput>config add tsig_keys/keys "example.key.:c2VjcmV0"</userinput>
  1736. &gt; <userinput>config show tsig_keys/keys</userinput>
  1737. tsig_keys/keys[0] "example.key.:c2VjcmV0" string (modified)
  1738. &gt; <userinput>config commit</userinput></screen>
  1739. </para>
  1740. <para>
  1741. You can keep as many keys as you want in the key ring, but each must
  1742. have a different name.
  1743. </para>
  1744. </section>
  1745. </section>
  1746. <section id='common-acl'>
  1747. <title>ACLs</title>
  1748. <para>
  1749. An ACL, or Access Control List, is a way to describe if a request
  1750. is allowed or disallowed. The principle is, there's a list of rules.
  1751. Each rule is a name-value mapping (a dictionary, in the JSON
  1752. terminology). Each rule must contain exactly one mapping called
  1753. "action", which describes what should happen if the rule applies.
  1754. There may be more mappings, calld matches, which describe the
  1755. conditions under which the rule applies.
  1756. </para>
  1757. <para>
  1758. When there's a query, the first rule is examined. If it matches, the
  1759. action in it is taken. If not, next rule is examined. If there are no
  1760. more rules to examine, a default action is taken.
  1761. </para>
  1762. <para>
  1763. There are three possible "action" values. The "ACCEPT" value means
  1764. the query is handled. If it is "REJECT", the query is not answered,
  1765. but a polite error message is sent back (if that makes sense in the
  1766. context). The "DROP" action acts like a black hole. The query is
  1767. not answered and no error message is sent.
  1768. </para>
  1769. <para>
  1770. If there are multiple matching conditions inside the rule, all of
  1771. them must be satisfied for the rule to apply. This can be used,
  1772. for example, to require the query to be signed by a TSIG key and
  1773. originate from given address.
  1774. </para>
  1775. <para>
  1776. This is encoded in form of JSON. Semi-formal description could look
  1777. something like this. It is described in more details below.
  1778. <!-- FIXME: Is <screen> really the correct one?-->
  1779. <screen>ACL := [ RULE, RULE, ... ]
  1780. RULE := { "action": "ACCEPT"|"REJECT"|"DROP", MATCH, MATCH, ... }
  1781. RULE_RAW := { MATCH, MATCH, ... }
  1782. MATCH := FROM_MATCH|KEY_MATCH|NOT_MATCH|OR_MATCH|AND_MATCH|...
  1783. FROM_MATCH := "from": [RANGE, RANGE, RANGE, ...] | RANGE
  1784. RANGE := "&lt;ip range&gt;"
  1785. KEY_MATCH := "key": [KEY, KEY, KEY, ...] | KEY
  1786. KEY := "&lt;key name&gt;"
  1787. NOT_MATCH := "NOT": RULE_RAW
  1788. OR_MATCH := "ANY": [ RULE_RAW, RULE_RAW, ... ]
  1789. AND_MATCH := "ALL": [ RULE_RAW, RULE_RAW, ... ]
  1790. </screen>
  1791. </para>
  1792. <section>
  1793. <title>Matching properties</title>
  1794. <para>
  1795. The first thing you can check against is the source address
  1796. of request. The name is <varname>from</varname> and the value
  1797. is a string containing either a single IPv4 or IPv6 address,
  1798. or a range in the usual slash notation (eg. "192.0.2.0/24").
  1799. </para>
  1800. <para>
  1801. The other is TSIG key by which the message was signed. The ACL
  1802. contains only the name (under the name "key"), the key itself
  1803. must be stored in the global key ring (see <xref
  1804. linkend="tsig-key-ring"/>).
  1805. This property is applicable only to the DNS context.
  1806. </para>
  1807. <para>
  1808. More properties to match are planned &mdash; the destination
  1809. address, ports, matches against the packet content.
  1810. </para>
  1811. </section>
  1812. <section>
  1813. <title>More complicated matches</title>
  1814. <para>
  1815. From time to time, you need to express something more complex
  1816. than just a single address or key.
  1817. </para>
  1818. <para>
  1819. You can specify a list of values instead of single value. Then
  1820. the property needs to match at least one of the values listed
  1821. &mdash; so you can say <quote>"from": ["192.0.2.0/24",
  1822. "2001:db8::/32"]</quote> to match any address in the ranges
  1823. set aside for documentation. The keys or any future properties
  1824. will work in a similar way.
  1825. </para>
  1826. <para>
  1827. If that is not enough, you can compose the matching conditions
  1828. to logical expressions. They are called "ANY", "ALL" and "NOT".
  1829. The "ANY" and "ALL" ones contain lists of subexpressions &mdash;
  1830. each subexpression is a similar dictionary, just not containing
  1831. the "action" element. The "NOT" contains single subexpression.
  1832. Their function should be obvious &mdash; "NOT" matches if and
  1833. only if the subexpression does not match. The "ALL" matches exactly
  1834. when each of the subexpressions matches and "ANY" when at least
  1835. one matches.
  1836. </para>
  1837. </section>
  1838. <section>
  1839. <title>Examples</title>
  1840. <para>
  1841. All the examples here is just the JSON representing the ACL,
  1842. nicely formatted and split across lines. They are out of any
  1843. surrounding context. This is similar to what you'd get from
  1844. <command>config show_json</command> called on the entry containing
  1845. the ACL.
  1846. </para>
  1847. <para>
  1848. In the first example, the ACL accepts queries from two known hosts.
  1849. Each host has an IP addresses (both IPv4 and IPv6) and a TSIG
  1850. key. Other queries are politely rejected. The last entry in the list
  1851. has no conditions &mdash; making it match any query.
  1852. <screen>[
  1853. {
  1854. "from": ["192.0.2.1", "2001:db8::1"],
  1855. "key": "first.key",
  1856. "action": "ACCEPT"
  1857. },
  1858. {
  1859. "from": ["192.0.2.2", "2001:db8::2"],
  1860. "key": "second.key",
  1861. "action": "ACCEPT"
  1862. },
  1863. {
  1864. "action": "REJECT"
  1865. }
  1866. ]</screen>
  1867. </para>
  1868. <para>
  1869. Now we show two ways to accept only the queries from private ranges.
  1870. This is the same as rejecting anything that is outside.
  1871. <screen>[
  1872. {
  1873. "from": [
  1874. "10.0.0.0/8",
  1875. "172.16.0.0/12",
  1876. "192.168.0.0/16",
  1877. "fc00::/7"
  1878. ],
  1879. "action": "ACCEPT"
  1880. },
  1881. {
  1882. "action": "REJECT"
  1883. }
  1884. ]</screen>
  1885. <screen>[
  1886. {
  1887. "NOT": {
  1888. "ANY": [
  1889. {"from": "10.0.0.0/8"},
  1890. {"from": "172.16.0.0/12"},
  1891. {"from": "192.168.0.0/16"},
  1892. {"from": "fc00::/7"}
  1893. ]
  1894. },
  1895. "action": "REJECT"
  1896. },
  1897. {
  1898. "action": "ACCEPT"
  1899. }
  1900. ]</screen>
  1901. </para>
  1902. </section>
  1903. <section>
  1904. <title>Interaction with <command>bindctl</command></title>
  1905. <para>
  1906. Currently, <command>bindctl</command> has hard time coping with
  1907. the variable nature of the ACL syntax. This technical limitation
  1908. makes it impossible to edit parts of the entries. You need to
  1909. set the whole entry at once, providing the whole JSON value.
  1910. </para>
  1911. <para>
  1912. This limitation is planned to be solved soon at least partially.
  1913. </para>
  1914. <para>
  1915. You'd do something like this to create the second example.
  1916. Note that the whole JSON must be on a single line.
  1917. <screen>&gt; <userinput>config add somewhere/acl</userinput>
  1918. &gt; <userinput>config set somewhere/acl[0] { "from": [ "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7" ], "action": "ACCEPT" }</userinput>
  1919. &gt; <userinput>config add somewhere/acl</userinput>
  1920. &gt; <userinput>config set somewhere/acl[1] { "action": "REJECT" }</userinput>
  1921. &gt; <userinput>config commit</userinput></screen>
  1922. </para>
  1923. </section>
  1924. </section>
  1925. </chapter>
  1926. <chapter id="authserver">
  1927. <title>Authoritative Server</title>
  1928. <para>
  1929. The <command>b10-auth</command> is the authoritative DNS server.
  1930. It supports EDNS0, DNSSEC, IPv6, and SQLite3 and in-memory zone
  1931. data backends.
  1932. Normally it is started by the <command>bind10</command> master
  1933. process.
  1934. </para>
  1935. <section>
  1936. <title>Server Configurations</title>
  1937. <!-- TODO: offers command line options but not used
  1938. since we used bind10 -->
  1939. <para>
  1940. <command>b10-auth</command> is configured via the
  1941. <command>b10-cfgmgr</command> configuration manager.
  1942. The module name is <quote>Auth</quote>.
  1943. The configuration data items are:
  1944. <variablelist>
  1945. <varlistentry>
  1946. <term>database_file</term>
  1947. <listitem>
  1948. <simpara>This is an optional string to define the path to find
  1949. the SQLite3 database file.
  1950. <!-- TODO: -->
  1951. Note: This may be a temporary setting because the DNS server
  1952. can use various data source backends.
  1953. </simpara>
  1954. </listitem>
  1955. </varlistentry>
  1956. <!-- NOTE: docs pulled in verbatim from the b10-auth.xml manual page.
  1957. TODO: automate this if want this or rewrite
  1958. -->
  1959. <varlistentry>
  1960. <term>datasources</term>
  1961. <listitem>
  1962. <simpara>
  1963. <varname>datasources</varname> configures data sources.
  1964. The list items include:
  1965. <varname>type</varname> to define the required data source type
  1966. (such as <quote>memory</quote>);
  1967. <varname>class</varname> to optionally select the class
  1968. (it defaults to <quote>IN</quote>);
  1969. and
  1970. <varname>zones</varname> to define
  1971. the <varname>file</varname> path name,
  1972. the <varname>filetype</varname> (<quote>sqlite3</quote> to load
  1973. from a SQLite3 database file or <quote>text</quote> to
  1974. load from a master text file),
  1975. and the <varname>origin</varname> (default domain).
  1976. By default, this is empty.
  1977. <note><simpara>
  1978. In this development version, currently this is only used for the
  1979. memory data source.
  1980. Only the IN class is supported at this time.
  1981. By default, the memory data source is disabled.
  1982. Also, currently the zone file must be canonical such as
  1983. generated by <command>named-compilezone -D</command>, or
  1984. must be an SQLite3 database.
  1985. </simpara></note>
  1986. </simpara>
  1987. </listitem>
  1988. </varlistentry>
  1989. <varlistentry>
  1990. <term>listen_on</term>
  1991. <listitem>
  1992. <simpara>
  1993. <varname>listen_on</varname> is a list of addresses and ports for
  1994. <command>b10-auth</command> to listen on.
  1995. The list items are the <varname>address</varname> string
  1996. and <varname>port</varname> number.
  1997. By default, <command>b10-auth</command> listens on port 53
  1998. on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
  1999. <note>
  2000. <simpara>
  2001. The default configuration is currently not appropriate for a multi-homed host.
  2002. In case you have multiple public IP addresses, it is possible the
  2003. query UDP packet comes through one interface and the answer goes out
  2004. through another. The answer will probably be dropped by the client, as it
  2005. has a different source address than the one it sent the query to. The
  2006. client would fallback on TCP after several attempts, which works
  2007. well in this situation, but is clearly not ideal.
  2008. </simpara>
  2009. <simpara>
  2010. There are plans to solve the problem such that the server handles
  2011. it by itself. But until it is actually implemented, it is recommended to
  2012. alter the configuration &mdash; remove the wildcard addresses and list all
  2013. addresses explicitly. Then the server will answer on the same
  2014. interface the request came on, preserving the correct address.
  2015. </simpara>
  2016. </note>
  2017. </simpara>
  2018. </listitem>
  2019. </varlistentry>
  2020. <varlistentry>
  2021. <term>tcp_recv_timeout</term>
  2022. <listitem>
  2023. <simpara>
  2024. <varname>tcp_recv_timeout</varname> is the timeout used on
  2025. incoming TCP connections, in milliseconds. If the query
  2026. is not sent within this time, the connection is closed.
  2027. Setting this to 0 will disable TCP timeouts completely.
  2028. </simpara>
  2029. </listitem>
  2030. </varlistentry>
  2031. </variablelist>
  2032. </para>
  2033. <para>
  2034. The configuration commands are:
  2035. <variablelist>
  2036. <varlistentry>
  2037. <term>loadzone</term>
  2038. <listitem>
  2039. <simpara>
  2040. <command>loadzone</command> tells <command>b10-auth</command>
  2041. to load or reload a zone file. The arguments include:
  2042. <varname>class</varname> which optionally defines the class
  2043. (it defaults to <quote>IN</quote>);
  2044. <varname>origin</varname> is the domain name of the zone;
  2045. and
  2046. <varname>datasrc</varname> optionally defines the type of datasource
  2047. (it defaults to <quote>memory</quote>).
  2048. <note><simpara>
  2049. In this development version, currently this only supports the
  2050. IN class and the memory data source.
  2051. </simpara></note>
  2052. </simpara>
  2053. </listitem>
  2054. </varlistentry>
  2055. <varlistentry>
  2056. <term>getstats</term>
  2057. <listitem>
  2058. <simpara>
  2059. <command>getstats</command> requests <command>b10-auth</command>
  2060. to send its statistics data to
  2061. <citerefentry><refentrytitle>b10-stats</refentrytitle>
  2062. <manvolnum>8</manvolnum></citerefentry>
  2063. as a response of the command.
  2064. </simpara>
  2065. </listitem>
  2066. </varlistentry>
  2067. <varlistentry>
  2068. <term>shutdown</term>
  2069. <listitem>
  2070. <simpara>Stop the authoritative DNS server.
  2071. This has an optional <varname>pid</varname> argument to
  2072. select the process ID to stop.
  2073. (Note that the BIND 10 boss process may restart this service
  2074. if configured.)
  2075. </simpara>
  2076. </listitem>
  2077. </varlistentry>
  2078. </variablelist>
  2079. </para>
  2080. <!-- TODO: examples of setting or running above? -->
  2081. </section>
  2082. <section id='datasrc'>
  2083. <title>Data Source Backends</title>
  2084. <para>
  2085. Bind 10 has the concept of data sources. A data source is a place
  2086. where authoritative zone data reside and where they can be served
  2087. from. This can be a master file, a database or something completely
  2088. different.
  2089. </para>
  2090. <para>
  2091. Once a query arrives, <command>b10-auth</command> goes through a
  2092. configured list of data sources and finds the one containing a best
  2093. matching zone. From the equally good ones, the first one is taken.
  2094. This data source is then used to answer the query.
  2095. </para>
  2096. <note><para>
  2097. In the development prototype release, <command>b10-auth</command>
  2098. can serve data from a SQLite3 data source backend and from master
  2099. files.
  2100. Upcoming versions will be able to use multiple different
  2101. data sources, such as MySQL and Berkeley DB.
  2102. </para></note>
  2103. <para>
  2104. The configuration is located in data_sources/classes. Each item there
  2105. represents one RR class and a list used to answer queries for that
  2106. class. The default contains two classes. The CH class contains a static
  2107. data source &mdash; one that serves things like
  2108. <quote>AUTHORS.BIND.</quote>. The IN class contains single SQLite3
  2109. data source with database file located at
  2110. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  2111. </para>
  2112. <para>
  2113. Each data source has several options. The first one is
  2114. <varname>type</varname>, which specifies the type of data source to
  2115. use. Valid types include the ones listed below, but BIND 10 uses
  2116. dynamically loaded modules for them, so there may be more in your
  2117. case. This option is mandatory.
  2118. </para>
  2119. <para>
  2120. Another option is <varname>params</varname>. This option is type
  2121. specific; it holds different data depending on the type
  2122. above. Also, depending on the type, it could be possible to omit it.
  2123. </para>
  2124. <para>
  2125. There are two options related to the so-called cache. If you enable
  2126. cache, zone data from the data source are loaded into memory.
  2127. Then, when answering a query, <command>b10-auth</command> looks
  2128. into the memory only instead of the data source, which speeds
  2129. answering up. The first option is <varname>cache-enable</varname>,
  2130. a boolean value turning the cache on and off (off is the default).
  2131. The second one, <varname>cache-zones</varname>, is a list of zone
  2132. origins to load into in-memory.
  2133. <!-- NOT YET: http://bind10.isc.org/ticket/2240
  2134. Once the cache is enabled,
  2135. the zones in the data source not listed in
  2136. <varname>cache-zones</varname> will not be loaded and will
  2137. not be available at all.
  2138. -->
  2139. </para>
  2140. <section id='datasource-types'>
  2141. <title>Data source types</title>
  2142. <para>
  2143. As mentioned, the type used by default is <quote>sqlite3</quote>.
  2144. It has single configuration option inside <varname>params</varname>
  2145. &mdash; <varname>database_file</varname>, which contains the path
  2146. to the SQLite3 file containing the data.
  2147. </para>
  2148. <para>
  2149. Another type is called <quote>MasterFiles</quote>. This one is
  2150. slightly special. The data are stored in RFC1034 master files.
  2151. Because answering directly from them would be impractical,
  2152. this type mandates the cache to be enabled. Also, the list of
  2153. zones (<varname>cache-zones</varname>) should be omitted. The
  2154. <varname>params</varname> is a dictionary mapping from zone
  2155. origins to the files they reside in.
  2156. </para>
  2157. </section>
  2158. <section id='datasrc-examples'>
  2159. <title>Examples</title>
  2160. <para>
  2161. As this is one of the more complex configurations of BIND 10,
  2162. we show some examples. They all assume they start with default
  2163. configuration.
  2164. </para>
  2165. <para>
  2166. First, let's disable the static data source
  2167. (<quote>VERSION.BIND</quote> and friends). As it is the only
  2168. data source in the CH class, we can remove the whole class.
  2169. <screen>&gt; <userinput>config remove data_sources/classes CH</userinput>
  2170. &gt; <userinput>config commit</userinput></screen>
  2171. </para>
  2172. <para>
  2173. Another one, let's say our default data source contains zones
  2174. <quote>example.org.</quote> and <quote>example.net.</quote>.
  2175. We want them to be served from memory to make the answering
  2176. faster.
  2177. <screen>&gt; <userinput>config set data_sources/classes/IN[0]/cache-enable true</userinput>
  2178. &gt; <userinput>config add data_sources/classes/IN[0]/cache-zones example.org.</userinput>
  2179. &gt; <userinput>config add data_sources/classes/IN[0]/cache-zones example.net.</userinput>
  2180. &gt; <userinput>config commit</userinput></screen>
  2181. Now every time the zone in the data source is changed by the
  2182. operator, the authoritative server needs to be told to reload it, by
  2183. <screen>&gt; <userinput>Auth loadzone example.org</userinput></screen>
  2184. You don't need to do this when the zone is modified by
  2185. <command>b10-xfrin</command>; it does so automatically.
  2186. </para>
  2187. <para>
  2188. Now, the last example is when there are master files we want to
  2189. serve in addition to whatever is inside the SQLite3 database.
  2190. <screen>&gt; <userinput>config add data_sources/classes/IN</userinput>
  2191. &gt; <userinput>config set data_sources/classes/IN[1]/type MasterFiles</userinput>
  2192. &gt; <userinput>config set data_sources/classes/IN[1]/cache-enable true</userinput>
  2193. &gt; <userinput>config set data_sources/classes/IN[1]/params { "example.org": "/path/to/example.org", "example.com": "/path/to/example.com" }</userinput>
  2194. &gt; <userinput>config commit</userinput></screen>
  2195. Initially, a map value has to be set, but this value may be an
  2196. empty map. After that, key/value pairs can be added with 'config
  2197. add' and keys can be removed with 'config remove'. The initial
  2198. value may be an empty map, but it has to be set before zones are
  2199. added or removed.
  2200. <screen>
  2201. &gt; <userinput>config set data_sources/classes/IN[1]/params {}</userinput>
  2202. &gt; <userinput>config add data_sources/classes/IN[1]/params another.example.org /path/to/another.example.org</userinput>
  2203. &gt; <userinput>config add data_sources/classes/IN[1]/params another.example.com /path/to/another.example.com</userinput>
  2204. &gt; <userinput>config remove data_sources/classes/IN[1]/params another.example.org</userinput>
  2205. </screen>
  2206. <command>bindctl</command>. To reload a zone, you the same command
  2207. as above.
  2208. </para>
  2209. </section>
  2210. <note>
  2211. <para>
  2212. There's also <varname>Auth/database_file</varname> configuration
  2213. variable, pointing to a SQLite3 database file. This is no longer
  2214. used by <command>b10-auth</command>, but it is left in place for
  2215. now, since other modules use it. Once <command>b10-xfrin</command>,
  2216. <command>b10-xfrout</command> and <command>b10-ddns</command>
  2217. are ported to the new configuration, this will disappear. But for
  2218. now, make sure that if you use any of these modules, the new
  2219. and old configuration correspond. The defaults are consistent, so
  2220. unless you tweaked either the new or the old configuration, you're
  2221. good.
  2222. </para>
  2223. </note>
  2224. </section>
  2225. <section>
  2226. <title>Loading Master Zones Files</title>
  2227. <para>
  2228. RFC 1035 style DNS master zone files may imported
  2229. into a BIND 10 SQLite3 data source by using the
  2230. <command>b10-loadzone</command> utility.
  2231. </para>
  2232. <para>
  2233. <command>b10-loadzone</command> supports the following
  2234. special directives (control entries):
  2235. <variablelist>
  2236. <varlistentry>
  2237. <term>$INCLUDE</term>
  2238. <listitem>
  2239. <simpara>Loads an additional zone file. This may be recursive.
  2240. </simpara>
  2241. </listitem>
  2242. </varlistentry>
  2243. <varlistentry>
  2244. <term>$ORIGIN</term>
  2245. <listitem>
  2246. <simpara>Defines the relative domain name.
  2247. </simpara>
  2248. </listitem>
  2249. </varlistentry>
  2250. <varlistentry>
  2251. <term>$TTL</term>
  2252. <listitem>
  2253. <simpara>Defines the time-to-live value used for following
  2254. records that don't include a TTL.
  2255. </simpara>
  2256. </listitem>
  2257. </varlistentry>
  2258. </variablelist>
  2259. </para>
  2260. <para>
  2261. The <option>-o</option> argument may be used to define the
  2262. default origin for loaded zone file records.
  2263. </para>
  2264. <note>
  2265. <para>
  2266. In the development prototype release, only the SQLite3 back
  2267. end is used by <command>b10-loadzone</command>.
  2268. By default, it stores the zone data in
  2269. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  2270. unless the <option>-d</option> switch is used to set the
  2271. database filename.
  2272. Multiple zones are stored in a single SQLite3 zone database.
  2273. </para>
  2274. </note>
  2275. <para>
  2276. If you reload a zone already existing in the database,
  2277. all records from that prior zone disappear and a whole new set
  2278. appears.
  2279. </para>
  2280. <!--TODO: permissions for xfrin or loadzone to create the file -->
  2281. </section>
  2282. <!--
  2283. TODO
  2284. <section>
  2285. <title>Troubleshooting</title>
  2286. <para>
  2287. </para>
  2288. </section>
  2289. -->
  2290. </chapter>
  2291. <chapter id="xfrin">
  2292. <title>Incoming Zone Transfers</title>
  2293. <para>
  2294. Incoming zones are transferred using the <command>b10-xfrin</command>
  2295. process which is started by <command>bind10</command>.
  2296. When received, the zone is stored in the corresponding BIND 10
  2297. data source, and its records can be served by
  2298. <command>b10-auth</command>.
  2299. In combination with <command>b10-zonemgr</command> (for
  2300. automated SOA checks), this allows the BIND 10 server to
  2301. provide <emphasis>secondary</emphasis> service.
  2302. </para>
  2303. <para>
  2304. The <command>b10-xfrin</command> process supports both AXFR and
  2305. IXFR. Due to some implementation limitations of the current
  2306. development release, however, it only tries AXFR by default,
  2307. and care should be taken to enable IXFR.
  2308. </para>
  2309. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  2310. <section>
  2311. <title>Configuration for Incoming Zone Transfers</title>
  2312. <para>
  2313. In practice, you need to specify a list of secondary zones to
  2314. enable incoming zone transfers for these zones (you can still
  2315. trigger a zone transfer manually, without a prior configuration
  2316. (see below)).
  2317. </para>
  2318. <para>
  2319. For example, to enable zone transfers for a zone named "example.com"
  2320. (whose master address is assumed to be 2001:db8::53 here),
  2321. run the following at the <command>bindctl</command> prompt:
  2322. <screen>&gt; <userinput>config add Xfrin/zones</userinput>
  2323. &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
  2324. &gt; <userinput>config set Xfrin/zones[0]/master_addr "<option>2001:db8::53</option>"</userinput>
  2325. &gt; <userinput>config commit</userinput></screen>
  2326. (We assume there has been no zone configuration before).
  2327. </para>
  2328. </section>
  2329. <section>
  2330. <title>Enabling IXFR</title>
  2331. <para>
  2332. As noted above, <command>b10-xfrin</command> uses AXFR for
  2333. zone transfers by default. To enable IXFR for zone transfers
  2334. for a particular zone, set the <userinput>use_ixfr</userinput>
  2335. configuration parameter to <userinput>true</userinput>.
  2336. In the above example of configuration sequence, you'll need
  2337. to add the following before performing <userinput>commit</userinput>:
  2338. <screen>&gt; <userinput>config set Xfrin/zones[0]/use_ixfr true</userinput></screen>
  2339. </para>
  2340. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  2341. <note><simpara>
  2342. One reason why IXFR is disabled by default in the current
  2343. release is because it does not support automatic fallback from IXFR to
  2344. AXFR when it encounters a primary server that doesn't support
  2345. outbound IXFR (and, not many existing implementations support
  2346. it). Another, related reason is that it does not use AXFR even
  2347. if it has no knowledge about the zone (like at the very first
  2348. time the secondary server is set up). IXFR requires the
  2349. "current version" of the zone, so obviously it doesn't work
  2350. in this situation and AXFR is the only workable choice.
  2351. The current release of <command>b10-xfrin</command> does not
  2352. make this selection automatically.
  2353. These features will be implemented in a near future
  2354. version, at which point we will enable IXFR by default.
  2355. </simpara></note>
  2356. </section>
  2357. <!-- TODO:
  2358. how to tell bind10 you are a secondary?
  2359. when will it first attempt to check for new zone? (using REFRESH?)
  2360. what if zonemgr is not running?
  2361. what if a NOTIFY is sent?
  2362. -->
  2363. <section id="zonemgr">
  2364. <title>Secondary Manager</title>
  2365. <para>
  2366. The <command>b10-zonemgr</command> process is started by
  2367. <command>bind10</command>.
  2368. It keeps track of SOA refresh, retry, and expire timers
  2369. and other details for BIND 10 to perform as a slave.
  2370. When the <command>b10-auth</command> authoritative DNS server
  2371. receives a NOTIFY message, <command>b10-zonemgr</command>
  2372. may tell <command>b10-xfrin</command> to do a refresh
  2373. to start an inbound zone transfer.
  2374. The secondary manager resets its counters when a new zone is
  2375. transferred in.
  2376. </para>
  2377. <note><simpara>
  2378. Access control (such as allowing notifies) is not yet provided.
  2379. The primary/secondary service is not yet complete.
  2380. </simpara></note>
  2381. <para>
  2382. The following example shows using <command>bindctl</command>
  2383. to configure the server to be a secondary for the example zone:
  2384. <screen>&gt; <userinput>config add Zonemgr/secondary_zones</userinput>
  2385. &gt; <userinput>config set Zonemgr/secondary_zones[0]/name "<option>example.com</option>"</userinput>
  2386. &gt; <userinput>config commit</userinput></screen>
  2387. </para>
  2388. <para>
  2389. If the zone does not exist in the data source already
  2390. (i.e. no SOA record for it), <command>b10-zonemgr</command>
  2391. will automatically tell <command>b10-xfrin</command>
  2392. to transfer the zone in.
  2393. </para>
  2394. </section>
  2395. <section>
  2396. <title>Trigger an Incoming Zone Transfer Manually</title>
  2397. <para>
  2398. To manually trigger a zone transfer to retrieve a remote zone,
  2399. you may use the <command>bindctl</command> utility.
  2400. For example, at the <command>bindctl</command> prompt run:
  2401. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  2402. </para>
  2403. </section>
  2404. <section>
  2405. <title>Incoming Transfers with In-memory Datasource</title>
  2406. <para>
  2407. In the case of an incoming zone transfer, the received zone is
  2408. first stored in the corresponding BIND 10 datasource. In
  2409. case the secondary zone is served by an in-memory datasource
  2410. with an SQLite3 backend, <command>b10-auth</command> is
  2411. automatically sent a <varname>loadzone</varname> command to
  2412. reload the corresponding zone into memory from the backend.
  2413. </para>
  2414. <!-- TODO: currently it delays the queries; see
  2415. http://bind10.isc.org/wiki/ScalableZoneLoadDesign#a7.2UpdatingaZone
  2416. -->
  2417. <para>
  2418. The administrator doesn't have to do anything for
  2419. <command>b10-auth</command> to serve the new version of the
  2420. zone, except for the configuration such as the one described in
  2421. <xref linkend="datasrc" />.
  2422. </para>
  2423. </section>
  2424. <!-- TODO: can that retransfer be used to identify a new zone? -->
  2425. <!-- TODO: what if doesn't exist at that master IP? -->
  2426. </chapter>
  2427. <chapter id="xfrout">
  2428. <title>Outbound Zone Transfers</title>
  2429. <para>
  2430. The <command>b10-xfrout</command> process is started by
  2431. <command>bind10</command>.
  2432. When the <command>b10-auth</command> authoritative DNS server
  2433. receives an AXFR or IXFR request, <command>b10-auth</command>
  2434. internally forwards the request to <command>b10-xfrout</command>,
  2435. which handles the rest of this request processing.
  2436. This is used to provide primary DNS service to share zones
  2437. to secondary name servers.
  2438. The <command>b10-xfrout</command> is also used to send
  2439. NOTIFY messages to secondary servers.
  2440. </para>
  2441. <para>
  2442. A global or per zone <option>transfer_acl</option> configuration
  2443. can be used to control accessibility of the outbound zone
  2444. transfer service.
  2445. By default, <command>b10-xfrout</command> allows any clients to
  2446. perform zone transfers for any zones.
  2447. </para>
  2448. <screen>&gt; <userinput>config show Xfrout/transfer_acl</userinput>
  2449. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</screen>
  2450. <para>
  2451. If you want to require TSIG in access control, a system wide TSIG
  2452. key ring must be configured (see <xref linkend="tsig-key-ring"/>).
  2453. In this example, we allow client matching both the IP address
  2454. and key.
  2455. </para>
  2456. <screen>&gt; <userinput>config set tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</userinput>
  2457. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]</userinput>
  2458. &gt; <userinput>config commit</userinput></screen>
  2459. <para>Both <command>b10-xfrout</command> and <command>b10-auth</command>
  2460. will use the system wide key ring to check
  2461. TSIGs in the incoming messages and to sign responses.</para>
  2462. <para>
  2463. For further details on ACL configuration, see
  2464. <xref linkend="common-acl" />.
  2465. </para>
  2466. <note><simpara>
  2467. The way to specify zone specific configuration (ACLs, etc) is
  2468. likely to be changed.
  2469. </simpara></note>
  2470. <!--
  2471. TODO:
  2472. xfrout section:
  2473. auth servers checks for AXFR query
  2474. sends the XFR query to the xfrout module
  2475. uses /tmp/auth_xfrout_conn which is a socket
  2476. what is XfroutClient xfr_client??
  2477. /tmp/auth_xfrout_conn is not removed
  2478. -->
  2479. </chapter>
  2480. <chapter id="ddns">
  2481. <title>Dynamic DNS Update</title>
  2482. <para>
  2483. BIND 10 supports the server side of the Dynamic DNS Update
  2484. (DDNS) protocol as defined in RFC 2136.
  2485. This service is provided by the <command>b10-ddns</command>
  2486. component, which is started by the <command>bind10</command>
  2487. process if configured so.
  2488. </para>
  2489. <para>
  2490. When the <command>b10-auth</command> authoritative DNS server
  2491. receives an UPDATE request, it internally forwards the request
  2492. to <command>b10-ddns</command>, which handles the rest of
  2493. this request processing.
  2494. When the processing is completed, <command>b10-ddns</command>
  2495. will send a response to the client as specified in RFC 2136
  2496. (NOERROR for successful update, REFUSED if rejected due to
  2497. ACL check, etc).
  2498. If the zone has been changed as a result, it will internally
  2499. notify <command>b10-xfrout</command> so that other secondary
  2500. servers will be notified via the DNS NOTIFY protocol.
  2501. In addition, if <command>b10-auth</command> serves the updated
  2502. zone (as described in
  2503. <xref linkend="datasrc" />),
  2504. <command>b10-ddns</command> will also
  2505. notify <command>b10-auth</command> so that <command>b10-auth</command>
  2506. will re-cache the updated zone content if necessary.
  2507. </para>
  2508. <para>
  2509. The <command>b10-ddns</command> component supports requests over
  2510. both UDP and TCP, and both IPv6 and IPv4; for TCP requests,
  2511. however, it terminates the TCP connection immediately after
  2512. each single request has been processed. Clients cannot reuse the
  2513. same TCP connection for multiple requests. (This is a current
  2514. implementation limitation of <command>b10-ddns</command>.
  2515. While RFC 2136 doesn't specify anything about such reuse of TCP
  2516. connection, there is no reason for disallowing it as RFC 1035
  2517. generally allows multiple requests sent over a single TCP
  2518. connection. BIND 9 supports such reuse.)
  2519. </para>
  2520. <para>
  2521. As of this writing <command>b10-ddns</command> does not support
  2522. update forwarding for secondary zones.
  2523. If it receives an update request for a secondary zone, it will
  2524. immediately return a <quote>not implemented</quote> response.
  2525. <note><simpara>
  2526. For feature completeness, update forwarding should be
  2527. eventually supported. But currently it's considered a lower
  2528. priority task and there is no specific plan of implementing
  2529. this feature.
  2530. <!-- See Trac #2063 -->
  2531. </simpara></note>
  2532. </para>
  2533. <section>
  2534. <title>Enabling Dynamic Update</title>
  2535. <para>
  2536. First off, it must be made sure that a few components on which
  2537. <command>b10-ddns</command> depends are configured to run,
  2538. which are <command>b10-auth</command>
  2539. and <command>b10-zonemgr</command>.
  2540. In addition, <command>b10-xfrout</command> should also be
  2541. configured to run; otherwise the notification after an update
  2542. (see above) will fail with a timeout, suspending the DDNS
  2543. service while <command>b10-ddns</command> waits for the
  2544. response (see the description of the <ulink
  2545. url="bind10-messages.html#DDNS_UPDATE_NOTIFY_FAIL">DDNS_UPDATE_NOTIFY_FAIL</ulink>
  2546. log message for further details).
  2547. If BIND 10 is already configured to provide authoritative DNS
  2548. service they should normally be configured to run already.
  2549. </para>
  2550. <para>
  2551. Second, for the obvious reason dynamic update requires that the
  2552. underlying data source storing the zone data be writable.
  2553. In the current implementation this means the zone must be stored
  2554. in an SQLite3-based data source.
  2555. Also, in this development version, the <command>b10-ddns</command>
  2556. component configures itself with the data source referring to the
  2557. <varname>database_file</varname> configuration parameter of
  2558. <command>b10-auth</command>.
  2559. So this information must be configured correctly before starting
  2560. <command>b10-ddns</command>.
  2561. <note><simpara>
  2562. The way to configure data sources is now being revised.
  2563. Configuration on the data source for DDNS will be very
  2564. likely to be changed in a backward incompatible manner in
  2565. a near future version.
  2566. </simpara></note>
  2567. </para>
  2568. <para>
  2569. In general, if something goes wrong regarding the dependency
  2570. described above, <command>b10-ddns</command> will log the
  2571. related event at the warning or error level.
  2572. It's advisable to check the log message when you first enable
  2573. DDNS or if it doesn't work as you expect to see if there's any
  2574. warning or error log message.
  2575. </para>
  2576. <para>
  2577. Next, to enable the DDNS service, <command>b10-ddns</command>
  2578. needs to be explicitly configured to run.
  2579. It can be done by using the <command>bindctl</command>
  2580. utility. For example:
  2581. <screen>
  2582. &gt; <userinput>config add Boss/components b10-ddns</userinput>
  2583. &gt; <userinput>config set Boss/components/b10-ddns/address DDNS</userinput>
  2584. &gt; <userinput>config set Boss/components/b10-ddns/kind dispensable</userinput>
  2585. &gt; <userinput>config commit</userinput>
  2586. </screen>
  2587. <note><simpara>
  2588. In theory <varname>kind</varname> could be omitted because
  2589. "dispensable" is its default.
  2590. But there's some peculiar behavior (which should be a
  2591. bug and should be fixed eventually; see Trac ticket #2064)
  2592. with <command>bindctl</command> and you'll still need to
  2593. specify that explicitly. Likewise, <varname>address</varname>
  2594. may look unnecessary because <command>b10-ddns</command>
  2595. would start and work without specifying it. But for it
  2596. to shutdown gracefully this parameter should also be
  2597. specified.
  2598. </simpara></note>
  2599. </para>
  2600. </section>
  2601. <section>
  2602. <title>Access Control</title>
  2603. <para>
  2604. By default, <command>b10-ddns</command> rejects any update
  2605. requests from any clients by returning a REFUSED response.
  2606. To allow updates to take effect, an access control rule
  2607. (called update ACL) with a policy allowing updates must explicitly be
  2608. configured.
  2609. Update ACL must be configured per zone basis in the
  2610. <varname>zones</varname> configuration parameter of
  2611. <command>b10-ddns</command>.
  2612. This is a list of per-zone configurations regarding DDNS.
  2613. Each list element consists of the following parameters:
  2614. <variablelist>
  2615. <varlistentry>
  2616. <term>origin</term>
  2617. <listitem>
  2618. <simpara>The zone's origin name</simpara>
  2619. </listitem>
  2620. </varlistentry>
  2621. <varlistentry>
  2622. <term>class</term>
  2623. <listitem>
  2624. <simpara>The RR class of the zone
  2625. (normally <quote>IN</quote>, and in that case
  2626. can be omitted in configuration)</simpara>
  2627. </listitem>
  2628. </varlistentry>
  2629. <varlistentry>
  2630. <term>update_acl</term>
  2631. <listitem>
  2632. <simpara>List of access control rules (ACL) for the zone</simpara>
  2633. </listitem>
  2634. </varlistentry>
  2635. </variablelist>
  2636. The syntax of the ACL is the same as ACLs for other
  2637. components.
  2638. Specific examples are given below.
  2639. </para>
  2640. <para>
  2641. In general, an update ACL rule that allows an update request
  2642. should be configured with a TSIG key.
  2643. This is an example update ACL that allows updates to the zone
  2644. named <quote>example.org</quote> (of default RR class <quote>IN</quote>)
  2645. from clients that send requests signed with a TSIG whose
  2646. key name is "key.example.org" (and refuses all others):
  2647. <screen>
  2648. &gt; <userinput>config add DDNS/zones</userinput>
  2649. &gt; <userinput>config set DDNS/zones[0]/origin example.org</userinput>
  2650. &gt; <userinput>config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "key.example.org"}</userinput>
  2651. &gt; <userinput>config commit</userinput>
  2652. </screen>
  2653. The TSIG key must be configured system wide
  2654. (see <xref linkend="common-tsig"/>).
  2655. </para>
  2656. <para>
  2657. The full description of ACLs can be found in <xref
  2658. linkend="common-acl" />.
  2659. </para>
  2660. <note><simpara>
  2661. The <command>b10-ddns</command> component accepts an ACL
  2662. rule that just allows updates from a specific IP address
  2663. (i.e., without requiring TSIG), but this is highly
  2664. discouraged (remember that requests can be made over UDP and
  2665. spoofing the source address of a UDP packet is often pretty
  2666. easy).
  2667. Unless you know what you are doing and that you can accept
  2668. its consequence, any update ACL rule that allows updates
  2669. should have a TSIG key in its constraints.
  2670. </simpara></note>
  2671. <para>
  2672. Currently update ACL can only control updates per zone basis;
  2673. it's not possible to specify access control with higher
  2674. granularity such as for particular domain names or specific
  2675. types of RRs.
  2676. <!-- See Trac ticket #2065 -->
  2677. </para>
  2678. <note><simpara>
  2679. Contrary to what RFC 2136 (literally) specifies,
  2680. <command>b10-ddns</command> checks the update ACL before
  2681. checking the prerequisites of the update request.
  2682. This is a deliberate implementation decision.
  2683. This counter intuitive specification has been repeatedly
  2684. discussed among implementers and in the IETF, and it is now
  2685. widely agreed that it does not make sense to strictly follow
  2686. that part of RFC.
  2687. One known specific bad result of following the RFC is that it
  2688. could leak information about which name or record exists or does not
  2689. exist in the zone as a result of prerequisite checks even if a
  2690. zone is somehow configured to reject normal queries from
  2691. arbitrary clients.
  2692. There have been other troubles that could have been avoided if
  2693. the ACL could be checked before the prerequisite check.
  2694. </simpara></note>
  2695. </section>
  2696. <section>
  2697. <title>Miscellaneous Operational Issues</title>
  2698. <para>
  2699. Unlike BIND 9, BIND 10 currently does not support automatic
  2700. re-signing of DNSSEC-signed zone when it's updated via DDNS.
  2701. It could be possible to re-sign the updated zone afterwards
  2702. or make sure the update request also updates related DNSSEC
  2703. records, but that will be pretty error-prone operation.
  2704. In general, it's not advisable to allow DDNS for a signed zone
  2705. at this moment.
  2706. </para>
  2707. <para>
  2708. Also unlike BIND 9, it's currently not possible
  2709. to <quote>freeze</quote> a zone temporarily in order to
  2710. suspend DDNS while you manually update the zone.
  2711. If you need to make manual updates to a dynamic zone,
  2712. you'll need to temporarily reject any updates to the zone via
  2713. the update ACLs.
  2714. </para>
  2715. <para>
  2716. Dynamic updates are only applicable to primary zones.
  2717. In order to avoid updating secondary zones via DDNS requests,
  2718. <command>b10-ddns</command> refers to the
  2719. <quote>secondary_zones</quote> configuration of
  2720. <command>b10-zonemgr</command>. Zones listed in
  2721. <quote>secondary_zones</quote> will never be updated via DDNS
  2722. regardless of the update ACL configuration;
  2723. <command>b10-ddns</command> will return a NOTAUTH (server
  2724. not authoritative for the zone) response.
  2725. If you have a "conceptual" secondary zone whose content is a
  2726. copy of some external source but is not updated via the
  2727. standard zone transfers and therefore not listed in
  2728. <quote>secondary_zones</quote>, be careful not to allow DDNS
  2729. for the zone; it would be quite likely to lead to inconsistent
  2730. state between different servers.
  2731. Normally this should not be a problem because the default
  2732. update ACL rejects any update requests, but you may want to
  2733. take an extra care about the configuration if you have such
  2734. type of secondary zones.
  2735. </para>
  2736. <para>
  2737. The difference of two versions of a zone, before and after a
  2738. DDNS transaction, is automatically recorded in the underlying
  2739. data source, and can be retrieved in the form of outbound
  2740. IXFR.
  2741. This is done automatically; it does not require specific
  2742. configuration to make this possible.
  2743. </para>
  2744. </section>
  2745. </chapter>
  2746. <chapter id="resolverserver">
  2747. <title>Recursive Name Server</title>
  2748. <para>
  2749. The <command>b10-resolver</command> process is started by
  2750. <command>bind10</command>.
  2751. <!-- TODO
  2752. It provides a resolver so DNS clients can ask it to do recursion
  2753. and it will return answers.
  2754. -->
  2755. </para>
  2756. <para>
  2757. The main <command>bind10</command> process can be configured
  2758. to select to run either the authoritative or resolver or both.
  2759. By default, it doesn't start either one. You may change this using
  2760. <command>bindctl</command>, for example:
  2761. <screen>
  2762. &gt; <userinput>config add Boss/components b10-resolver</userinput>
  2763. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  2764. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  2765. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  2766. &gt; <userinput>config commit</userinput>
  2767. </screen>
  2768. </para>
  2769. <para>
  2770. The master <command>bind10</command> will stop and start
  2771. the desired services.
  2772. </para>
  2773. <para>
  2774. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  2775. The following example shows how it can be configured to
  2776. listen on an additional address (and port):
  2777. <screen>
  2778. &gt; <userinput>config add Resolver/listen_on</userinput>
  2779. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
  2780. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
  2781. &gt; <userinput>config commit</userinput>
  2782. </screen>
  2783. </para>
  2784. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  2785. as needed; run <quote><userinput>config show
  2786. Resolver/listen_on</userinput></quote> if needed.)</simpara>
  2787. <!-- TODO: this example should not include the port, ticket #1185 -->
  2788. <section>
  2789. <title>Access Control</title>
  2790. <para>
  2791. By default, the <command>b10-resolver</command> daemon only accepts
  2792. DNS queries from the localhost (127.0.0.1 and ::1).
  2793. The <option>Resolver/query_acl</option> configuration may
  2794. be used to reject, drop, or allow specific IPs or networks.
  2795. See <xref linkend="common-acl" />.
  2796. </para>
  2797. <para>
  2798. The following session is an example of extending the ACL to also
  2799. allow queries from 192.0.2.0/24:
  2800. <screen>
  2801. > <userinput>config show Resolver/query_acl</userinput>
  2802. Resolver/query_acl[0] {"action": "ACCEPT", "from": "127.0.0.1"} any (default)
  2803. Resolver/query_acl[1] {"action": "ACCEPT", "from": "::1"} any (default)
  2804. > <userinput>config add Resolver/query_acl</userinput>
  2805. > <userinput>config set Resolver/query_acl[2] {"action": "ACCEPT", "from": "192.0.2.0/24"}</userinput>
  2806. > <userinput>config add Resolver/query_acl</userinput>
  2807. > <userinput>config show Resolver/query_acl</userinput>
  2808. Resolver/query_acl[0] {"action": "ACCEPT", "from": "127.0.0.1"} any (modified)
  2809. Resolver/query_acl[1] {"action": "ACCEPT", "from": "::1"} any (modified)
  2810. Resolver/query_acl[2] {"action": "ACCEPT", "from": "192.0.2.0/24"} any (modified)
  2811. Resolver/query_acl[3] {"action": "REJECT"} any (modified)
  2812. > <userinput>config commit</userinput></screen>
  2813. Note that we didn't set the value of the last final rule
  2814. (query_acl[3]) -- in the case of resolver, rejecting all queries is
  2815. the default value of a new rule. In fact, this rule can even be
  2816. omitted completely, as the default, when a query falls off the list,
  2817. is rejection.
  2818. </para>
  2819. </section>
  2820. <section>
  2821. <title>Forwarding</title>
  2822. <para>
  2823. To enable forwarding, the upstream address and port must be
  2824. configured to forward queries to, such as:
  2825. <screen>
  2826. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  2827. &gt; <userinput>config commit</userinput>
  2828. </screen>
  2829. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  2830. full resolver.)
  2831. </para>
  2832. <para>
  2833. Normal iterative name service can be re-enabled by clearing the
  2834. forwarding address(es); for example:
  2835. <screen>
  2836. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  2837. &gt; <userinput>config commit</userinput>
  2838. </screen>
  2839. </para>
  2840. </section>
  2841. <!-- TODO: later try this
  2842. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  2843. > config set Resolver/forward_addresses[0]/port 53
  2844. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  2845. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  2846. -->
  2847. </chapter>
  2848. <chapter id="dhcp4">
  2849. <title>DHCPv4 Server</title>
  2850. <para>Dynamic Host Configuration Protocol for IPv4 (DHCP or
  2851. DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  2852. are protocols that allow one node (server) to provision
  2853. configuration parameters to many hosts and devices (clients). To
  2854. ease deployment in larger networks, additional nodes (relays) may
  2855. be deployed that facilitate communication between servers and
  2856. clients. Even though principles of both DHCPv4 and DHCPv6 are
  2857. somewhat similar, these are two radically different
  2858. protocols. BIND 10 offers server implementations for both DHCPv4
  2859. and DHCPv6. This chapter is about DHCP for IPv4. For a description
  2860. of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para>
  2861. <para>The DHCPv4 server component is currently under intense
  2862. development. You may want to check out <ulink
  2863. url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
  2864. and recent posts on <ulink
  2865. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
  2866. developers mailing list</ulink>.</para>
  2867. <para>The DHCPv4 and DHCPv6 components in BIND 10 architecture are
  2868. internally code named <quote>Kea</quote>.</para>
  2869. <note>
  2870. <para>
  2871. As of December 2011, both DHCPv4 and DHCPv6 components are
  2872. skeleton servers. That means that while they are capable of
  2873. performing DHCP configuration, they are not fully functional
  2874. yet. In particular, neither has functional lease
  2875. databases. This means that they will assign the same, fixed,
  2876. hardcoded addresses to any client that will ask. See <xref
  2877. linkend="dhcp4-limit"/> and <xref linkend="dhcp6-limit"/> for
  2878. detailed description.
  2879. </para>
  2880. </note>
  2881. <section id="dhcp4-usage">
  2882. <title>DHCPv4 Server Usage</title>
  2883. <para>BIND 10 provides the DHCPv4 server component since December
  2884. 2011. It is a skeleton server and can be described as an early
  2885. prototype that is not fully functional yet. It is mature enough
  2886. to conduct first tests in lab environment, but it has
  2887. significant limitations. See <xref linkend="dhcp4-limit"/> for
  2888. details.
  2889. </para>
  2890. <para>
  2891. <command>b10-dhcp4</command> is a BIND 10 component and is being
  2892. run under BIND 10 framework. To add a DHCPv4 process to the set of running
  2893. BIND 10 services, you can use following commands in <command>bindctl</command>:
  2894. <screen>&gt; <userinput>config add Boss/components b10-dhcp4</userinput>
  2895. &gt; <userinput>config set Boss/components/b10-dhcp4/kind dispensable</userinput>
  2896. &gt; <userinput>config commit</userinput></screen></para>
  2897. <para>
  2898. To shutdown running <command>b10-dhcp4</command>, please use the
  2899. following command:
  2900. <screen>&gt; <userinput>Dhcp4 shutdown</userinput></screen>
  2901. or
  2902. <screen>&gt; <userinput>config remove Boss/components b10-dhcp4</userinput>
  2903. &gt; <userinput>config commit</userinput></screen></para>
  2904. <para>
  2905. During start-up the server will detect available network interfaces
  2906. and will attempt to open UDP sockets on all interfaces that
  2907. are up, running, are not loopback, and have IPv4 address
  2908. assigned.
  2909. The server will then listen to incoming traffic. Currently
  2910. supported client messages are DISCOVER and REQUEST. The server
  2911. will respond to them with OFFER and ACK, respectively.
  2912. Since the DHCPv4 server opens privileged ports, it requires root
  2913. access. Make sure you run this daemon as root.
  2914. </para>
  2915. </section>
  2916. <section id="dhcp4-config">
  2917. <title>DHCPv4 Server Configuration</title>
  2918. <para>
  2919. The DHCPv4 server does not have a lease database implemented yet
  2920. nor any support for configuration, so the same set
  2921. of configuration options (including the same fixed address)
  2922. will be assigned every time.
  2923. </para>
  2924. <para>
  2925. At this stage of development, the only way to alter the server
  2926. configuration is to modify its source code. To do so, please
  2927. edit src/bin/dhcp4/dhcp4_srv.cc file and modify following
  2928. parameters and recompile:
  2929. <screen>
  2930. const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
  2931. const std::string HARDCODED_NETMASK = "255.255.255.0";
  2932. const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds
  2933. const std::string HARDCODED_GATEWAY = "192.0.2.1";
  2934. const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
  2935. const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
  2936. const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
  2937. Lease database and configuration support is planned for 2012.
  2938. </para>
  2939. </section>
  2940. <section id="dhcp4-std">
  2941. <title>Supported standards</title>
  2942. <para>The following standards and draft standards are currently
  2943. supported:</para>
  2944. <itemizedlist>
  2945. <listitem>
  2946. <simpara>RFC2131: Supported messages are DISCOVER, OFFER,
  2947. REQUEST, and ACK.</simpara>
  2948. </listitem>
  2949. <listitem>
  2950. <simpara>RFC2132: Supported options are: PAD (0),
  2951. END(255), Message Type(53), DHCP Server Identifier (54),
  2952. Domain Name (15), DNS Servers (6), IP Address Lease Time
  2953. (51), Subnet mask (1), and Routers (3).</simpara>
  2954. </listitem>
  2955. </itemizedlist>
  2956. </section>
  2957. <section id="dhcp4-limit">
  2958. <title>DHCPv4 Server Limitations</title>
  2959. <para>These are the current limitations of the DHCPv4 server
  2960. software. Most of them are reflections of the early stage of
  2961. development and should be treated as <quote>not implemented
  2962. yet</quote>, rather than actual limitations.</para>
  2963. <itemizedlist>
  2964. <listitem>
  2965. <simpara>During initial IPv4 node configuration, the
  2966. server is expected to send packets to a node that does not
  2967. have IPv4 address assigned yet. The server requires
  2968. certain tricks (or hacks) to transmit such packets. This
  2969. is not implemented yet, therefore DHCPv4 server supports
  2970. relayed traffic only (that is, normal point to point
  2971. communication).</simpara>
  2972. </listitem>
  2973. <listitem>
  2974. <simpara><command>b10-dhcp4</command> provides a single,
  2975. fixed, hardcoded lease to any client that asks. There is
  2976. no lease manager implemented. If two clients request
  2977. addresses, they will both get the same fixed
  2978. address.</simpara>
  2979. </listitem>
  2980. <listitem>
  2981. <simpara><command>b10-dhcp4</command> does not support any
  2982. configuration mechanisms yet. The whole configuration is
  2983. currently hardcoded. The only way to tweak configuration
  2984. is to directly modify source code. See see <xref
  2985. linkend="dhcp4-config"/> for details.</simpara>
  2986. </listitem>
  2987. <listitem>
  2988. <simpara>Upon start, the server will open sockets on all
  2989. interfaces that are not loopback, are up and running and
  2990. have IPv4 address.</simpara>
  2991. </listitem>
  2992. <listitem>
  2993. <simpara>PRL (Parameter Request List, a list of options
  2994. requested by a client) is currently ignored and server
  2995. assigns DNS SERVER and DOMAIN NAME options.</simpara>
  2996. </listitem>
  2997. <listitem>
  2998. <simpara><command>b10-dhcp4</command> does not support
  2999. BOOTP. That is a design choice. This limitation is
  3000. permanent. If you have legacy nodes that can't use DHCP and
  3001. require BOOTP support, please use latest version of ISC DHCP
  3002. <ulink url="http://www.isc.org/software/dhcp"/>.</simpara>
  3003. </listitem>
  3004. <listitem>
  3005. <simpara>Interface detection is currently working on Linux
  3006. only. See <xref linkend="iface-detect"/> for details.</simpara>
  3007. </listitem>
  3008. <listitem>
  3009. <simpara><command>b10-dhcp4</command> does not verify that
  3010. assigned address is unused. According to RFC2131, the
  3011. allocating server should verify that address is no used by
  3012. sending ICMP echo request.</simpara>
  3013. </listitem>
  3014. <listitem>
  3015. <simpara>Address renewal (RENEW), rebinding (REBIND),
  3016. confirmation (CONFIRM), duplication report (DECLINE) and
  3017. release (RELEASE) are not supported yet.</simpara>
  3018. </listitem>
  3019. <listitem>
  3020. <simpara>DNS Update is not supported yet.</simpara>
  3021. </listitem>
  3022. <listitem>
  3023. <simpara>-v (verbose) command line option is currently
  3024. the default, and cannot be disabled.</simpara>
  3025. </listitem>
  3026. </itemizedlist>
  3027. </section>
  3028. </chapter>
  3029. <chapter id="dhcp6">
  3030. <title>DHCPv6 Server</title>
  3031. <para>Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is
  3032. specified in RFC3315. BIND 10 provides DHCPv6 server implementation
  3033. that is described in this chapter. For a description of the DHCPv4
  3034. server implementation, see <xref linkend="dhcp4"/>.
  3035. </para>
  3036. <para>The DHCPv6 server component is currently under intense
  3037. development. You may want to check out <ulink
  3038. url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
  3039. and recent posts on <ulink
  3040. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
  3041. developers mailing list</ulink>.</para>
  3042. <para>The DHCPv4 and DHCPv6 components in BIND 10 architecture are
  3043. internally code named <quote>Kea</quote>.</para>
  3044. <note>
  3045. <para>
  3046. As of December 2011, both DHCPv4 and DHCPv6 components are
  3047. skeleton servers. That means that while they are capable of
  3048. performing DHCP configuration, they are not fully functional
  3049. yet. In particular, neither has functional lease
  3050. databases. This means that they will assign the same, fixed,
  3051. hardcoded addresses to any client that will ask. See <xref
  3052. linkend="dhcp4-limit"/> and <xref linkend="dhcp6-limit"/> for
  3053. detailed description.
  3054. </para>
  3055. </note>
  3056. <section id="dhcp6-usage">
  3057. <title>DHCPv6 Server Usage</title>
  3058. <para>
  3059. BIND 10 provides the DHCPv6 server component since September
  3060. 2011. It is a skeleton server and can be described as an early
  3061. prototype that is not fully functional yet. It is mature
  3062. enough to conduct first tests in lab environment, but it has
  3063. significant limitations. See <xref linkend="dhcp6-limit"/> for
  3064. details.
  3065. </para>
  3066. <para>
  3067. <command>b10-dhcp6</command> is a BIND 10 component and is being
  3068. run under BIND 10 framework. To add a DHCPv6 process to the set of running
  3069. BIND 10 services, you can use following commands in <command>bindctl</command>:
  3070. <screen>&gt; <userinput>config add Boss/components b10-dhcp6</userinput>
  3071. &gt; <userinput>config set Boss/components/b10-dhcp6/kind dispensable</userinput>
  3072. &gt; <userinput>config commit</userinput></screen>
  3073. </para>
  3074. <para>
  3075. To shutdown running <command>b10-dhcp6</command>, please use the
  3076. following command:
  3077. <screen>&gt; <userinput>Dhcp6 shutdown</userinput></screen>
  3078. or
  3079. <screen>&gt; <userinput>config remove Boss/components b10-dhcp6</userinput>
  3080. &gt; <userinput>config commit</userinput></screen>
  3081. </para>
  3082. <para>
  3083. During start-up the server will detect available network interfaces
  3084. and will attempt to open UDP sockets on all interfaces that
  3085. are up, running, are not loopback, are multicast-capable, and
  3086. have IPv6 address assigned.
  3087. The server will then listen to incoming traffic. Currently
  3088. supported client messages are SOLICIT and REQUEST. The server
  3089. will respond to them with ADVERTISE and REPLY, respectively.
  3090. Since the DHCPv6 server opens privileged ports, it requires root
  3091. access. Make sure you run this daemon as root.
  3092. </para>
  3093. </section>
  3094. <section id="dhcp6-config">
  3095. <title>DHCPv6 Server Configuration</title>
  3096. <para>
  3097. Once the server is started, it can be configured. To view the
  3098. current configuration, use the following command in <command>bindctl</command>:
  3099. <screen>
  3100. &gt; <userinput>config show Dhcp6</userinput></screen>
  3101. When starting Dhcp6 daemon for the first time, the default configuration
  3102. will be available. It will look similar to this:
  3103. <screen>
  3104. &gt; <userinput>config show Dhcp6</userinput>
  3105. Dhcp6/interface "eth0" string (default)
  3106. Dhcp6/renew-timer 1000 integer (default)
  3107. Dhcp6/rebind-timer 2000 integer (default)
  3108. Dhcp6/preferred-lifetime 3000 integer (default)
  3109. Dhcp6/valid-lifetime 4000 integer (default)
  3110. Dhcp6/subnet6 [] list (default)</screen>
  3111. </para>
  3112. <para>
  3113. To change one of the parameters, simply follow
  3114. the usual <command>bindctl</command> procedure. For example, to make the
  3115. leases longer, change their valid-lifetime parameter:
  3116. <screen>
  3117. &gt; <userinput>config set Dhcp6/valid-lifetime 7200</userinput>
  3118. &gt; <userinput>config commit</userinput></screen>
  3119. Please note that most Dhcp6 parameters are of global scope
  3120. and apply to all defined subnets, unless they are overridden on a
  3121. per-subnet basis.
  3122. </para>
  3123. <para>
  3124. The essential role of DHCPv6 server is address assignment. The server
  3125. has to be configured with at least one subnet and one pool of dynamic
  3126. addresses to be managed. For example, assume that the server
  3127. is connected to a network segment that uses the 2001:db8:1::/64
  3128. prefix. The Administrator of that network has decided that addresses from range
  3129. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  3130. server. Such a configuration can be achieved in the following way:
  3131. <screen>
  3132. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3133. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3134. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  3135. &gt; <userinput>config commit</userinput></screen>
  3136. Note that subnet is defined as a simple string, but the pool parameter
  3137. is actually a list of pools: for this reason, the pool definition is
  3138. enclosed in square brackets, even though only one range of addresses
  3139. is specified.</para>
  3140. <para>It is possible to define more than one pool in a
  3141. subnet: continuing the previous example, further assume that
  3142. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  3143. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  3144. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  3145. formats are supported by Dhcp6 and can be mixed in the pool list.
  3146. For example, one could define the following pools:
  3147. <screen>
  3148. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]</userinput>
  3149. &gt; <userinput>config commit</userinput></screen>
  3150. The number of pools is not limited, but for performance reasons it is recommended to
  3151. use as few as possible.
  3152. </para>
  3153. <para>
  3154. The server may be configured to serve more than one subnet. To add a second subnet,
  3155. use a command similar to the following:
  3156. <screen>
  3157. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3158. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  3159. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  3160. &gt; <userinput>config commit</userinput></screen>
  3161. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  3162. previous example. The <command>config add Dhcp6/subnet6</command> adds
  3163. another (second) subnet. It can be referred to as
  3164. <command>Dhcp6/subnet6[1]</command>. In this example, we allow server to
  3165. dynamically assign all addresses available in the whole subnet. Although
  3166. very wasteful, it is certainly a valid configuration to dedicate the
  3167. whole /48 subnet for that purpose.
  3168. </para>
  3169. <para>
  3170. When configuring a DHCPv6 server using prefix/length notation, please pay
  3171. attention to the boundary values. When specifying that the server should use
  3172. a given pool, it will be able to allocate also first (typically network
  3173. address) address from that pool. For example for pool 2001:db8::/64 the
  3174. 2001:db8:: address may be assigned as well. If you want to avoid this,
  3175. please use min-max notation.
  3176. </para>
  3177. <para>
  3178. Note: Although configuration is now accepted, it is not internally used
  3179. by they server yet. At this stage of development, the only way to alter
  3180. server configuration is to modify its source code. To do so, please edit
  3181. src/bin/dhcp6/dhcp6_srv.cc file, modify the following parameters and
  3182. recompile:
  3183. <screen>
  3184. const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
  3185. const uint32_t HARDCODED_T1 = 1500; // in seconds
  3186. const uint32_t HARDCODED_T2 = 2600; // in seconds
  3187. const uint32_t HARDCODED_PREFERRED_LIFETIME = 3600; // in seconds
  3188. const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds
  3189. const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";</screen>
  3190. Lease database and configuration support is planned for 2012.
  3191. </para>
  3192. </section>
  3193. <section id="dhcp6-std">
  3194. <title>Supported DHCPv6 Standards</title>
  3195. <para>The following standards and draft standards are currently
  3196. supported:</para>
  3197. <itemizedlist>
  3198. <listitem>
  3199. <simpara>RFC3315: Supported messages are SOLICIT,
  3200. ADVERTISE, REQUEST, and REPLY. Supported options are
  3201. SERVER_ID, CLIENT_ID, IA_NA, and IAADDRESS.</simpara>
  3202. </listitem>
  3203. <listitem>
  3204. <simpara>RFC3646: Supported option is DNS_SERVERS.</simpara>
  3205. </listitem>
  3206. </itemizedlist>
  3207. </section>
  3208. <section id="dhcp6-limit">
  3209. <title>DHCPv6 Server Limitations</title>
  3210. <para> These are the current limitations of the DHCPv6 server
  3211. software. Most of them are reflections of the early stage of
  3212. development and should be treated as <quote>not implemented
  3213. yet</quote>, rather than actual limitations.</para>
  3214. <para>
  3215. <itemizedlist>
  3216. <listitem>
  3217. <simpara>Relayed traffic is not supported.</simpara>
  3218. </listitem>
  3219. <listitem>
  3220. <simpara><command>b10-dhcp6</command> provides a single,
  3221. fixed, hardcoded lease to any client that asks. There is no
  3222. lease manager implemented. If two clients request addresses,
  3223. they will both get the same fixed address.</simpara>
  3224. </listitem>
  3225. <listitem>
  3226. <simpara><command>b10-dhcp6</command> does not support any
  3227. configuration mechanisms yet. The whole configuration is
  3228. currently hardcoded. The only way to tweak configuration
  3229. is to directly modify source code. See see <xref
  3230. linkend="dhcp6-config"/> for details.</simpara>
  3231. </listitem>
  3232. <listitem>
  3233. <simpara>Upon start, the server will open sockets on all
  3234. interfaces that are not loopback, are up, running and are
  3235. multicast capable and have IPv6 address. Support for
  3236. multiple interfaces is not coded in reception routines yet,
  3237. so if you are running this code on a machine that has many
  3238. interfaces and <command>b10-dhcp6</command> happens to
  3239. listen on wrong interface, the easiest way to work around
  3240. this problem is to turn down other interfaces. This
  3241. limitation will be fixed shortly.</simpara>
  3242. </listitem>
  3243. <listitem>
  3244. <simpara>ORO (Option Request Option, a list of options
  3245. requested by a client) is currently ignored and server
  3246. assigns DNS SERVER option.</simpara>
  3247. </listitem>
  3248. <listitem>
  3249. <simpara>Temporary addresses are not supported yet.</simpara>
  3250. </listitem>
  3251. <listitem>
  3252. <simpara>Prefix delegation is not supported yet.</simpara>
  3253. </listitem>
  3254. <listitem>
  3255. <simpara>Address renewal (RENEW), rebinding (REBIND),
  3256. confirmation (CONFIRM), duplication report (DECLINE) and
  3257. release (RELEASE) are not supported yet.</simpara>
  3258. </listitem>
  3259. <listitem>
  3260. <simpara>DNS Update is not supported yet.</simpara>
  3261. </listitem>
  3262. <listitem>
  3263. <simpara>Interface detection is currently working on Linux
  3264. only. See <xref linkend="iface-detect"/> for details.</simpara>
  3265. </listitem>
  3266. <listitem>
  3267. <simpara>-v (verbose) command line option is currently the
  3268. default, and cannot be disabled.</simpara>
  3269. </listitem>
  3270. </itemizedlist>
  3271. </para>
  3272. </section>
  3273. </chapter>
  3274. <chapter id="libdhcp">
  3275. <title>libdhcp++ library</title>
  3276. <para>libdhcp++ is a common library written in C++ that handles
  3277. many DHCP-related tasks, like DHCPv4 and DHCPv6 packets parsing,
  3278. manipulation and assembly, option parsing, manipulation and
  3279. assembly, network interface detection and socket operations, like
  3280. socket creations, data transmission and reception and socket
  3281. closing.
  3282. </para>
  3283. <para>
  3284. While this library is currently used by
  3285. <command>b10-dhcp4</command> and <command>b10-dhcp6</command>
  3286. only, it is designed to be portable, universal library useful for
  3287. any kind of DHCP-related software.
  3288. </para>
  3289. <section id="iface-detect">
  3290. <title>Interface detection</title>
  3291. <para>Both DHCPv4 and DHCPv6 components share network
  3292. interface detection routines. Interface detection is
  3293. currently only supported on Linux systems.</para>
  3294. <para>For non-Linux systems, there is currently stub
  3295. implementation provided. Interface manager detects loopback
  3296. interfaces only as their name (lo or lo0) can be easily predicted.
  3297. Please contact the BIND 10 development team if you are interested
  3298. in running DHCP components on systems other than Linux.</para>
  3299. </section>
  3300. <section id="packet-handling">
  3301. <title>DHCPv4/DHCPv6 packet handling</title>
  3302. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  3303. </section>
  3304. </chapter>
  3305. <chapter id="statistics">
  3306. <title>Statistics</title>
  3307. <para>
  3308. The <command>b10-stats</command> process is started by
  3309. <command>bind10</command>.
  3310. It periodically collects statistics data from various modules
  3311. and aggregates it.
  3312. <!-- TODO -->
  3313. </para>
  3314. <para>
  3315. This stats daemon provides commands to identify if it is
  3316. running, show specified or all statistics data, and show specified
  3317. or all statistics data schema.
  3318. For example, using <command>bindctl</command>:
  3319. <screen>
  3320. &gt; <userinput>Stats show</userinput>
  3321. {
  3322. "Auth": {
  3323. "opcode.iquery": 0,
  3324. "opcode.notify": 10,
  3325. "opcode.query": 869617,
  3326. ...
  3327. "queries.tcp": 1749,
  3328. "queries.udp": 867868
  3329. },
  3330. "Boss": {
  3331. "boot_time": "2011-01-20T16:59:03Z"
  3332. },
  3333. "Stats": {
  3334. "boot_time": "2011-01-20T16:59:05Z",
  3335. "last_update_time": "2011-01-20T17:04:05Z",
  3336. "lname": "4d3869d9_a@jreed.example.net",
  3337. "report_time": "2011-01-20T17:04:06Z",
  3338. "timestamp": 1295543046.823504
  3339. }
  3340. }
  3341. </screen>
  3342. </para>
  3343. </chapter>
  3344. <chapter id="logging">
  3345. <title>Logging</title>
  3346. <section>
  3347. <title>Logging configuration</title>
  3348. <para>
  3349. The logging system in BIND 10 is configured through the
  3350. Logging module. All BIND 10 modules will look at the
  3351. configuration in Logging to see what should be logged and
  3352. to where.
  3353. <!-- TODO: what is context of Logging module for readers of this guide? -->
  3354. </para>
  3355. <section>
  3356. <title>Loggers</title>
  3357. <para>
  3358. Within BIND 10, a message is logged through a component
  3359. called a "logger". Different parts of BIND 10 log messages
  3360. through different loggers, and each logger can be configured
  3361. independently of one another.
  3362. </para>
  3363. <para>
  3364. In the Logging module, you can specify the configuration
  3365. for zero or more loggers; any that are not specified will
  3366. take appropriate default values.
  3367. </para>
  3368. <para>
  3369. The three most important elements of a logger configuration
  3370. are the <option>name</option> (the component that is
  3371. generating the messages), the <option>severity</option>
  3372. (what to log), and the <option>output_options</option>
  3373. (where to log).
  3374. </para>
  3375. <section>
  3376. <title>name (string)</title>
  3377. <para>
  3378. Each logger in the system has a name, the name being that
  3379. of the component using it to log messages. For instance,
  3380. if you want to configure logging for the resolver module,
  3381. you add an entry for a logger named <quote>Resolver</quote>. This
  3382. configuration will then be used by the loggers in the
  3383. Resolver module, and all the libraries used by it.
  3384. </para>
  3385. <!-- TODO: later we will have a way to know names of all modules
  3386. Right now you can only see what their names are if they are running
  3387. (a simple 'help' without anything else in bindctl for instance).
  3388. -->
  3389. <para>
  3390. If you want to specify logging for one specific library
  3391. within the module, you set the name to
  3392. <replaceable>module.library</replaceable>. For example, the
  3393. logger used by the nameserver address store component
  3394. has the full name of <quote>Resolver.nsas</quote>. If
  3395. there is no entry in Logging for a particular library,
  3396. it will use the configuration given for the module.
  3397. <!-- TODO: how to know these specific names?
  3398. We will either have to document them or tell the administrator to
  3399. specify module-wide logging and see what appears...
  3400. -->
  3401. </para>
  3402. <para>
  3403. <!-- TODO: severity has not been covered yet -->
  3404. To illustrate this, suppose you want the cache library
  3405. to log messages of severity DEBUG, and the rest of the
  3406. resolver code to log messages of severity INFO. To achieve
  3407. this you specify two loggers, one with the name
  3408. <quote>Resolver</quote> and severity INFO, and one with
  3409. the name <quote>Resolver.cache</quote> with severity
  3410. DEBUG. As there are no entries for other libraries (e.g.
  3411. the nsas), they will use the configuration for the module
  3412. (<quote>Resolver</quote>), so giving the desired behavior.
  3413. </para>
  3414. <para>
  3415. One special case is that of a module name of <quote>*</quote>
  3416. (asterisks), which is interpreted as <emphasis>any</emphasis>
  3417. module. You can set global logging options by using this,
  3418. including setting the logging configuration for a library
  3419. that is used by multiple modules (e.g. <quote>*.config</quote>
  3420. specifies the configuration library code in whatever
  3421. module is using it).
  3422. </para>
  3423. <para>
  3424. If there are multiple logger specifications in the
  3425. configuration that might match a particular logger, the
  3426. specification with the more specific logger name takes
  3427. precedence. For example, if there are entries for for
  3428. both <quote>*</quote> and <quote>Resolver</quote>, the
  3429. resolver module &mdash; and all libraries it uses &mdash;
  3430. will log messages according to the configuration in the
  3431. second entry (<quote>Resolver</quote>). All other modules
  3432. will use the configuration of the first entry
  3433. (<quote>*</quote>). If there was also a configuration
  3434. entry for <quote>Resolver.cache</quote>, the cache library
  3435. within the resolver would use that in preference to the
  3436. entry for <quote>Resolver</quote>.
  3437. </para>
  3438. <para>
  3439. One final note about the naming. When specifying the
  3440. module name within a logger, use the name of the module
  3441. as specified in <command>bindctl</command>, e.g.
  3442. <quote>Resolver</quote> for the resolver module,
  3443. <quote>Xfrout</quote> for the xfrout module, etc. When
  3444. the message is logged, the message will include the name
  3445. of the logger generating the message, but with the module
  3446. name replaced by the name of the process implementing
  3447. the module (so for example, a message generated by the
  3448. <quote>Auth.cache</quote> logger will appear in the output
  3449. with a logger name of <quote>b10-auth.cache</quote>).
  3450. </para>
  3451. </section>
  3452. <section>
  3453. <title>severity (string)</title>
  3454. <para>
  3455. This specifies the category of messages logged.
  3456. Each message is logged with an associated severity which
  3457. may be one of the following (in descending order of
  3458. severity):
  3459. </para>
  3460. <itemizedlist>
  3461. <listitem>
  3462. <simpara> FATAL </simpara>
  3463. </listitem>
  3464. <listitem>
  3465. <simpara> ERROR </simpara>
  3466. </listitem>
  3467. <listitem>
  3468. <simpara> WARN </simpara>
  3469. </listitem>
  3470. <listitem>
  3471. <simpara> INFO </simpara>
  3472. </listitem>
  3473. <listitem>
  3474. <simpara> DEBUG </simpara>
  3475. </listitem>
  3476. </itemizedlist>
  3477. <para>
  3478. When the severity of a logger is set to one of these
  3479. values, it will only log messages of that severity, and
  3480. the severities above it. The severity may also be set to
  3481. NONE, in which case all messages from that logger are
  3482. inhibited.
  3483. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  3484. </para>
  3485. </section>
  3486. <section>
  3487. <title>output_options (list)</title>
  3488. <para>
  3489. Each logger can have zero or more
  3490. <option>output_options</option>. These specify where log
  3491. messages are sent to. These are explained in detail below.
  3492. </para>
  3493. <para>
  3494. The other options for a logger are:
  3495. </para>
  3496. </section>
  3497. <section>
  3498. <title>debuglevel (integer)</title>
  3499. <para>
  3500. When a logger's severity is set to DEBUG, this value
  3501. specifies what debug messages should be printed. It ranges
  3502. from 0 (least verbose) to 99 (most verbose).
  3503. </para>
  3504. <!-- TODO: complete this sentence:
  3505. The general classification of debug message types is
  3506. TODO; there's a ticket to determine these levels, see #1074
  3507. -->
  3508. <para>
  3509. If severity for the logger is not DEBUG, this value is ignored.
  3510. </para>
  3511. </section>
  3512. <section>
  3513. <title>additive (true or false)</title>
  3514. <para>
  3515. If this is true, the <option>output_options</option> from
  3516. the parent will be used. For example, if there are two
  3517. loggers configured; <quote>Resolver</quote> and
  3518. <quote>Resolver.cache</quote>, and <option>additive</option>
  3519. is true in the second, it will write the log messages
  3520. not only to the destinations specified for
  3521. <quote>Resolver.cache</quote>, but also to the destinations
  3522. as specified in the <option>output_options</option> in
  3523. the logger named <quote>Resolver</quote>.
  3524. <!-- TODO: check this -->
  3525. </para>
  3526. </section>
  3527. </section>
  3528. <section>
  3529. <title>Output Options</title>
  3530. <para>
  3531. The main settings for an output option are the
  3532. <option>destination</option> and a value called
  3533. <option>output</option>, the meaning of which depends on
  3534. the destination that is set.
  3535. </para>
  3536. <section>
  3537. <title>destination (string)</title>
  3538. <para>
  3539. The destination is the type of output. It can be one of:
  3540. </para>
  3541. <itemizedlist>
  3542. <listitem>
  3543. <simpara> console </simpara>
  3544. </listitem>
  3545. <listitem>
  3546. <simpara> file </simpara>
  3547. </listitem>
  3548. <listitem>
  3549. <simpara> syslog </simpara>
  3550. </listitem>
  3551. </itemizedlist>
  3552. </section>
  3553. <section>
  3554. <title>output (string)</title>
  3555. <para>
  3556. Depending on what is set as the output destination, this
  3557. value is interpreted as follows:
  3558. </para>
  3559. <variablelist>
  3560. <varlistentry>
  3561. <term><option>destination</option> is <quote>console</quote></term>
  3562. <listitem>
  3563. <para>
  3564. The value of output must be one of <quote>stdout</quote>
  3565. (messages printed to standard output) or
  3566. <quote>stderr</quote> (messages printed to standard
  3567. error).
  3568. </para>
  3569. <para>
  3570. Note: if output is set to <quote>stderr</quote> and a lot of
  3571. messages are produced in a short time (e.g. if the logging
  3572. level is set to DEBUG), you may occasionally see some messages
  3573. jumbled up together. This is due to a combination of the way
  3574. that messages are written to the screen and the unbuffered
  3575. nature of the standard error stream. If this occurs, it is
  3576. recommended that output be set to <quote>stdout</quote>.
  3577. </para>
  3578. </listitem>
  3579. </varlistentry>
  3580. <varlistentry>
  3581. <term><option>destination</option> is <quote>file</quote></term>
  3582. <listitem>
  3583. <para>
  3584. The value of output is interpreted as a file name;
  3585. log messages will be appended to this file.
  3586. </para>
  3587. </listitem>
  3588. </varlistentry>
  3589. <varlistentry>
  3590. <term><option>destination</option> is <quote>syslog</quote></term>
  3591. <listitem>
  3592. <para>
  3593. The value of output is interpreted as the
  3594. <command>syslog</command> facility (e.g.
  3595. <emphasis>local0</emphasis>) that should be used
  3596. for log messages.
  3597. </para>
  3598. </listitem>
  3599. </varlistentry>
  3600. </variablelist>
  3601. <para>
  3602. The other options for <option>output_options</option> are:
  3603. </para>
  3604. <section>
  3605. <title>flush (true of false)</title>
  3606. <para>
  3607. Flush buffers after each log message. Doing this will
  3608. reduce performance but will ensure that if the program
  3609. terminates abnormally, all messages up to the point of
  3610. termination are output.
  3611. </para>
  3612. </section>
  3613. <section>
  3614. <title>maxsize (integer)</title>
  3615. <para>
  3616. Only relevant when destination is file, this is maximum
  3617. file size of output files in bytes. When the maximum
  3618. size is reached, the file is renamed and a new file opened.
  3619. (For example, a ".1" is appended to the name &mdash;
  3620. if a ".1" file exists, it is renamed ".2",
  3621. etc.)
  3622. </para>
  3623. <para>
  3624. If this is 0, no maximum file size is used.
  3625. </para>
  3626. </section>
  3627. <section>
  3628. <title>maxver (integer)</title>
  3629. <para>
  3630. Maximum number of old log files to keep around when
  3631. rolling the output file. Only relevant when
  3632. <option>destination</option> is <quote>file</quote>.
  3633. </para>
  3634. </section>
  3635. </section>
  3636. </section>
  3637. <section>
  3638. <title>Example session</title>
  3639. <para>
  3640. In this example we want to set the global logging to
  3641. write to the file <filename>/var/log/my_bind10.log</filename>,
  3642. at severity WARN. We want the authoritative server to
  3643. log at DEBUG with debuglevel 40, to a different file
  3644. (<filename>/tmp/debug_messages</filename>).
  3645. </para>
  3646. <para>
  3647. Start <command>bindctl</command>.
  3648. </para>
  3649. <para>
  3650. <screen>["login success "]
  3651. &gt; <userinput>config show Logging</userinput>
  3652. Logging/loggers [] list
  3653. </screen>
  3654. </para>
  3655. <para>
  3656. By default, no specific loggers are configured, in which
  3657. case the severity defaults to INFO and the output is
  3658. written to stderr.
  3659. </para>
  3660. <para>
  3661. Let's first add a default logger:
  3662. </para>
  3663. <!-- TODO: adding the empty loggers makes no sense -->
  3664. <para>
  3665. <screen><userinput>&gt; config add Logging/loggers</userinput>
  3666. &gt; <userinput>config show Logging</userinput>
  3667. Logging/loggers/ list (modified)
  3668. </screen>
  3669. </para>
  3670. <para>
  3671. The loggers value line changed to indicate that it is no
  3672. longer an empty list:
  3673. </para>
  3674. <para>
  3675. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  3676. Logging/loggers[0]/name "" string (default)
  3677. Logging/loggers[0]/severity "INFO" string (default)
  3678. Logging/loggers[0]/debuglevel 0 integer (default)
  3679. Logging/loggers[0]/additive false boolean (default)
  3680. Logging/loggers[0]/output_options [] list (default)
  3681. </screen>
  3682. </para>
  3683. <para>
  3684. The name is mandatory, so we must set it. We will also
  3685. change the severity as well. Let's start with the global
  3686. logger.
  3687. </para>
  3688. <para>
  3689. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  3690. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  3691. &gt; <userinput>config show Logging/loggers</userinput>
  3692. Logging/loggers[0]/name "*" string (modified)
  3693. Logging/loggers[0]/severity "WARN" string (modified)
  3694. Logging/loggers[0]/debuglevel 0 integer (default)
  3695. Logging/loggers[0]/additive false boolean (default)
  3696. Logging/loggers[0]/output_options [] list (default)
  3697. </screen>
  3698. </para>
  3699. <para>
  3700. Of course, we need to specify where we want the log
  3701. messages to go, so we add an entry for an output option.
  3702. </para>
  3703. <para>
  3704. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  3705. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  3706. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  3707. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  3708. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  3709. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  3710. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  3711. </screen>
  3712. </para>
  3713. <para>
  3714. These aren't the values we are looking for.
  3715. </para>
  3716. <para>
  3717. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  3718. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  3719. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  3720. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  3721. </screen>
  3722. </para>
  3723. <para>
  3724. Which would make the entire configuration for this logger
  3725. look like:
  3726. </para>
  3727. <para>
  3728. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  3729. Logging/loggers[0]/name "*" string (modified)
  3730. Logging/loggers[0]/severity "WARN" string (modified)
  3731. Logging/loggers[0]/debuglevel 0 integer (default)
  3732. Logging/loggers[0]/additive false boolean (default)
  3733. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  3734. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  3735. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  3736. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  3737. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  3738. </screen>
  3739. </para>
  3740. <para>
  3741. That looks OK, so let's commit it before we add the
  3742. configuration for the authoritative server's logger.
  3743. </para>
  3744. <para>
  3745. <screen>&gt; <userinput> config commit</userinput></screen>
  3746. </para>
  3747. <para>
  3748. Now that we have set it, and checked each value along
  3749. the way, adding a second entry is quite similar.
  3750. </para>
  3751. <para>
  3752. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  3753. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  3754. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  3755. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  3756. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  3757. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  3758. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  3759. &gt; <userinput> config commit</userinput>
  3760. </screen>
  3761. </para>
  3762. <para>
  3763. And that's it. Once we have found whatever it was we
  3764. needed the debug messages for, we can simply remove the
  3765. second logger to let the authoritative server use the
  3766. same settings as the rest.
  3767. </para>
  3768. <para>
  3769. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  3770. &gt; <userinput> config commit</userinput>
  3771. </screen>
  3772. </para>
  3773. <para>
  3774. And every module will now be using the values from the
  3775. logger named <quote>*</quote>.
  3776. </para>
  3777. </section>
  3778. </section>
  3779. <section>
  3780. <title>Logging Message Format</title>
  3781. <para>
  3782. Each message written by BIND 10 to the configured logging
  3783. destinations comprises a number of components that identify
  3784. the origin of the message and, if the message indicates
  3785. a problem, information about the problem that may be
  3786. useful in fixing it.
  3787. </para>
  3788. <para>
  3789. Consider the message below logged to a file:
  3790. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  3791. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  3792. </para>
  3793. <para>
  3794. Note: the layout of messages written to the system logging
  3795. file (syslog) may be slightly different. This message has
  3796. been split across two lines here for display reasons; in the
  3797. logging file, it will appear on one line.)
  3798. </para>
  3799. <para>
  3800. The log message comprises a number of components:
  3801. <variablelist>
  3802. <varlistentry>
  3803. <term>2011-06-15 13:48:22.034</term>
  3804. <!-- TODO: timestamp repeated even if using syslog? -->
  3805. <listitem><para>
  3806. The date and time at which the message was generated.
  3807. </para></listitem>
  3808. </varlistentry>
  3809. <varlistentry>
  3810. <term>ERROR</term>
  3811. <listitem><para>
  3812. The severity of the message.
  3813. </para></listitem>
  3814. </varlistentry>
  3815. <varlistentry>
  3816. <term>[b10-resolver.asiolink]</term>
  3817. <listitem><para>
  3818. The source of the message. This comprises two components:
  3819. the BIND 10 process generating the message (in this
  3820. case, <command>b10-resolver</command>) and the module
  3821. within the program from which the message originated
  3822. (which in the example is the asynchronous I/O link
  3823. module, asiolink).
  3824. </para></listitem>
  3825. </varlistentry>
  3826. <varlistentry>
  3827. <term>ASIODNS_OPENSOCK</term>
  3828. <listitem><para>
  3829. The message identification. Every message in BIND 10
  3830. has a unique identification, which can be used as an
  3831. index into the <ulink
  3832. url="bind10-messages.html"><citetitle>BIND 10 Messages
  3833. Manual</citetitle></ulink> (<ulink
  3834. url="http://bind10.isc.org/docs/bind10-messages.html"
  3835. />) from which more information can be obtained.
  3836. </para></listitem>
  3837. </varlistentry>
  3838. <varlistentry>
  3839. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  3840. <listitem><para>
  3841. A brief description of the cause of the problem.
  3842. Within this text, information relating to the condition
  3843. that caused the message to be logged will be included.
  3844. In this example, error number 111 (an operating
  3845. system-specific error number) was encountered when
  3846. trying to open a TCP connection to port 53 on the
  3847. local system (address 127.0.0.1). The next step
  3848. would be to find out the reason for the failure by
  3849. consulting your system's documentation to identify
  3850. what error number 111 means.
  3851. </para></listitem>
  3852. </varlistentry>
  3853. </variablelist>
  3854. </para>
  3855. </section>
  3856. </chapter>
  3857. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  3858. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  3859. <!-- <index> <title>Index</title> </index> -->
  3860. </book>
  3861. <!--
  3862. TODO:
  3863. Overview
  3864. Getting BIND 10 Installed
  3865. Basics
  3866. Dependencies
  3867. Optional
  3868. Advanced
  3869. How Does Everything Work Together?
  3870. Need Help?
  3871. -->