bind10-guide.xml 174 KB

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