bind10-guide.xml 126 KB

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