bind10-guide.xml 109 KB

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