bind10-guide.xml 113 KB

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