bind10-guide.xml 134 KB

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