bind10-guide.xml 127 KB

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