bind10-guide.xml 174 KB

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