bind10-guide.xml 113 KB

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