bind10-guide.xml 127 KB

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