bind10-guide.xml 104 KB

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