bind10-guide.xml 127 KB

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