bind10-guide.xml 103 KB

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