bind10-guide.xml 127 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642
  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 5 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</title>
  90. <para>
  91. BIND 10 requires at least Python 3.1
  92. (<ulink url="http://www.python.org/"/>).
  93. It also works with Python 3.2.
  94. </para>
  95. <para>
  96. BIND 10 uses the Botan crypto library for C++
  97. (<ulink url="http://botan.randombit.net/"/>).
  98. It requires at least Botan version 1.8.
  99. </para>
  100. <para>
  101. BIND 10 uses the log4cplus C++ logging library
  102. (<ulink url="http://log4cplus.sourceforge.net/"/>).
  103. It requires at least log4cplus version 1.0.3.
  104. <!-- TODO: It is recommended to use at least version .... -->
  105. </para>
  106. <para>
  107. The authoritative DNS server uses SQLite3
  108. (<ulink url="http://www.sqlite.org/"/>).
  109. <!-- TODO: is this still required? -->
  110. It needs at least SQLite version 3.3.9.
  111. </para>
  112. <para>
  113. The <command>b10-ddns</command>, <command>b10-xfrin</command>,
  114. <command>b10-xfrout</command>, and <command>b10-zonemgr</command>
  115. components require the libpython3 library and the Python
  116. _sqlite3.so module (which is included with Python).
  117. Python modules need to be built for the corresponding Python 3.
  118. </para>
  119. <!-- TODO: this will change ... -->
  120. <note>
  121. <para>
  122. Some operating systems do not provide these dependencies
  123. in their default installation nor standard packages
  124. collections.
  125. You may need to install them separately.
  126. </para>
  127. </note>
  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 BIND10 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. </para>
  920. <para>
  921. <command>b10-cfgmgr</command> relays configurations received
  922. from <command>b10-cmdctl</command> to the appropriate modules.
  923. </para>
  924. <!-- TODO:
  925. Configuration settings for itself are defined as ConfigManager.
  926. TODO: show examples
  927. -->
  928. <!-- TODO:
  929. config changes are actually commands to cfgmgr
  930. -->
  931. <!-- TODO: what about run time config to change this? -->
  932. <!-- jelte: > config set cfgmgr/config_database <file> -->
  933. <!-- TODO: what about command line switch to change this? -->
  934. <para>
  935. The stored configuration file is at
  936. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  937. (The full path is what was defined at build configure time for
  938. <option>--localstatedir</option>.
  939. The default is <filename>/usr/local/var/</filename>.)
  940. The format is loosely based on JSON and is directly parseable
  941. python, but this may change in a future version.
  942. This configuration data file is not manually edited by the
  943. administrator.
  944. </para>
  945. <!--
  946. Well the specfiles have a more fixed format (they must contain specific
  947. stuff), but those are also directly parseable python structures (and
  948. 'coincidentally', our data::element string representation is the same)
  949. loosely based on json, tweaked to be directly parseable in python, but a
  950. subset of that.
  951. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  952. nope, spec files are written by module developers, and db should be done
  953. through bindctl and friends
  954. -->
  955. <para>
  956. The configuration manager does not have any command line arguments.
  957. Normally it is not started manually, but is automatically
  958. started using the <command>bind10</command> master process
  959. (as covered in <xref linkend="bind10"/>).
  960. </para>
  961. <!-- TODO: upcoming plans:
  962. configuration for configuration manager itself. And perhaps we might
  963. change the messaging protocol, but an admin should never see any of that
  964. -->
  965. <!-- TODO: show examples, test this -->
  966. <!--
  967. , so an admin can simply run bindctl,
  968. do config show, and it shows all modules; config show >module> shows all
  969. options for that module
  970. -->
  971. </chapter>
  972. <chapter id="cmdctl">
  973. <title>Remote control daemon</title>
  974. <para>
  975. <command>b10-cmdctl</command> is the gateway between
  976. administrators and the BIND 10 system.
  977. It is a HTTPS server that uses standard HTTP Digest
  978. Authentication for username and password validation.
  979. It provides a REST-ful interface for accessing and controlling
  980. BIND 10.
  981. </para>
  982. <!-- TODO: copy examples from wiki, try with wget -->
  983. <para>
  984. When <command>b10-cmdctl</command> starts, it firsts
  985. asks <command>b10-cfgmgr</command> about what modules are
  986. running and what their configuration is (over the
  987. <command>b10-msgq</command> channel). Then it will start listening
  988. on HTTPS for clients &mdash; the user interface &mdash; such
  989. as <command>bindctl</command>.
  990. </para>
  991. <para>
  992. <command>b10-cmdctl</command> directly sends commands
  993. (received from the user interface) to the specified component.
  994. Configuration changes are actually commands to
  995. <command>b10-cfgmgr</command> so are sent there.
  996. </para>
  997. <!--
  998. TODO:
  999. "For bindctl to list a module's available configurations and
  1000. available commands, it communicates over the cmdctl REST interface.
  1001. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  1002. asks the module for its specification and also cfgmgr looks in its
  1003. own configuration database for current values."
  1004. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  1005. GET, but rather requests it once and then listens in for updates,
  1006. but you might wanna check with likun
  1007. -->
  1008. <!-- TODO: replace /usr/local -->
  1009. <!-- TODO: permissions -->
  1010. <para>The HTTPS server requires a private key,
  1011. such as a RSA PRIVATE KEY.
  1012. The default location is at
  1013. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  1014. (A sample key is at
  1015. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  1016. It also uses a certificate located at
  1017. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  1018. (A sample certificate is at
  1019. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  1020. This may be a self-signed certificate or purchased from a
  1021. certification authority.
  1022. </para>
  1023. <note><para>
  1024. The HTTPS server doesn't support a certificate request from a
  1025. client (at this time).
  1026. <!-- TODO: maybe allow request from server side -->
  1027. The <command>b10-cmdctl</command> daemon does not provide a
  1028. public service. If any client wants to control BIND 10, then
  1029. a certificate needs to be first received from the BIND 10
  1030. administrator.
  1031. The BIND 10 installation provides a sample PEM bundle that matches
  1032. the sample key and certificate.
  1033. </para></note>
  1034. <!-- TODO: cross-ref -->
  1035. <!-- TODO
  1036. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  1037. but that is a single file, maybethis should go back to that format?
  1038. -->
  1039. <!--
  1040. <para>
  1041. (08:20:56) shane: It is in theory possible to run without cmdctl.
  1042. (08:21:02) shane: I think we discussed this.
  1043. </para>
  1044. -->
  1045. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  1046. <para>
  1047. The <command>b10-cmdctl</command> daemon also requires
  1048. the user account file located at
  1049. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  1050. This comma-delimited file lists the accounts with a user name,
  1051. hashed password, and salt.
  1052. (A sample file is at
  1053. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  1054. It contains the user named <quote>root</quote> with the password
  1055. <quote>bind10</quote>.)
  1056. </para>
  1057. <para>
  1058. The administrator may create a user account with the
  1059. <command>b10-cmdctl-usermgr</command> tool.
  1060. </para>
  1061. <!-- TODO: show example -->
  1062. <!-- TODO: does cmdctl need to be restarted to change cert or key
  1063. or accounts database -->
  1064. <para>
  1065. By default the HTTPS server listens on the localhost port 8080.
  1066. The port can be set by using the <option>--port</option> command line option.
  1067. The address to listen on can be set using the <option>--address</option> command
  1068. line argument.
  1069. Each HTTPS connection is stateless and times out in 1200 seconds
  1070. by default. This can be
  1071. redefined by using the <option>--idle-timeout</option> command line argument.
  1072. </para>
  1073. <section id="cmdctl.spec">
  1074. <title>Configuration specification for b10-cmdctl</title>
  1075. <para>
  1076. The configuration items for <command>b10-cmdctl</command> are:
  1077. key_file
  1078. cert_file
  1079. accounts_file
  1080. </para>
  1081. <!-- TODO -->
  1082. <para>
  1083. The control commands are:
  1084. print_settings
  1085. <!-- TODO: remove that -->
  1086. shutdown
  1087. </para>
  1088. <!-- TODO -->
  1089. </section>
  1090. <!--
  1091. TODO
  1092. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  1093. (12:21:33) jinmei: btw
  1094. -->
  1095. </chapter>
  1096. <chapter id="bindctl">
  1097. <title>Control and configure user interface</title>
  1098. <note><para>
  1099. For this development prototype release, <command>bindctl</command>
  1100. is the only user interface. It is expected that upcoming
  1101. releases will provide another interactive command-line
  1102. interface and a web-based interface for controlling and
  1103. configuring BIND 10.
  1104. </para></note>
  1105. <para>
  1106. The <command>bindctl</command> tool provides an interactive
  1107. prompt for configuring, controlling, and querying the BIND 10
  1108. components.
  1109. It communicates directly with a REST-ful interface over HTTPS
  1110. provided by <command>b10-cmdctl</command>. It doesn't
  1111. communicate to any other components directly.
  1112. </para>
  1113. <!-- TODO: explain and show interface -->
  1114. <para>
  1115. Configuration changes are actually commands to
  1116. <command>b10-cfgmgr</command>. So when <command>bindctl</command>
  1117. sends a configuration, it is sent to <command>b10-cmdctl</command>
  1118. (over a HTTPS connection); then <command>b10-cmdctl</command>
  1119. sends the command (over a <command>b10-msgq</command> command
  1120. channel) to <command>b10-cfgmgr</command> which then stores
  1121. the details and relays (over a <command>b10-msgq</command> command
  1122. channel) the configuration on to the specified module.
  1123. </para>
  1124. <para>
  1125. </para>
  1126. </chapter>
  1127. <chapter id="authserver">
  1128. <title>Authoritative Server</title>
  1129. <para>
  1130. The <command>b10-auth</command> is the authoritative DNS server.
  1131. It supports EDNS0 and DNSSEC. It supports IPv6.
  1132. Normally it is started by the <command>bind10</command> master
  1133. process.
  1134. </para>
  1135. <section>
  1136. <title>Server Configurations</title>
  1137. <!-- TODO: offers command line options but not used
  1138. since we used bind10 -->
  1139. <para>
  1140. <command>b10-auth</command> is configured via the
  1141. <command>b10-cfgmgr</command> configuration manager.
  1142. The module name is <quote>Auth</quote>.
  1143. The configuration data items are:
  1144. <variablelist>
  1145. <varlistentry>
  1146. <term>database_file</term>
  1147. <listitem>
  1148. <simpara>This is an optional string to define the path to find
  1149. the SQLite3 database file.
  1150. <!-- TODO: -->
  1151. Note: Later the DNS server will use various data source backends.
  1152. This may be a temporary setting until then.
  1153. </simpara>
  1154. </listitem>
  1155. </varlistentry>
  1156. <!-- NOTE: docs pulled in verbatim from the b10-auth.xml manual page.
  1157. TODO: automate this if want this or rewrite
  1158. -->
  1159. <varlistentry>
  1160. <term>datasources</term>
  1161. <listitem>
  1162. <simpara>
  1163. <varname>datasources</varname> configures data sources.
  1164. The list items include:
  1165. <varname>type</varname> to define the required data source type
  1166. (such as <quote>memory</quote>);
  1167. <varname>class</varname> to optionally select the class
  1168. (it defaults to <quote>IN</quote>);
  1169. and
  1170. <varname>zones</varname> to define
  1171. the <varname>file</varname> path name,
  1172. the <varname>filetype</varname> (e.g., <varname>sqlite3</varname>),
  1173. and the <varname>origin</varname> (default domain).
  1174. By default, this is empty.
  1175. <note><simpara>
  1176. In this development version, currently this is only used for the
  1177. memory data source.
  1178. Only the IN class is supported at this time.
  1179. By default, the memory data source is disabled.
  1180. Also, currently the zone file must be canonical such as
  1181. generated by <command>named-compilezone -D</command>, or
  1182. must be an SQLite3 database.
  1183. </simpara></note>
  1184. </simpara>
  1185. </listitem>
  1186. </varlistentry>
  1187. <varlistentry>
  1188. <term>listen_on</term>
  1189. <listitem>
  1190. <simpara>
  1191. <varname>listen_on</varname> is a list of addresses and ports for
  1192. <command>b10-auth</command> to listen on.
  1193. The list items are the <varname>address</varname> string
  1194. and <varname>port</varname> number.
  1195. By default, <command>b10-auth</command> listens on port 53
  1196. on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
  1197. <note>
  1198. <simpara>
  1199. The default configuration is currently not appropriate for a multi-homed host.
  1200. In case you have multiple public IP addresses, it is possible the
  1201. query UDP packet comes through one interface and the answer goes out
  1202. through another. The answer will probably be dropped by the client, as it
  1203. has a different source address than the one it sent the query to. The
  1204. client would fallback on TCP after several attempts, which works
  1205. well in this situation, but is clearly not ideal.
  1206. </simpara>
  1207. <simpara>
  1208. There are plans to solve the problem such that the server handles
  1209. it by itself. But until it is actually implemented, it is recommended to
  1210. alter the configuration &mdash; remove the wildcard addresses and list all
  1211. addresses explicitly. Then the server will answer on the same
  1212. interface the request came on, preserving the correct address.
  1213. </simpara>
  1214. </note>
  1215. </simpara>
  1216. </listitem>
  1217. </varlistentry>
  1218. <varlistentry>
  1219. <term>statistics-interval</term>
  1220. <listitem>
  1221. <simpara>
  1222. <varname>statistics-interval</varname> is the timer interval
  1223. in seconds for <command>b10-auth</command> to share its
  1224. statistics information to
  1225. <citerefentry><refentrytitle>b10-stats</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
  1226. Statistics updates can be disabled by setting this to 0.
  1227. The default is 60.
  1228. </simpara>
  1229. </listitem>
  1230. </varlistentry>
  1231. </variablelist>
  1232. </para>
  1233. <para>
  1234. The configuration commands are:
  1235. <variablelist>
  1236. <varlistentry>
  1237. <term>loadzone</term>
  1238. <listitem>
  1239. <simpara>
  1240. <command>loadzone</command> tells <command>b10-auth</command>
  1241. to load or reload a zone file. The arguments include:
  1242. <varname>class</varname> which optionally defines the class
  1243. (it defaults to <quote>IN</quote>);
  1244. <varname>origin</varname> is the domain name of the zone;
  1245. and
  1246. <varname>datasrc</varname> optionally defines the type of datasource
  1247. (it defaults to <quote>memory</quote>).
  1248. <note><simpara>
  1249. In this development version, currently this only supports the
  1250. IN class and the memory data source.
  1251. </simpara></note>
  1252. </simpara>
  1253. </listitem>
  1254. </varlistentry>
  1255. <varlistentry>
  1256. <term>sendstats</term>
  1257. <listitem>
  1258. <simpara>
  1259. <command>sendstats</command> tells <command>b10-auth</command>
  1260. to send its statistics data to
  1261. <citerefentry><refentrytitle>b10-stats</refentrytitle><manvolnum>8</manvolnum></citerefentry>
  1262. immediately.
  1263. </simpara>
  1264. </listitem>
  1265. </varlistentry>
  1266. <varlistentry>
  1267. <term>shutdown</term>
  1268. <listitem>
  1269. <simpara>Stop the authoritative DNS server.
  1270. This has an optional <varname>pid</varname> argument to
  1271. select the process ID to stop.
  1272. (Note that the BIND 10 boss process may restart this service
  1273. if configured.)
  1274. </simpara>
  1275. </listitem>
  1276. </varlistentry>
  1277. </variablelist>
  1278. </para>
  1279. <!-- TODO: examples of setting or running above? -->
  1280. </section>
  1281. <section>
  1282. <title>Data Source Backends</title>
  1283. <note><para>
  1284. For the development prototype release, <command>b10-auth</command>
  1285. supports a SQLite3 data source backend and in-memory data source
  1286. backend.
  1287. Upcoming versions will be able to use multiple different
  1288. data sources, such as MySQL and Berkeley DB.
  1289. </para></note>
  1290. <para>
  1291. By default, the SQLite3 backend uses the data file located at
  1292. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  1293. (The full path is what was defined at build configure time for
  1294. <option>--localstatedir</option>.
  1295. The default is <filename>/usr/local/var/</filename>.)
  1296. This data file location may be changed by defining the
  1297. <quote>database_file</quote> configuration.
  1298. </para>
  1299. <section id="in-memory-datasource">
  1300. <title>In-memory Data Source</title>
  1301. <para>
  1302. <!-- How to configure it. -->
  1303. The following commands to <command>bindctl</command>
  1304. provide an example of configuring an in-memory data
  1305. source containing the <quote>example.com</quote> zone
  1306. with the zone file named <quote>example.com.zone</quote>:
  1307. <!--
  1308. <screen>&gt; <userinput> config set Auth/datasources/ [{"type": "memory", "zones": [{"origin": "example.com", "file": "example.com.zone"}]}]</userinput></screen>
  1309. -->
  1310. <screen>&gt; <userinput>config add Auth/datasources</userinput>
  1311. &gt; <userinput>config set Auth/datasources[0]/type "<option>memory</option>"</userinput>
  1312. &gt; <userinput>config add Auth/datasources[0]/zones</userinput>
  1313. &gt; <userinput>config set Auth/datasources[0]/zones[0]/origin "<option>example.com</option>"</userinput>
  1314. &gt; <userinput>config set Auth/datasources[0]/zones[0]/file "<option>example.com.zone</option>"</userinput>
  1315. &gt; <userinput>config commit</userinput></screen>
  1316. The authoritative server will begin serving it immediately
  1317. after it is loaded.
  1318. </para>
  1319. </section>
  1320. <section id="in-memory-datasource-with-sqlite3-backend">
  1321. <title>In-memory Data Source With SQLite3 Backend</title>
  1322. <para>
  1323. <!-- How to configure it. -->
  1324. The following commands to <command>bindctl</command>
  1325. provide an example of configuring an in-memory data
  1326. source containing the <quote>example.org</quote> zone
  1327. with a SQLite3 backend file named <quote>example.org.sqlite3</quote>:
  1328. <!--
  1329. <screen>&gt; <userinput> config set Auth/datasources/ [{"type": "memory", "zones": [{"origin": "example.org", "file": "example.org.sqlite3", "filetype": "sqlite3"}]}]</userinput></screen>
  1330. -->
  1331. <screen>&gt; <userinput>config add Auth/datasources</userinput>
  1332. &gt; <userinput>config set Auth/datasources[1]/type "<option>memory</option>"</userinput>
  1333. &gt; <userinput>config add Auth/datasources[1]/zones</userinput>
  1334. &gt; <userinput>config set Auth/datasources[1]/zones[0]/origin "<option>example.org</option>"</userinput>
  1335. &gt; <userinput>config set Auth/datasources[1]/zones[0]/file "<option>example.org.sqlite3</option>"</userinput>
  1336. &gt; <userinput>config set Auth/datasources[1]/zones[0]/filetype "<option>sqlite3</option>"</userinput>
  1337. &gt; <userinput>config commit</userinput></screen>
  1338. The authoritative server will begin serving it immediately
  1339. after it is loaded.
  1340. </para>
  1341. </section>
  1342. <section id="in-memory-datasource-loading">
  1343. <title>Reloading an In-memory Data Source</title>
  1344. <para>
  1345. Use the <command>Auth loadzone</command> command in
  1346. <command>bindctl</command> to reload a changed master
  1347. file into memory; for example:
  1348. <screen>&gt; <userinput>Auth loadzone origin="example.com"</userinput>
  1349. </screen>
  1350. </para>
  1351. <!--
  1352. <para>
  1353. The <varname>file</varname> may be an absolute path to the
  1354. master zone file or it is relative to the directory BIND 10 is
  1355. started from.
  1356. </para>
  1357. -->
  1358. </section>
  1359. <section id="in-memory-datasource-disabling">
  1360. <title>Disabling In-memory Data Sources</title>
  1361. <para>
  1362. By default, the memory data source is disabled; it must be
  1363. configured explicitly. To disable all the in-memory zones,
  1364. specify a null list for <varname>Auth/datasources</varname>:
  1365. <!-- TODO: this assumes that Auth/datasources is for memory only -->
  1366. <screen>&gt; <userinput>config set Auth/datasources/ []</userinput>
  1367. &gt; <userinput>config commit</userinput></screen>
  1368. </para>
  1369. <para>
  1370. The following example stops serving a specific zone:
  1371. <screen>&gt; <userinput>config remove Auth/datasources[<option>0</option>]/zones[<option>0</option>]</userinput>
  1372. &gt; <userinput>config commit</userinput></screen>
  1373. (Replace the list number(s) in
  1374. <varname>datasources[<replaceable>0</replaceable>]</varname>
  1375. and/or <varname>zones[<replaceable>0</replaceable>]</varname>
  1376. for the relevant zone as needed.)
  1377. </para>
  1378. </section>
  1379. </section>
  1380. <section>
  1381. <title>Loading Master Zones Files</title>
  1382. <para>
  1383. RFC 1035 style DNS master zone files may imported
  1384. into a BIND 10 SQLite3 data source by using the
  1385. <command>b10-loadzone</command> utility.
  1386. </para>
  1387. <para>
  1388. <command>b10-loadzone</command> supports the following
  1389. special directives (control entries):
  1390. <variablelist>
  1391. <varlistentry>
  1392. <term>$INCLUDE</term>
  1393. <listitem>
  1394. <simpara>Loads an additional zone file. This may be recursive.
  1395. </simpara>
  1396. </listitem>
  1397. </varlistentry>
  1398. <varlistentry>
  1399. <term>$ORIGIN</term>
  1400. <listitem>
  1401. <simpara>Defines the relative domain name.
  1402. </simpara>
  1403. </listitem>
  1404. </varlistentry>
  1405. <varlistentry>
  1406. <term>$TTL</term>
  1407. <listitem>
  1408. <simpara>Defines the time-to-live value used for following
  1409. records that don't include a TTL.
  1410. </simpara>
  1411. </listitem>
  1412. </varlistentry>
  1413. </variablelist>
  1414. </para>
  1415. <para>
  1416. The <option>-o</option> argument may be used to define the
  1417. default origin for loaded zone file records.
  1418. </para>
  1419. <note>
  1420. <para>
  1421. In the development prototype release, only the SQLite3 back
  1422. end is used by <command>b10-loadzone</command>.
  1423. By default, it stores the zone data in
  1424. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  1425. unless the <option>-d</option> switch is used to set the
  1426. database filename.
  1427. Multiple zones are stored in a single SQLite3 zone database.
  1428. </para>
  1429. </note>
  1430. <para>
  1431. If you reload a zone already existing in the database,
  1432. all records from that prior zone disappear and a whole new set
  1433. appears.
  1434. </para>
  1435. <!--TODO: permissions for xfrin or loadzone to create the file -->
  1436. </section>
  1437. <!--
  1438. TODO
  1439. <section>
  1440. <title>Troubleshooting</title>
  1441. <para>
  1442. </para>
  1443. </section>
  1444. -->
  1445. </chapter>
  1446. <chapter id="xfrin">
  1447. <title>Incoming Zone Transfers</title>
  1448. <para>
  1449. Incoming zones are transferred using the <command>b10-xfrin</command>
  1450. process which is started by <command>bind10</command>.
  1451. When received, the zone is stored in the corresponding BIND 10
  1452. data source, and its records can be served by
  1453. <command>b10-auth</command>.
  1454. In combination with <command>b10-zonemgr</command> (for
  1455. automated SOA checks), this allows the BIND 10 server to
  1456. provide <quote>secondary</quote> service.
  1457. </para>
  1458. <para>
  1459. The <command>b10-xfrin</command> process supports both AXFR and
  1460. IXFR. Due to some implementation limitations of the current
  1461. development release, however, it only tries AXFR by default,
  1462. and care should be taken to enable IXFR.
  1463. </para>
  1464. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1465. <section>
  1466. <title>Configuration for Incoming Zone Transfers</title>
  1467. <para>
  1468. In practice, you need to specify a list of secondary zones to
  1469. enable incoming zone transfers for these zones (you can still
  1470. trigger a zone transfer manually, without a prior configuration
  1471. (see below)).
  1472. </para>
  1473. <para>
  1474. For example, to enable zone transfers for a zone named "example.com"
  1475. (whose master address is assumed to be 2001:db8::53 here),
  1476. run the following at the <command>bindctl</command> prompt:
  1477. <screen>&gt; <userinput>config add Xfrin/zones</userinput>
  1478. &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
  1479. &gt; <userinput>config set Xfrin/zones[0]/master_addr "<option>2001:db8::53</option>"</userinput>
  1480. &gt; <userinput>config commit</userinput></screen>
  1481. (We assume there has been no zone configuration before).
  1482. </para>
  1483. </section>
  1484. <section>
  1485. <title>Enabling IXFR</title>
  1486. <para>
  1487. As noted above, <command>b10-xfrin</command> uses AXFR for
  1488. zone transfers by default. To enable IXFR for zone transfers
  1489. for a particular zone, set the <userinput>use_ixfr</userinput>
  1490. configuration parameter to <userinput>true</userinput>.
  1491. In the above example of configuration sequence, you'll need
  1492. to add the following before performing <userinput>commit</userinput>:
  1493. <screen>&gt; <userinput>config set Xfrin/zones[0]/use_ixfr true</userinput></screen>
  1494. </para>
  1495. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  1496. <note><simpara>
  1497. One reason why IXFR is disabled by default in the current
  1498. release is because it does not support automatic fallback from IXFR to
  1499. AXFR when it encounters a primary server that doesn't support
  1500. outbound IXFR (and, not many existing implementations support
  1501. it). Another, related reason is that it does not use AXFR even
  1502. if it has no knowledge about the zone (like at the very first
  1503. time the secondary server is set up). IXFR requires the
  1504. "current version" of the zone, so obviously it doesn't work
  1505. in this situation and AXFR is the only workable choice.
  1506. The current release of <command>b10-xfrin</command> does not
  1507. make this selection automatically.
  1508. These features will be implemented in a near future
  1509. version, at which point we will enable IXFR by default.
  1510. </simpara></note>
  1511. </section>
  1512. <!-- TODO:
  1513. how to tell bind10 you are a secondary?
  1514. when will it first attempt to check for new zone? (using REFRESH?)
  1515. what if zonemgr is not running?
  1516. what if a NOTIFY is sent?
  1517. -->
  1518. <section id="zonemgr">
  1519. <title>Secondary Manager</title>
  1520. <para>
  1521. The <command>b10-zonemgr</command> process is started by
  1522. <command>bind10</command>.
  1523. It keeps track of SOA refresh, retry, and expire timers
  1524. and other details for BIND 10 to perform as a slave.
  1525. When the <command>b10-auth</command> authoritative DNS server
  1526. receives a NOTIFY message, <command>b10-zonemgr</command>
  1527. may tell <command>b10-xfrin</command> to do a refresh
  1528. to start an inbound zone transfer.
  1529. The secondary manager resets its counters when a new zone is
  1530. transferred in.
  1531. </para>
  1532. <note><simpara>
  1533. Access control (such as allowing notifies) is not yet provided.
  1534. The primary/secondary service is not yet complete.
  1535. </simpara></note>
  1536. <para>
  1537. The following example shows using <command>bindctl</command>
  1538. to configure the server to be a secondary for the example zone:
  1539. <screen>&gt; <userinput>config add Zonemgr/secondary_zones</userinput>
  1540. &gt; <userinput>config set Zonemgr/secondary_zones[0]/name "<option>example.com</option>"</userinput>
  1541. &gt; <userinput>config set Zonemgr/secondary_zones[0]/class "<option>IN</option>"</userinput>
  1542. &gt; <userinput>config commit</userinput></screen>
  1543. <!-- TODO: remove the IN class example above when it is the default -->
  1544. </para>
  1545. <para>
  1546. If the zone does not exist in the data source already
  1547. (i.e. no SOA record for it), <command>b10-zonemgr</command>
  1548. will automatically tell <command>b10-xfrin</command>
  1549. to transfer the zone in.
  1550. </para>
  1551. </section>
  1552. <section>
  1553. <title>Trigger an Incoming Zone Transfer Manually</title>
  1554. <para>
  1555. To manually trigger a zone transfer to retrieve a remote zone,
  1556. you may use the <command>bindctl</command> utility.
  1557. For example, at the <command>bindctl</command> prompt run:
  1558. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  1559. </para>
  1560. </section>
  1561. <section>
  1562. <title>Incoming Transfers with In-memory Datasource</title>
  1563. <para>
  1564. In the case of an incoming zone transfer, the received zone is
  1565. first stored in the corresponding BIND 10 datasource. In
  1566. case the secondary zone is served by an in-memory datasource
  1567. with an SQLite3 backend, <command>b10-auth</command> is
  1568. automatically sent a <varname>loadzone</varname> command to
  1569. reload the corresponding zone into memory from the backend.
  1570. </para>
  1571. <para>
  1572. The administrator doesn't have to do anything for
  1573. <command>b10-auth</command> to serve the new version of the
  1574. zone, except for the configuration such as the one described in
  1575. <xref linkend="in-memory-datasource-with-sqlite3-backend" />.
  1576. </para>
  1577. </section>
  1578. <!-- TODO: can that retransfer be used to identify a new zone? -->
  1579. <!-- TODO: what if doesn't exist at that master IP? -->
  1580. </chapter>
  1581. <chapter id="xfrout">
  1582. <title>Outbound Zone Transfers</title>
  1583. <para>
  1584. The <command>b10-xfrout</command> process is started by
  1585. <command>bind10</command>.
  1586. When the <command>b10-auth</command> authoritative DNS server
  1587. receives an AXFR or IXFR request, <command>b10-auth</command>
  1588. internally forwards the request to <command>b10-xfrout</command>,
  1589. which handles the rest of request processing.
  1590. This is used to provide primary DNS service to share zones
  1591. to secondary name servers.
  1592. The <command>b10-xfrout</command> is also used to send
  1593. NOTIFY messages to secondary servers.
  1594. </para>
  1595. <para>
  1596. A global or per zone <option>transfer_acl</option> configuration
  1597. can be used to control accessibility of the outbound zone
  1598. transfer service.
  1599. By default, <command>b10-xfrout</command> allows any clients to
  1600. perform zone transfers for any zones:
  1601. </para>
  1602. <screen>&gt; <userinput>config show Xfrout/transfer_acl</userinput>
  1603. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</screen>
  1604. <para>
  1605. You can change this to, for example, rejecting all transfer
  1606. requests by default while allowing requests for the transfer
  1607. of zone "example.com" from 192.0.2.1 and 2001:db8::1 as follows:
  1608. </para>
  1609. <screen>&gt; <userinput>config set Xfrout/transfer_acl[0] {"action": "REJECT"}</userinput>
  1610. &gt; <userinput>config add Xfrout/zone_config</userinput>
  1611. &gt; <userinput>config set Xfrout/zone_config[0]/origin "example.com"</userinput>
  1612. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1"},</userinput>
  1613. <userinput> {"action": "ACCEPT", "from": "2001:db8::1"}]</userinput>
  1614. &gt; <userinput>config commit</userinput></screen>
  1615. <note><simpara>
  1616. In the above example the lines
  1617. for <option>transfer_acl</option> were divided for
  1618. readability. In the actual input it must be in a single line.
  1619. </simpara></note>
  1620. <para>
  1621. If you want to require TSIG in access control, a system wide TSIG
  1622. "key ring" must be configured.
  1623. For example, to change the previous example to allowing requests
  1624. from 192.0.2.1 signed by a TSIG with a key name of
  1625. "key.example", you'll need to do this:
  1626. </para>
  1627. <screen>&gt; <userinput>config set tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</userinput>
  1628. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]</userinput>
  1629. &gt; <userinput>config commit</userinput></screen>
  1630. <para>Both Xfrout and Auth will use the system wide keyring to check
  1631. TSIGs in the incoming messages and to sign responses.</para>
  1632. <note><simpara>
  1633. The way to specify zone specific configuration (ACLs, etc) is
  1634. likely to be changed.
  1635. </simpara></note>
  1636. <!--
  1637. TODO:
  1638. xfrout section:
  1639. auth servers checks for AXFR query
  1640. sends the XFR query to the xfrout module
  1641. uses /tmp/auth_xfrout_conn which is a socket
  1642. what is XfroutClient xfr_client??
  1643. /tmp/auth_xfrout_conn is not removed
  1644. -->
  1645. </chapter>
  1646. <chapter id="ddns">
  1647. <title>Dynamic DNS Update</title>
  1648. <para>
  1649. BIND 10 supports the server side of the Dynamic DNS Update
  1650. (DDNS) protocol as defined in RFC 2136.
  1651. This service is provided by the <command>b10-ddns</command>
  1652. component, which is started by the <command>bind10</command>
  1653. process if configured so.
  1654. </para>
  1655. <para>
  1656. When the <command>b10-auth</command> authoritative DNS server
  1657. receives an UPDATE request, it internally forwards the request
  1658. to <command>b10-ddns</command>, which handles the rest of
  1659. request processing.
  1660. When the processing is completed <command>b10-ddns</command>
  1661. will send a response to the client with the RCODE set to the
  1662. value as specified in RFC 2136 (NOERROR for successful update,
  1663. REFUSED if rejected due to ACL check, etc).
  1664. If the zone has been changed as a result, it will internally
  1665. notify <command>b10-xfrout</command> so that other secondary
  1666. servers will be notified via the DNS notify protocol.
  1667. In addition, if <command>b10-auth</command> serves the updated
  1668. zone from its in-memory cache (as described in
  1669. <xref linkend="in-memory-datasource-with-sqlite3-backend" />),
  1670. <command>b10-ddns</command> will also
  1671. notify <command>b10-auth</command> so that <command>b10-auth</command>
  1672. will re-cache the updated zone content.
  1673. </para>
  1674. <para>
  1675. The <command>b10-ddns</command> component supports requests over
  1676. both UDP and TCP, and both IPv6 and IPv4; for TCP requests,
  1677. however, it terminates the TCP connection immediately after
  1678. each single request has been processed. Clients cannot reuse the
  1679. same TCP connection for multiple requests. (This is a current
  1680. implementation limitation of <command>b10-ddns</command>.
  1681. While RFC 2136 doesn't specify anything about such reuse of TCP
  1682. connection, there is no reason for disallowing it as RFC 1035
  1683. generally allows multiple requests sent over a single TCP
  1684. connection. BIND 9 supports such reuse.)
  1685. </para>
  1686. <para>
  1687. As of this writing <command>b10-ddns</command> does not support
  1688. update forwarding for secondary zones.
  1689. If it receives an update request for a secondary zone, it will
  1690. immediately return a response with an RCODE of NOTIMP.
  1691. <note><simpara>
  1692. For feature completeness update forwarding should be
  1693. eventually supported. But right now it's considered a lower
  1694. priority task and there is no specific plan of implementing
  1695. this feature.
  1696. <!-- See Trac #2063 -->
  1697. </simpara></note>
  1698. </para>
  1699. <section>
  1700. <title>Enabling Dynamic Update</title>
  1701. <para>
  1702. First off, it must be made sure that a few components on which
  1703. <command>b10-ddns</command> depends are configured to run,
  1704. which are <command>b10-auth</command>
  1705. and <command>b10-zonemgr</command>.
  1706. In addition, <command>b10-xfrout</command> should also be
  1707. configured to run; otherwise the notification after an update
  1708. (see above) will fail with a timeout, suspending the DDNS
  1709. service while <command>b10-ddns</command> waits for the
  1710. response (see the description of the <ulink
  1711. url="bind10-messages.html#DDNS_UPDATE_NOTIFY_FAIL">DDNS_UPDATE_NOTIFY_FAIL</ulink>
  1712. log message for further details).
  1713. If BIND 10 is already configured to provide authoritative DNS
  1714. service they should normally be configured to run already.
  1715. </para>
  1716. <para>
  1717. Second, for the obvious reason dynamic update requires that the
  1718. underlying data source storing the zone data be writable.
  1719. In the current implementation this means the zone must be stored
  1720. in an SQLite3-based data source.
  1721. Also, right now, the <command>b10-ddns</command> component
  1722. configures itself with the data source referring to the
  1723. <quote>database_file</quote> configuration parameter of
  1724. <command>b10-auth</command>.
  1725. So this information must be configured correctly before starting
  1726. <command>b10-ddns</command>.
  1727. <note><simpara>
  1728. The way to configure data sources is now being revised.
  1729. Configuration on the data source for DDNS will be very
  1730. likely to be changed in a backward incompatible manner in
  1731. a near future version.
  1732. </simpara></note>
  1733. </para>
  1734. <para>
  1735. In general, if something goes wrong regarding the dependency
  1736. described above, <command>b10-ddns</command> will log the
  1737. related event at the warning or error level.
  1738. It's advisable to check the log message when you first enable
  1739. DDNS or if it doesn't work as you expect to see if there's any
  1740. warning or error log message.
  1741. </para>
  1742. <para>
  1743. Next, to enable the DDNS service, <command>b10-ddns</command>
  1744. needs to be explicitly configured to run.
  1745. It can be done by using the <command>bindctl</command>
  1746. utility. For example:
  1747. <screen>
  1748. &gt; <userinput>config add Boss/components b10-ddns</userinput>
  1749. &gt; <userinput>config set Boss/components/b10-ddns/address DDNS</userinput>
  1750. &gt; <userinput>config set Boss/components/b10-ddns/kind dispensable</userinput>
  1751. &gt; <userinput>config commit</userinput>
  1752. </screen>
  1753. <note><simpara>
  1754. In theory "kind" could be omitted because "dispensable" is its
  1755. default. But there's some peculiar behavior (which should
  1756. be a bug and should be fixed eventually; see Trac ticket
  1757. #2064) with bindctl and you'll still need to specify that explicitly.
  1758. Likewise, "address" may look unnecessary because
  1759. <command>b10-ddns</command> would start and work without
  1760. specifying it. But for it to shutdown gracefully this
  1761. parameter should also be specified.
  1762. </simpara></note>
  1763. </para>
  1764. </section>
  1765. <section>
  1766. <title>Access Control</title>
  1767. <para>
  1768. By default <command>b10-ddns</command> rejects any update
  1769. requests from any clients by returning a response with an RCODE
  1770. of REFUSED.
  1771. To allow updates to take effect, an access control rule
  1772. (called update ACL) with a policy allowing updates must explicitly be
  1773. configured.
  1774. Update ACL must be configured per zone basis in the
  1775. <quote>zones</quote> configuration parameter of
  1776. <command>b10-ddns</command>.
  1777. This is a list of per-zone configurations regarding DDNS.
  1778. Each list element consists of the following parameters:
  1779. <variablelist>
  1780. <varlistentry>
  1781. <term>origin</term>
  1782. <listitem>
  1783. <simpara>The zone's origin name</simpara>
  1784. </listitem>
  1785. </varlistentry>
  1786. <varlistentry>
  1787. <term>class</term>
  1788. <listitem>
  1789. <simpara>The RR class of the zone
  1790. (normally <quote>IN</quote>, and in that case
  1791. can be omitted in configuration)</simpara>
  1792. </listitem>
  1793. </varlistentry>
  1794. <varlistentry>
  1795. <term>update_acl</term>
  1796. <listitem>
  1797. <simpara>List of access control rules (ACL) for the zone</simpara>
  1798. </listitem>
  1799. </varlistentry>
  1800. </variablelist>
  1801. The syntax of the ACL is the same as ACLs for other
  1802. components.
  1803. Specific examples are given below.
  1804. </para>
  1805. <para>
  1806. In general, an update ACL rule that allows an update request
  1807. should be configured with a TSIG key.
  1808. This is an example update ACL that allows updates to the zone
  1809. named <quote>example.org</quote> of RR class <quote>IN</quote>
  1810. from clients that send requests signed with a TSIG whose
  1811. key name is "key.example.org" (and refuses all others):
  1812. <screen>
  1813. &gt; <userinput>config add DDNS/zones</userinput>
  1814. &gt; <userinput>config set DDNS/zones[0]/origin example.org</userinput>
  1815. &gt; <userinput>config set DDNS/zones[0]/class IN</userinput>
  1816. (Note: "class" can be omitted)
  1817. &gt; <userinput>config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "key.example.org"}</userinput>
  1818. &gt; <userinput>config commit</userinput>
  1819. </screen>
  1820. The TSIG key must be configured system wide
  1821. (see <xref linkend="xfrout"/>.)
  1822. </para>
  1823. <para>
  1824. Multiple rules can be specified in the ACL, and an ACL rule
  1825. can consist of multiple constraints, such as a combination of
  1826. IP address and TSIG.
  1827. The following configuration sequence will add a new rule to
  1828. the ACL created in the above example. This additional rule
  1829. allows update requests sent from a client
  1830. using TSIG key name of "key.example" (different from the
  1831. key used in the previous example) and has an IPv6 address of ::1.
  1832. <screen>
  1833. &gt; <userinput>config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "from": "::1", "key": "key.example"}</userinput>
  1834. &gt; <userinput>config show DDNS/zones[0]/update_acl</userinput>
  1835. DDNS/zones[0]/update_acl[0] {"action": "ACCEPT", "key": "key.example.org"} any (modified)
  1836. DDNS/zones[0]/update_acl[1] {"action": "ACCEPT", "from": "::1", "key": "key.example"} any (modified)
  1837. &gt; <userinput>config commit</userinput>
  1838. </screen>
  1839. (Note the "add" in the first line. Before this sequence, we
  1840. have had only entry in zones[0]/update_acl. The "add" command
  1841. with a value (rule) adds a new entry and sets it to the given rule.
  1842. Due to a limitation of the current implementation, it doesn't
  1843. work if you first try to just add a new entry and then set it to
  1844. a given rule).
  1845. </para>
  1846. <note><simpara>
  1847. The <command>b10-ddns</command> component accepts an ACL
  1848. rule that just allows updates from a specific IP address
  1849. (i.e., without requiring TSIG), but this is highly
  1850. discouraged (remember that requests can be made over UDP and
  1851. spoofing the source address of a UDP packet is often pretty
  1852. easy).
  1853. Unless you know what you are doing and that you can accept
  1854. its consequence, any update ACL rule that allows updates
  1855. should have a TSIG key in its constraints.
  1856. </simpara></note>
  1857. <para>
  1858. The ACL rules will be checked in the listed order, and the
  1859. first matching one will apply.
  1860. If none of the rules matches, the default rule will apply,
  1861. which is rejecting any requests in the case of
  1862. <command>b10-ddns</command>.
  1863. </para>
  1864. <para>
  1865. Other actions than "ACCEPT", namely "REJECT" and "DROP", can be
  1866. used, too.
  1867. See <xref linkend="resolverserver"/> about their effects.
  1868. </para>
  1869. <para>
  1870. Currently update ACL can only control updates per zone basis;
  1871. it's not possible to specify access control with higher
  1872. granularity such as for particular domain names or specific
  1873. types of RRs.
  1874. <!-- See Trac ticket #2065 -->
  1875. </para>
  1876. <note><simpara>
  1877. Contrary to what RFC 2136 (literally) specifies,
  1878. <command>b10-ddns</command> checks the update ACL before
  1879. checking the prerequisites of the update request.
  1880. This is a deliberate implementation decision.
  1881. This counter intuitive specification has been repeatedly
  1882. discussed among implementers and in the IETF, and it is now
  1883. widely agreed that it does not make sense to strictly follow
  1884. that part of RFC.
  1885. One known specific bad result of following the RFC is that it
  1886. could leak information about which name or record exists or does not
  1887. exist in the zone as a result of prerequisite checks even if a
  1888. zone is somehow configured to reject normal queries from
  1889. arbitrary clients.
  1890. There have been other troubles that could have been avoided if
  1891. the ACL could be checked before the prerequisite check.
  1892. </simpara></note>
  1893. </section>
  1894. <section>
  1895. <title>Miscellaneous Operational Issues</title>
  1896. <para>
  1897. Unlike BIND 9, BIND 10 currently does not support automatic
  1898. resigning of DNSSEC-signed zone when it's updated via DDNS.
  1899. It could be possible to resign the updated zone afterwards
  1900. or make sure the update request also updates related DNSSEC
  1901. records, but that will be pretty error-prone operation.
  1902. In general, it's not advisable to allow DDNS for a signed zone
  1903. at this moment.
  1904. </para>
  1905. <para>
  1906. Also unlike BIND 9, it's currently not possible
  1907. to <quote>freeze</quote> a zone temporarily in order to
  1908. suspend DDNS while you manually update the zone.
  1909. If you need to make manual updates to a dynamic zone,
  1910. you'll need to temporarily reject any updates to the zone via
  1911. the update ACLs.
  1912. </para>
  1913. <para>
  1914. Dynamic updates are only applicable to primary zones.
  1915. In order to avoid updating secondary zones via DDNS requests,
  1916. <command>b10-ddns</command> refers to the
  1917. <quote>secondary_zones</quote> configuration of
  1918. <command>b10-zonemgr</command>. Zones listed in
  1919. <quote>secondary_zones</quote> will never be updated via DDNS
  1920. regardless of the update ACL configuration;
  1921. <command>b10-ddns</command> will return a response with an
  1922. RCODE of NOTAUTH as specified in RFC 2136.
  1923. If you have a "conceptual" secondary zone whose content is a
  1924. copy of some external source but is not updated via the
  1925. standard zone transfers and therefore not listed in
  1926. <quote>secondary_zones</quote>, be careful not to allow DDNS
  1927. for the zone; it would be quite likely to lead to inconsistent
  1928. state between different servers.
  1929. Normally this should not be a problem because the default
  1930. update ACL rejects any update requests, but you may want to
  1931. take an extra care about the configuration if you have such
  1932. type of secondary zones.
  1933. </para>
  1934. <para>
  1935. The difference of two versions of a zone, before and after a
  1936. DDNS transaction, is automatically recorded in the underlying
  1937. data source, and can be retrieved in the form of outbound
  1938. IXFR.
  1939. This is done automatically; it does not require specific
  1940. configuration to make this possible.
  1941. </para>
  1942. </section>
  1943. </chapter>
  1944. <chapter id="resolverserver">
  1945. <title>Recursive Name Server</title>
  1946. <para>
  1947. The <command>b10-resolver</command> process is started by
  1948. <command>bind10</command>.
  1949. <!-- TODO
  1950. It provides a resolver so DNS clients can ask it to do recursion
  1951. and it will return answers.
  1952. -->
  1953. </para>
  1954. <para>
  1955. The main <command>bind10</command> process can be configured
  1956. to select to run either the authoritative or resolver or both.
  1957. By default, it doesn't start either one. You may change this using
  1958. <command>bindctl</command>, for example:
  1959. <screen>
  1960. &gt; <userinput>config add Boss/components b10-resolver</userinput>
  1961. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  1962. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  1963. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  1964. &gt; <userinput>config commit</userinput>
  1965. </screen>
  1966. </para>
  1967. <para>
  1968. The master <command>bind10</command> will stop and start
  1969. the desired services.
  1970. </para>
  1971. <para>
  1972. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  1973. The following example shows how it can be configured to
  1974. listen on an additional address (and port):
  1975. <screen>
  1976. &gt; <userinput>config add Resolver/listen_on</userinput>
  1977. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
  1978. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
  1979. &gt; <userinput>config commit</userinput>
  1980. </screen>
  1981. </para>
  1982. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  1983. as needed; run <quote><userinput>config show
  1984. Resolver/listen_on</userinput></quote> if needed.)</simpara>
  1985. <!-- TODO: this example should not include the port, ticket #1185 -->
  1986. <section>
  1987. <title>Access Control</title>
  1988. <para>
  1989. By default, the <command>b10-resolver</command> daemon only accepts
  1990. DNS queries from the localhost (127.0.0.1 and ::1).
  1991. The <option>Resolver/query_acl</option> configuration may
  1992. be used to reject, drop, or allow specific IPs or networks.
  1993. This configuration list is first match.
  1994. </para>
  1995. <para>
  1996. The configuration's <option>action</option> item may be
  1997. set to <quote>ACCEPT</quote> to allow the incoming query,
  1998. <quote>REJECT</quote> to respond with a DNS REFUSED return
  1999. code, or <quote>DROP</quote> to ignore the query without
  2000. any response (such as a blackhole). For more information,
  2001. see the respective debugging messages: <ulink
  2002. url="bind10-messages.html#RESOLVER_QUERY_ACCEPTED">RESOLVER_QUERY_ACCEPTED</ulink>,
  2003. <ulink
  2004. url="bind10-messages.html#RESOLVER_QUERY_REJECTED">RESOLVER_QUERY_REJECTED</ulink>,
  2005. and <ulink
  2006. url="bind10-messages.html#RESOLVER_QUERY_DROPPED">RESOLVER_QUERY_DROPPED</ulink>.
  2007. </para>
  2008. <para>
  2009. The required configuration's <option>from</option> item is set
  2010. to an IPv4 or IPv6 address, addresses with an network mask, or to
  2011. the special lowercase keywords <quote>any6</quote> (for
  2012. any IPv6 address) or <quote>any4</quote> (for any IPv4
  2013. address).
  2014. </para>
  2015. <!-- TODO:
  2016. /0 is for any address in that address family
  2017. does that need any address too?
  2018. TODO: tsig
  2019. -->
  2020. <para>
  2021. For example to allow the <replaceable>192.168.1.0/24</replaceable>
  2022. network to use your recursive name server, at the
  2023. <command>bindctl</command> prompt run:
  2024. </para>
  2025. <screen>
  2026. &gt; <userinput>config add Resolver/query_acl</userinput>
  2027. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/action "ACCEPT"</userinput>
  2028. &gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/from "<replaceable>192.168.1.0/24</replaceable>"</userinput>
  2029. &gt; <userinput>config commit</userinput>
  2030. </screen>
  2031. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  2032. as needed; run <quote><userinput>config show
  2033. Resolver/query_acl</userinput></quote> if needed.)</simpara>
  2034. <!-- TODO: check this -->
  2035. <note><simpara>This prototype access control configuration
  2036. syntax may be changed.</simpara></note>
  2037. </section>
  2038. <section>
  2039. <title>Forwarding</title>
  2040. <para>
  2041. To enable forwarding, the upstream address and port must be
  2042. configured to forward queries to, such as:
  2043. <screen>
  2044. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  2045. &gt; <userinput>config commit</userinput>
  2046. </screen>
  2047. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  2048. full resolver.)
  2049. </para>
  2050. <para>
  2051. Normal iterative name service can be re-enabled by clearing the
  2052. forwarding address(es); for example:
  2053. <screen>
  2054. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  2055. &gt; <userinput>config commit</userinput>
  2056. </screen>
  2057. </para>
  2058. </section>
  2059. <!-- TODO: later try this
  2060. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  2061. > config set Resolver/forward_addresses[0]/port 53
  2062. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  2063. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  2064. -->
  2065. </chapter>
  2066. <chapter id="dhcp4">
  2067. <title>DHCPv4 Server</title>
  2068. <para>Dynamic Host Configuration Protocol for IPv4 (DHCP or
  2069. DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  2070. are protocols that allow one node (server) to provision
  2071. configuration parameters to many hosts and devices (clients). To
  2072. ease deployment in larger networks, additional nodes (relays) may
  2073. be deployed that facilitate communication between servers and
  2074. clients. Even though principles of both DHCPv4 and DHCPv6 are
  2075. somewhat similar, these are two radically different
  2076. protocols. BIND10 offers server implementations for both DHCPv4
  2077. and DHCPv6. This chapter is about DHCP for IPv4. For a description
  2078. of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para>
  2079. <para>The DHCPv4 server component is currently under intense
  2080. development. You may want to check out <ulink
  2081. url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
  2082. and recent posts on <ulink
  2083. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
  2084. developers mailing list</ulink>.</para>
  2085. <para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
  2086. internally code named <quote>Kea</quote>.</para>
  2087. <note>
  2088. <para>
  2089. As of December 2011, both DHCPv4 and DHCPv6 components are
  2090. skeleton servers. That means that while they are capable of
  2091. performing DHCP configuration, they are not fully functional
  2092. yet. In particular, neither has functional lease
  2093. databases. This means that they will assign the same, fixed,
  2094. hardcoded addresses to any client that will ask. See <xref
  2095. linkend="dhcp4-limit"/> and <xref linkend="dhcp6-limit"/> for
  2096. detailed description.
  2097. </para>
  2098. </note>
  2099. <section id="dhcp4-usage">
  2100. <title>DHCPv4 Server Usage</title>
  2101. <para>BIND10 provides the DHCPv4 server component since December
  2102. 2011. It is a skeleton server and can be described as an early
  2103. prototype that is not fully functional yet. It is mature enough
  2104. to conduct first tests in lab environment, but it has
  2105. significant limitations. See <xref linkend="dhcp4-limit"/> for
  2106. details.
  2107. </para>
  2108. <para>
  2109. <command>b10-dhcp4</command> is a BIND10 component and is being
  2110. run under BIND10 framework. To add a DHCPv4 process to the set of running
  2111. BIND10 services, you can use following commands in <command>bindctl</command>:
  2112. <screen>&gt; <userinput>config add Boss/components b10-dhcp4</userinput>
  2113. &gt; <userinput>config set Boss/components/b10-dhcp4/kind dispensable</userinput>
  2114. &gt; <userinput>config commit</userinput></screen></para>
  2115. <para>
  2116. To shutdown running <command>b10-dhcp4</command>, please use the
  2117. following command:
  2118. <screen>&gt; <userinput>Dhcp4 shutdown</userinput></screen>
  2119. or
  2120. <screen>&gt; <userinput>config remove Boss/components b10-dhcp4</userinput>
  2121. &gt; <userinput>config commit</userinput></screen></para>
  2122. <para>
  2123. At start, the server will detect available network interfaces
  2124. and will attempt to open UDP sockets on all interfaces that
  2125. are up, running, are not loopback, and have IPv4 address
  2126. assigned.
  2127. The server will then listen to incoming traffic. Currently
  2128. supported client messages are DISCOVER and REQUEST. The server
  2129. will respond to them with OFFER and ACK, respectively.
  2130. Since the DHCPv4 server opens privileged ports, it requires root
  2131. access. Make sure you run this daemon as root.</para>
  2132. <note>
  2133. <para>
  2134. Integration with <command>bind10</command> is
  2135. planned. Ultimately, <command>b10-dhcp4</command> will not
  2136. be started directly, but rather via
  2137. <command>bind10</command>. Please be aware of this planned
  2138. change.
  2139. </para>
  2140. </note>
  2141. </section>
  2142. <section id="dhcp4-config">
  2143. <title>DHCPv4 Server Configuration</title>
  2144. <para>
  2145. The DHCPv4 server does not have a lease database implemented yet
  2146. nor any support for configuration, so every time the same set
  2147. of configuration options (including the same fixed address)
  2148. will be assigned every time.
  2149. </para>
  2150. <para>
  2151. At this stage of development, the only way to alter the server
  2152. configuration is to tweak its source code. To do so, please
  2153. edit src/bin/dhcp4/dhcp4_srv.cc file and modify following
  2154. parameters and recompile:
  2155. <screen>
  2156. const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
  2157. const std::string HARDCODED_NETMASK = "255.255.255.0";
  2158. const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds
  2159. const std::string HARDCODED_GATEWAY = "192.0.2.1";
  2160. const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
  2161. const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
  2162. const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
  2163. Lease database and configuration support is planned for 2012.
  2164. </para>
  2165. </section>
  2166. <section id="dhcp4-std">
  2167. <title>Supported standards</title>
  2168. <para>The following standards and draft standards are currently
  2169. supported:</para>
  2170. <itemizedlist>
  2171. <listitem>
  2172. <simpara>RFC2131: Supported messages are DISCOVER, OFFER,
  2173. REQUEST, and ACK.</simpara>
  2174. </listitem>
  2175. <listitem>
  2176. <simpara>RFC2132: Supported options are: PAD (0),
  2177. END(255), Message Type(53), DHCP Server Identifier (54),
  2178. Domain Name (15), DNS Servers (6), IP Address Lease Time
  2179. (51), Subnet mask (1), and Routers (3).</simpara>
  2180. </listitem>
  2181. </itemizedlist>
  2182. </section>
  2183. <section id="dhcp4-limit">
  2184. <title>DHCPv4 Server Limitations</title>
  2185. <para>These are the current limitations of the DHCPv4 server
  2186. software. Most of them are reflections of the early stage of
  2187. development and should be treated as <quote>not implemented
  2188. yet</quote>, rather than actual limitations.</para>
  2189. <itemizedlist>
  2190. <listitem>
  2191. <simpara>During initial IPv4 node configuration, the
  2192. server is expected to send packets to a node that does not
  2193. have IPv4 address assigned yet. The server requires
  2194. certain tricks (or hacks) to transmit such packets. This
  2195. is not implemented yet, therefore DHCPv4 server supports
  2196. relayed traffic only (that is, normal point to point
  2197. communication).</simpara>
  2198. </listitem>
  2199. <listitem>
  2200. <simpara><command>b10-dhcp4</command> provides a single,
  2201. fixed, hardcoded lease to any client that asks. There is
  2202. no lease manager implemented. If two clients request
  2203. addresses, they will both get the same fixed
  2204. address.</simpara>
  2205. </listitem>
  2206. <listitem>
  2207. <simpara><command>b10-dhcp4</command> does not support any
  2208. configuration mechanisms yet. The whole configuration is
  2209. currently hardcoded. The only way to tweak configuration
  2210. is to directly modify source code. See see <xref
  2211. linkend="dhcp4-config"/> for details.</simpara>
  2212. </listitem>
  2213. <listitem>
  2214. <simpara>Upon start, the server will open sockets on all
  2215. interfaces that are not loopback, are up and running and
  2216. have IPv4 address.</simpara>
  2217. </listitem>
  2218. <listitem>
  2219. <simpara>PRL (Parameter Request List, a list of options
  2220. requested by a client) is currently ignored and server
  2221. assigns DNS SERVER and DOMAIN NAME options.</simpara>
  2222. </listitem>
  2223. <listitem>
  2224. <simpara><command>b10-dhcp4</command> does not support
  2225. BOOTP. That is a design choice. This limitation is
  2226. permanent. If you have legacy nodes that can't use DHCP and
  2227. require BOOTP support, please use latest version of ISC DHCP
  2228. <ulink url="http://www.isc.org/software/dhcp"/>.</simpara>
  2229. </listitem>
  2230. <listitem>
  2231. <simpara>Interface detection is currently working on Linux
  2232. only. See <xref linkend="iface-detect"/> for details.</simpara>
  2233. </listitem>
  2234. <listitem>
  2235. <simpara><command>b10-dhcp4</command> does not verify that
  2236. assigned address is unused. According to RFC2131, the
  2237. allocating server should verify that address is no used by
  2238. sending ICMP echo request.</simpara>
  2239. </listitem>
  2240. <listitem>
  2241. <simpara>Address renewal (RENEW), rebinding (REBIND),
  2242. confirmation (CONFIRM), duplication report (DECLINE) and
  2243. release (RELEASE) are not supported yet.</simpara>
  2244. </listitem>
  2245. <listitem>
  2246. <simpara>DNS Update is not supported yet.</simpara>
  2247. </listitem>
  2248. <listitem>
  2249. <simpara>-v (verbose) command line option is currently
  2250. the default, and cannot be disabled.</simpara>
  2251. </listitem>
  2252. </itemizedlist>
  2253. </section>
  2254. </chapter>
  2255. <chapter id="dhcp6">
  2256. <title>DHCPv6 Server</title>
  2257. <para>Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is
  2258. specified in RFC3315. BIND10 provides DHCPv6 server implementation
  2259. that is described in this chapter. For a description of the DHCPv4
  2260. server implementation, see <xref linkend="dhcp4"/>.
  2261. </para>
  2262. <para>The DHCPv6 server component is currently under intense
  2263. development. You may want to check out <ulink
  2264. url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
  2265. and recent posts on <ulink
  2266. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
  2267. developers mailing list</ulink>.</para>
  2268. <para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
  2269. internally code named <quote>Kea</quote>.</para>
  2270. <note>
  2271. <para>
  2272. As of December 2011, both DHCPv4 and DHCPv6 components are
  2273. skeleton servers. That means that while they are capable of
  2274. performing DHCP configuration, they are not fully functional
  2275. yet. In particular, neither has functional lease
  2276. databases. This means that they will assign the same, fixed,
  2277. hardcoded addresses to any client that will ask. See <xref
  2278. linkend="dhcp4-limit"/> and <xref linkend="dhcp6-limit"/> for
  2279. detailed description.
  2280. </para>
  2281. </note>
  2282. <section id="dhcp6-usage">
  2283. <title>DHCPv6 Server Usage</title>
  2284. <para>
  2285. BIND10 provides the DHCPv6 server component since September
  2286. 2011. It is a skeleton server and can be described as an early
  2287. prototype that is not fully functional yet. It is mature
  2288. enough to conduct first tests in lab environment, but it has
  2289. significant limitations. See <xref linkend="dhcp6-limit"/> for
  2290. details.
  2291. </para>
  2292. <para>
  2293. The DHCPv6 server is implemented as <command>b10-dhcp6</command>
  2294. daemon. As it is not configurable yet, it is fully autonomous,
  2295. that is it does not interact with <command>b10-cfgmgr</command>.
  2296. To start DHCPv6 server, simply input:
  2297. <screen>
  2298. #<userinput>cd src/bin/dhcp6</userinput>
  2299. #<userinput>./b10-dhcp6</userinput>
  2300. </screen>
  2301. Depending on your installation, <command>b10-dhcp6</command>
  2302. binary may reside in src/bin/dhcp6 in your source code
  2303. directory, in /usr/local/bin/b10-dhcp6 or other directory
  2304. you specified during compilation.
  2305. At start, server will detect available network interfaces
  2306. and will attempt to open UDP sockets on all interfaces that
  2307. are up, running, are not loopback, are multicast-capable, and
  2308. have IPv6 address assigned.
  2309. The server will then listen to incoming traffic. Currently
  2310. supported client messages are SOLICIT and REQUEST. The server
  2311. will respond to them with ADVERTISE and REPLY, respectively.
  2312. Since the DHCPv6 server opens privileged ports, it requires root
  2313. access. Make sure you run this daemon as root.
  2314. </para>
  2315. <note>
  2316. <para>
  2317. Integration with <command>bind10</command> is
  2318. planned. Ultimately, <command>b10-dhcp6</command> will not
  2319. be started directly, but rather via
  2320. <command>bind10</command>. Please be aware of this planned
  2321. change.
  2322. </para>
  2323. </note>
  2324. </section>
  2325. <section id="dhcp6-config">
  2326. <title>DHCPv6 Server Configuration</title>
  2327. <para>
  2328. The DHCPv6 server does not have lease database implemented yet
  2329. or any support for configuration, so every time the same set
  2330. of configuration options (including the same fixed address)
  2331. will be assigned every time.
  2332. </para>
  2333. <para>
  2334. At this stage of development, the only way to alter server
  2335. configuration is to tweak its source code. To do so, please
  2336. edit src/bin/dhcp6/dhcp6_srv.cc file and modify following
  2337. parameters and recompile:
  2338. <screen>
  2339. const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
  2340. const uint32_t HARDCODED_T1 = 1500; // in seconds
  2341. const uint32_t HARDCODED_T2 = 2600; // in seconds
  2342. const uint32_t HARDCODED_PREFERRED_LIFETIME = 3600; // in seconds
  2343. const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds
  2344. const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";</screen>
  2345. Lease database and configuration support is planned for 2012.
  2346. </para>
  2347. </section>
  2348. <section id="dhcp6-std">
  2349. <title>Supported DHCPv6 Standards</title>
  2350. <para>The following standards and draft standards are currently
  2351. supported:</para>
  2352. <itemizedlist>
  2353. <listitem>
  2354. <simpara>RFC3315: Supported messages are SOLICIT,
  2355. ADVERTISE, REQUEST, and REPLY. Supported options are
  2356. SERVER_ID, CLIENT_ID, IA_NA, and IAADDRESS.</simpara>
  2357. </listitem>
  2358. <listitem>
  2359. <simpara>RFC3646: Supported option is DNS_SERVERS.</simpara>
  2360. </listitem>
  2361. </itemizedlist>
  2362. </section>
  2363. <section id="dhcp6-limit">
  2364. <title>DHCPv6 Server Limitations</title>
  2365. <para> These are the current limitations of the DHCPv6 server
  2366. software. Most of them are reflections of the early stage of
  2367. development and should be treated as <quote>not implemented
  2368. yet</quote>, rather than actual limitations.</para>
  2369. <para>
  2370. <itemizedlist>
  2371. <listitem>
  2372. <simpara>Relayed traffic is not supported.</simpara>
  2373. </listitem>
  2374. <listitem>
  2375. <simpara><command>b10-dhcp6</command> provides a single,
  2376. fixed, hardcoded lease to any client that asks. There is no
  2377. lease manager implemented. If two clients request addresses,
  2378. they will both get the same fixed address.</simpara>
  2379. </listitem>
  2380. <listitem>
  2381. <simpara><command>b10-dhcp6</command> does not support any
  2382. configuration mechanisms yet. The whole configuration is
  2383. currently hardcoded. The only way to tweak configuration
  2384. is to directly modify source code. See see <xref
  2385. linkend="dhcp6-config"/> for details.</simpara>
  2386. </listitem>
  2387. <listitem>
  2388. <simpara>Upon start, the server will open sockets on all
  2389. interfaces that are not loopback, are up, running and are
  2390. multicast capable and have IPv6 address. Support for
  2391. multiple interfaces is not coded in reception routines yet,
  2392. so if you are running this code on a machine that has many
  2393. interfaces and <command>b10-dhcp6</command> happens to
  2394. listen on wrong interface, the easiest way to work around
  2395. this problem is to turn down other interfaces. This
  2396. limitation will be fixed shortly.</simpara>
  2397. </listitem>
  2398. <listitem>
  2399. <simpara>ORO (Option Request Option, a list of options
  2400. requested by a client) is currently ignored and server
  2401. assigns DNS SERVER option.</simpara>
  2402. </listitem>
  2403. <listitem>
  2404. <simpara>Temporary addresses are not supported yet.</simpara>
  2405. </listitem>
  2406. <listitem>
  2407. <simpara>Prefix delegation is not supported yet.</simpara>
  2408. </listitem>
  2409. <listitem>
  2410. <simpara>Address renewal (RENEW), rebinding (REBIND),
  2411. confirmation (CONFIRM), duplication report (DECLINE) and
  2412. release (RELEASE) are not supported yet.</simpara>
  2413. </listitem>
  2414. <listitem>
  2415. <simpara>DNS Update is not supported yet.</simpara>
  2416. </listitem>
  2417. <listitem>
  2418. <simpara>Interface detection is currently working on Linux
  2419. only. See <xref linkend="iface-detect"/> for details.</simpara>
  2420. </listitem>
  2421. <listitem>
  2422. <simpara>-v (verbose) command line option is currently the
  2423. default, and cannot be disabled.</simpara>
  2424. </listitem>
  2425. </itemizedlist>
  2426. </para>
  2427. </section>
  2428. </chapter>
  2429. <chapter id="libdhcp">
  2430. <title>libdhcp++ library</title>
  2431. <para>libdhcp++ is a common library written in C++ that handles
  2432. many DHCP-related tasks, like DHCPv4 and DHCPv6 packets parsing,
  2433. manipulation and assembly, option parsing, manipulation and
  2434. assembly, network interface detection and socket operations, like
  2435. socket creations, data transmission and reception and socket
  2436. closing.
  2437. </para>
  2438. <para>
  2439. While this library is currently used by
  2440. <command>b10-dhcp4</command> and <command>b10-dhcp6</command>
  2441. only, it is designed to be portable, universal library useful for
  2442. any kind of DHCP-related software.
  2443. </para>
  2444. <section id="iface-detect">
  2445. <title>Interface detection</title>
  2446. <para>Both DHCPv4 and DHCPv6 components share network
  2447. interface detection routines. Interface detection is
  2448. currently only supported on Linux systems.</para>
  2449. <para>For non-Linux systems, there is currently stub
  2450. implementation provided. Interface manager detects loopback
  2451. interfaces only as their name (lo or lo0) can be easily predicted.
  2452. Please contact BIND10 development team if you are interested
  2453. in running DHCP components on systems other than Linux.</para>
  2454. </section>
  2455. <section id="packet-handling">
  2456. <title>DHCPv4/DHCPv6 packet handling</title>
  2457. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  2458. </section>
  2459. </chapter>
  2460. <chapter id="statistics">
  2461. <title>Statistics</title>
  2462. <para>
  2463. The <command>b10-stats</command> process is started by
  2464. <command>bind10</command>.
  2465. It periodically collects statistics data from various modules
  2466. and aggregates it.
  2467. <!-- TODO -->
  2468. </para>
  2469. <para>
  2470. This stats daemon provides commands to identify if it is
  2471. running, show specified or all statistics data, show specified
  2472. or all statistics data schema, and set specified statistics
  2473. data.
  2474. For example, using <command>bindctl</command>:
  2475. <screen>
  2476. &gt; <userinput>Stats show</userinput>
  2477. {
  2478. "Auth": {
  2479. "opcode.iquery": 0,
  2480. "opcode.notify": 10,
  2481. "opcode.query": 869617,
  2482. ...
  2483. "queries.tcp": 1749,
  2484. "queries.udp": 867868
  2485. },
  2486. "Boss": {
  2487. "boot_time": "2011-01-20T16:59:03Z"
  2488. },
  2489. "Stats": {
  2490. "boot_time": "2011-01-20T16:59:05Z",
  2491. "last_update_time": "2011-01-20T17:04:05Z",
  2492. "lname": "4d3869d9_a@jreed.example.net",
  2493. "report_time": "2011-01-20T17:04:06Z",
  2494. "timestamp": 1295543046.823504
  2495. }
  2496. }
  2497. </screen>
  2498. </para>
  2499. </chapter>
  2500. <chapter id="logging">
  2501. <title>Logging</title>
  2502. <section>
  2503. <title>Logging configuration</title>
  2504. <para>
  2505. The logging system in BIND 10 is configured through the
  2506. Logging module. All BIND 10 modules will look at the
  2507. configuration in Logging to see what should be logged and
  2508. to where.
  2509. <!-- TODO: what is context of Logging module for readers of this guide? -->
  2510. </para>
  2511. <section>
  2512. <title>Loggers</title>
  2513. <para>
  2514. Within BIND 10, a message is logged through a component
  2515. called a "logger". Different parts of BIND 10 log messages
  2516. through different loggers, and each logger can be configured
  2517. independently of one another.
  2518. </para>
  2519. <para>
  2520. In the Logging module, you can specify the configuration
  2521. for zero or more loggers; any that are not specified will
  2522. take appropriate default values.
  2523. </para>
  2524. <para>
  2525. The three most important elements of a logger configuration
  2526. are the <option>name</option> (the component that is
  2527. generating the messages), the <option>severity</option>
  2528. (what to log), and the <option>output_options</option>
  2529. (where to log).
  2530. </para>
  2531. <section>
  2532. <title>name (string)</title>
  2533. <para>
  2534. Each logger in the system has a name, the name being that
  2535. of the component using it to log messages. For instance,
  2536. if you want to configure logging for the resolver module,
  2537. you add an entry for a logger named <quote>Resolver</quote>. This
  2538. configuration will then be used by the loggers in the
  2539. Resolver module, and all the libraries used by it.
  2540. </para>
  2541. <!-- TODO: later we will have a way to know names of all modules
  2542. Right now you can only see what their names are if they are running
  2543. (a simple 'help' without anything else in bindctl for instance).
  2544. -->
  2545. <para>
  2546. If you want to specify logging for one specific library
  2547. within the module, you set the name to
  2548. <replaceable>module.library</replaceable>. For example, the
  2549. logger used by the nameserver address store component
  2550. has the full name of <quote>Resolver.nsas</quote>. If
  2551. there is no entry in Logging for a particular library,
  2552. it will use the configuration given for the module.
  2553. <!-- TODO: how to know these specific names?
  2554. We will either have to document them or tell the administrator to
  2555. specify module-wide logging and see what appears...
  2556. -->
  2557. </para>
  2558. <para>
  2559. <!-- TODO: severity has not been covered yet -->
  2560. To illustrate this, suppose you want the cache library
  2561. to log messages of severity DEBUG, and the rest of the
  2562. resolver code to log messages of severity INFO. To achieve
  2563. this you specify two loggers, one with the name
  2564. <quote>Resolver</quote> and severity INFO, and one with
  2565. the name <quote>Resolver.cache</quote> with severity
  2566. DEBUG. As there are no entries for other libraries (e.g.
  2567. the nsas), they will use the configuration for the module
  2568. (<quote>Resolver</quote>), so giving the desired behavior.
  2569. </para>
  2570. <para>
  2571. One special case is that of a module name of <quote>*</quote>
  2572. (asterisks), which is interpreted as <emphasis>any</emphasis>
  2573. module. You can set global logging options by using this,
  2574. including setting the logging configuration for a library
  2575. that is used by multiple modules (e.g. <quote>*.config</quote>
  2576. specifies the configuration library code in whatever
  2577. module is using it).
  2578. </para>
  2579. <para>
  2580. If there are multiple logger specifications in the
  2581. configuration that might match a particular logger, the
  2582. specification with the more specific logger name takes
  2583. precedence. For example, if there are entries for for
  2584. both <quote>*</quote> and <quote>Resolver</quote>, the
  2585. resolver module &mdash; and all libraries it uses &mdash;
  2586. will log messages according to the configuration in the
  2587. second entry (<quote>Resolver</quote>). All other modules
  2588. will use the configuration of the first entry
  2589. (<quote>*</quote>). If there was also a configuration
  2590. entry for <quote>Resolver.cache</quote>, the cache library
  2591. within the resolver would use that in preference to the
  2592. entry for <quote>Resolver</quote>.
  2593. </para>
  2594. <para>
  2595. One final note about the naming. When specifying the
  2596. module name within a logger, use the name of the module
  2597. as specified in <command>bindctl</command>, e.g.
  2598. <quote>Resolver</quote> for the resolver module,
  2599. <quote>Xfrout</quote> for the xfrout module, etc. When
  2600. the message is logged, the message will include the name
  2601. of the logger generating the message, but with the module
  2602. name replaced by the name of the process implementing
  2603. the module (so for example, a message generated by the
  2604. <quote>Auth.cache</quote> logger will appear in the output
  2605. with a logger name of <quote>b10-auth.cache</quote>).
  2606. </para>
  2607. </section>
  2608. <section>
  2609. <title>severity (string)</title>
  2610. <para>
  2611. This specifies the category of messages logged.
  2612. Each message is logged with an associated severity which
  2613. may be one of the following (in descending order of
  2614. severity):
  2615. </para>
  2616. <itemizedlist>
  2617. <listitem>
  2618. <simpara> FATAL </simpara>
  2619. </listitem>
  2620. <listitem>
  2621. <simpara> ERROR </simpara>
  2622. </listitem>
  2623. <listitem>
  2624. <simpara> WARN </simpara>
  2625. </listitem>
  2626. <listitem>
  2627. <simpara> INFO </simpara>
  2628. </listitem>
  2629. <listitem>
  2630. <simpara> DEBUG </simpara>
  2631. </listitem>
  2632. </itemizedlist>
  2633. <para>
  2634. When the severity of a logger is set to one of these
  2635. values, it will only log messages of that severity, and
  2636. the severities above it. The severity may also be set to
  2637. NONE, in which case all messages from that logger are
  2638. inhibited.
  2639. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  2640. </para>
  2641. </section>
  2642. <section>
  2643. <title>output_options (list)</title>
  2644. <para>
  2645. Each logger can have zero or more
  2646. <option>output_options</option>. These specify where log
  2647. messages are sent to. These are explained in detail below.
  2648. </para>
  2649. <para>
  2650. The other options for a logger are:
  2651. </para>
  2652. </section>
  2653. <section>
  2654. <title>debuglevel (integer)</title>
  2655. <para>
  2656. When a logger's severity is set to DEBUG, this value
  2657. specifies what debug messages should be printed. It ranges
  2658. from 0 (least verbose) to 99 (most verbose).
  2659. </para>
  2660. <!-- TODO: complete this sentence:
  2661. The general classification of debug message types is
  2662. TODO; there's a ticket to determine these levels, see #1074
  2663. -->
  2664. <para>
  2665. If severity for the logger is not DEBUG, this value is ignored.
  2666. </para>
  2667. </section>
  2668. <section>
  2669. <title>additive (true or false)</title>
  2670. <para>
  2671. If this is true, the <option>output_options</option> from
  2672. the parent will be used. For example, if there are two
  2673. loggers configured; <quote>Resolver</quote> and
  2674. <quote>Resolver.cache</quote>, and <option>additive</option>
  2675. is true in the second, it will write the log messages
  2676. not only to the destinations specified for
  2677. <quote>Resolver.cache</quote>, but also to the destinations
  2678. as specified in the <option>output_options</option> in
  2679. the logger named <quote>Resolver</quote>.
  2680. <!-- TODO: check this -->
  2681. </para>
  2682. </section>
  2683. </section>
  2684. <section>
  2685. <title>Output Options</title>
  2686. <para>
  2687. The main settings for an output option are the
  2688. <option>destination</option> and a value called
  2689. <option>output</option>, the meaning of which depends on
  2690. the destination that is set.
  2691. </para>
  2692. <section>
  2693. <title>destination (string)</title>
  2694. <para>
  2695. The destination is the type of output. It can be one of:
  2696. </para>
  2697. <itemizedlist>
  2698. <listitem>
  2699. <simpara> console </simpara>
  2700. </listitem>
  2701. <listitem>
  2702. <simpara> file </simpara>
  2703. </listitem>
  2704. <listitem>
  2705. <simpara> syslog </simpara>
  2706. </listitem>
  2707. </itemizedlist>
  2708. </section>
  2709. <section>
  2710. <title>output (string)</title>
  2711. <para>
  2712. Depending on what is set as the output destination, this
  2713. value is interpreted as follows:
  2714. </para>
  2715. <variablelist>
  2716. <varlistentry>
  2717. <term><option>destination</option> is <quote>console</quote></term>
  2718. <listitem>
  2719. <para>
  2720. The value of output must be one of <quote>stdout</quote>
  2721. (messages printed to standard output) or
  2722. <quote>stderr</quote> (messages printed to standard
  2723. error).
  2724. </para>
  2725. <para>
  2726. Note: if output is set to <quote>stderr</quote> and a lot of
  2727. messages are produced in a short time (e.g. if the logging
  2728. level is set to DEBUG), you may occasionally see some messages
  2729. jumbled up together. This is due to a combination of the way
  2730. that messages are written to the screen and the unbuffered
  2731. nature of the standard error stream. If this occurs, it is
  2732. recommended that output be set to <quote>stdout</quote>.
  2733. </para>
  2734. </listitem>
  2735. </varlistentry>
  2736. <varlistentry>
  2737. <term><option>destination</option> is <quote>file</quote></term>
  2738. <listitem>
  2739. <para>
  2740. The value of output is interpreted as a file name;
  2741. log messages will be appended to this file.
  2742. </para>
  2743. </listitem>
  2744. </varlistentry>
  2745. <varlistentry>
  2746. <term><option>destination</option> is <quote>syslog</quote></term>
  2747. <listitem>
  2748. <para>
  2749. The value of output is interpreted as the
  2750. <command>syslog</command> facility (e.g.
  2751. <emphasis>local0</emphasis>) that should be used
  2752. for log messages.
  2753. </para>
  2754. </listitem>
  2755. </varlistentry>
  2756. </variablelist>
  2757. <para>
  2758. The other options for <option>output_options</option> are:
  2759. </para>
  2760. <section>
  2761. <title>flush (true of false)</title>
  2762. <para>
  2763. Flush buffers after each log message. Doing this will
  2764. reduce performance but will ensure that if the program
  2765. terminates abnormally, all messages up to the point of
  2766. termination are output.
  2767. </para>
  2768. </section>
  2769. <section>
  2770. <title>maxsize (integer)</title>
  2771. <para>
  2772. Only relevant when destination is file, this is maximum
  2773. file size of output files in bytes. When the maximum
  2774. size is reached, the file is renamed and a new file opened.
  2775. (For example, a ".1" is appended to the name &mdash;
  2776. if a ".1" file exists, it is renamed ".2",
  2777. etc.)
  2778. </para>
  2779. <para>
  2780. If this is 0, no maximum file size is used.
  2781. </para>
  2782. </section>
  2783. <section>
  2784. <title>maxver (integer)</title>
  2785. <para>
  2786. Maximum number of old log files to keep around when
  2787. rolling the output file. Only relevant when
  2788. <option>destination</option> is <quote>file</quote>.
  2789. </para>
  2790. </section>
  2791. </section>
  2792. </section>
  2793. <section>
  2794. <title>Example session</title>
  2795. <para>
  2796. In this example we want to set the global logging to
  2797. write to the file <filename>/var/log/my_bind10.log</filename>,
  2798. at severity WARN. We want the authoritative server to
  2799. log at DEBUG with debuglevel 40, to a different file
  2800. (<filename>/tmp/debug_messages</filename>).
  2801. </para>
  2802. <para>
  2803. Start <command>bindctl</command>.
  2804. </para>
  2805. <para>
  2806. <screen>["login success "]
  2807. &gt; <userinput>config show Logging</userinput>
  2808. Logging/loggers [] list
  2809. </screen>
  2810. </para>
  2811. <para>
  2812. By default, no specific loggers are configured, in which
  2813. case the severity defaults to INFO and the output is
  2814. written to stderr.
  2815. </para>
  2816. <para>
  2817. Let's first add a default logger:
  2818. </para>
  2819. <!-- TODO: adding the empty loggers makes no sense -->
  2820. <para>
  2821. <screen><userinput>&gt; config add Logging/loggers</userinput>
  2822. &gt; <userinput>config show Logging</userinput>
  2823. Logging/loggers/ list (modified)
  2824. </screen>
  2825. </para>
  2826. <para>
  2827. The loggers value line changed to indicate that it is no
  2828. longer an empty list:
  2829. </para>
  2830. <para>
  2831. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  2832. Logging/loggers[0]/name "" string (default)
  2833. Logging/loggers[0]/severity "INFO" string (default)
  2834. Logging/loggers[0]/debuglevel 0 integer (default)
  2835. Logging/loggers[0]/additive false boolean (default)
  2836. Logging/loggers[0]/output_options [] list (default)
  2837. </screen>
  2838. </para>
  2839. <para>
  2840. The name is mandatory, so we must set it. We will also
  2841. change the severity as well. Let's start with the global
  2842. logger.
  2843. </para>
  2844. <para>
  2845. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  2846. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  2847. &gt; <userinput>config show Logging/loggers</userinput>
  2848. Logging/loggers[0]/name "*" string (modified)
  2849. Logging/loggers[0]/severity "WARN" string (modified)
  2850. Logging/loggers[0]/debuglevel 0 integer (default)
  2851. Logging/loggers[0]/additive false boolean (default)
  2852. Logging/loggers[0]/output_options [] list (default)
  2853. </screen>
  2854. </para>
  2855. <para>
  2856. Of course, we need to specify where we want the log
  2857. messages to go, so we add an entry for an output option.
  2858. </para>
  2859. <para>
  2860. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  2861. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  2862. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  2863. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  2864. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  2865. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  2866. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  2867. </screen>
  2868. </para>
  2869. <para>
  2870. These aren't the values we are looking for.
  2871. </para>
  2872. <para>
  2873. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  2874. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  2875. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  2876. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  2877. </screen>
  2878. </para>
  2879. <para>
  2880. Which would make the entire configuration for this logger
  2881. look like:
  2882. </para>
  2883. <para>
  2884. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  2885. Logging/loggers[0]/name "*" string (modified)
  2886. Logging/loggers[0]/severity "WARN" string (modified)
  2887. Logging/loggers[0]/debuglevel 0 integer (default)
  2888. Logging/loggers[0]/additive false boolean (default)
  2889. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  2890. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  2891. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  2892. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  2893. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  2894. </screen>
  2895. </para>
  2896. <para>
  2897. That looks OK, so let's commit it before we add the
  2898. configuration for the authoritative server's logger.
  2899. </para>
  2900. <para>
  2901. <screen>&gt; <userinput> config commit</userinput></screen>
  2902. </para>
  2903. <para>
  2904. Now that we have set it, and checked each value along
  2905. the way, adding a second entry is quite similar.
  2906. </para>
  2907. <para>
  2908. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  2909. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  2910. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  2911. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  2912. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  2913. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  2914. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  2915. &gt; <userinput> config commit</userinput>
  2916. </screen>
  2917. </para>
  2918. <para>
  2919. And that's it. Once we have found whatever it was we
  2920. needed the debug messages for, we can simply remove the
  2921. second logger to let the authoritative server use the
  2922. same settings as the rest.
  2923. </para>
  2924. <para>
  2925. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  2926. &gt; <userinput> config commit</userinput>
  2927. </screen>
  2928. </para>
  2929. <para>
  2930. And every module will now be using the values from the
  2931. logger named <quote>*</quote>.
  2932. </para>
  2933. </section>
  2934. </section>
  2935. <section>
  2936. <title>Logging Message Format</title>
  2937. <para>
  2938. Each message written by BIND 10 to the configured logging
  2939. destinations comprises a number of components that identify
  2940. the origin of the message and, if the message indicates
  2941. a problem, information about the problem that may be
  2942. useful in fixing it.
  2943. </para>
  2944. <para>
  2945. Consider the message below logged to a file:
  2946. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  2947. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  2948. </para>
  2949. <para>
  2950. Note: the layout of messages written to the system logging
  2951. file (syslog) may be slightly different. This message has
  2952. been split across two lines here for display reasons; in the
  2953. logging file, it will appear on one line.)
  2954. </para>
  2955. <para>
  2956. The log message comprises a number of components:
  2957. <variablelist>
  2958. <varlistentry>
  2959. <term>2011-06-15 13:48:22.034</term>
  2960. <!-- TODO: timestamp repeated even if using syslog? -->
  2961. <listitem><para>
  2962. The date and time at which the message was generated.
  2963. </para></listitem>
  2964. </varlistentry>
  2965. <varlistentry>
  2966. <term>ERROR</term>
  2967. <listitem><para>
  2968. The severity of the message.
  2969. </para></listitem>
  2970. </varlistentry>
  2971. <varlistentry>
  2972. <term>[b10-resolver.asiolink]</term>
  2973. <listitem><para>
  2974. The source of the message. This comprises two components:
  2975. the BIND 10 process generating the message (in this
  2976. case, <command>b10-resolver</command>) and the module
  2977. within the program from which the message originated
  2978. (which in the example is the asynchronous I/O link
  2979. module, asiolink).
  2980. </para></listitem>
  2981. </varlistentry>
  2982. <varlistentry>
  2983. <term>ASIODNS_OPENSOCK</term>
  2984. <listitem><para>
  2985. The message identification. Every message in BIND 10
  2986. has a unique identification, which can be used as an
  2987. index into the <ulink
  2988. url="bind10-messages.html"><citetitle>BIND 10 Messages
  2989. Manual</citetitle></ulink> (<ulink
  2990. url="http://bind10.isc.org/docs/bind10-messages.html"
  2991. />) from which more information can be obtained.
  2992. </para></listitem>
  2993. </varlistentry>
  2994. <varlistentry>
  2995. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  2996. <listitem><para>
  2997. A brief description of the cause of the problem.
  2998. Within this text, information relating to the condition
  2999. that caused the message to be logged will be included.
  3000. In this example, error number 111 (an operating
  3001. system-specific error number) was encountered when
  3002. trying to open a TCP connection to port 53 on the
  3003. local system (address 127.0.0.1). The next step
  3004. would be to find out the reason for the failure by
  3005. consulting your system's documentation to identify
  3006. what error number 111 means.
  3007. </para></listitem>
  3008. </varlistentry>
  3009. </variablelist>
  3010. </para>
  3011. </section>
  3012. </chapter>
  3013. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  3014. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  3015. <!-- <index> <title>Index</title> </index> -->
  3016. </book>
  3017. <!--
  3018. TODO:
  3019. Overview
  3020. Getting BIND 10 Installed
  3021. Basics
  3022. Dependencies
  3023. Optional
  3024. Advanced
  3025. How Does Everything Work Together?
  3026. Need Help?
  3027. -->