bind10-guide.xml 103 KB

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