bind10-guide.xml 174 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2014;" >
  5. <!ENTITY % version SYSTEM "version.ent">
  6. %version;
  7. ]>
  8. <!--
  9. - Copyright (C) 2010-2012 Internet Systems Consortium, Inc. ("ISC")
  10. -
  11. - Permission to use, copy, modify, and/or distribute this software for any
  12. - purpose with or without fee is hereby granted, provided that the above
  13. - copyright notice and this permission notice appear in all copies.
  14. -
  15. - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  16. - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  17. - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  18. - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  19. - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  20. - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21. - PERFORMANCE OF THIS SOFTWARE.
  22. -->
  23. <book>
  24. <?xml-stylesheet href="bind10-guide.css" type="text/css"?>
  25. <bookinfo>
  26. <title>BIND 10 Guide</title>
  27. <subtitle>Administrator Reference for BIND 10</subtitle>
  28. <copyright>
  29. <year>2010-2012</year><holder>Internet Systems Consortium, Inc.</holder>
  30. </copyright>
  31. <abstract>
  32. <para>BIND 10 is a framework that features Domain Name System
  33. (DNS) suite and Dynamic Host Configuration Protocol (DHCP)
  34. servers with development managed by Internet Systems Consortium (ISC).
  35. It includes DNS libraries, modular components for controlling
  36. authoritative and recursive DNS servers, and experimental DHCPv4
  37. and DHCPv6 servers.
  38. </para>
  39. <para>
  40. This is the reference guide for BIND 10 version &__VERSION__;.
  41. The most up-to-date version of this document (in PDF, HTML,
  42. and plain text formats), along with other documents for
  43. BIND 10, can be found at <ulink url="http://bind10.isc.org/docs"/>.
  44. </para> </abstract>
  45. <releaseinfo>This is the reference guide for BIND 10 version
  46. &__VERSION__;.</releaseinfo>
  47. </bookinfo>
  48. <preface>
  49. <title>Preface</title>
  50. <section id="acknowledgements">
  51. <title>Acknowledgements</title>
  52. <!-- TODO: acknowledge all sponsors and CNNIC and CZNIC too -->
  53. <para>ISC would like to acknowledge generous support for
  54. BIND 10 development of DHCPv4 and DHCPv6 components provided
  55. by <ulink url="http://www.comcast.com/">Comcast</ulink>.</para>
  56. </section>
  57. </preface>
  58. <chapter id="intro">
  59. <title>Introduction</title>
  60. <para>
  61. BIND is the popular implementation of a DNS server, developer
  62. interfaces, and DNS tools.
  63. BIND 10 is a rewrite of BIND 9 and ISC DHCP.
  64. BIND 10 is written in C++ and Python and provides a modular
  65. environment for serving, maintaining, and developing DNS and DHCP.
  66. BIND 10 provides a EDNS0- and DNSSEC-capable authoritative
  67. DNS server and a caching recursive name server which also
  68. provides forwarding.
  69. It also provides experimental DHCPv4 and DHCPv6 servers.
  70. </para>
  71. <para>
  72. This guide covers BIND 10 version &__VERSION__;.
  73. </para>
  74. <section>
  75. <title>Supported Platforms</title>
  76. <para>
  77. BIND 10 builds have been tested on (in no particular order)
  78. Debian GNU/Linux 6 and unstable, Ubuntu 9.10, NetBSD 5,
  79. Solaris 10 and 11, FreeBSD 7 and 8, CentOS Linux 5.3,
  80. MacOS 10.6 and 10.7, and OpenBSD 5.1.
  81. It has been tested on Sparc, i386, and amd64 hardware
  82. platforms.
  83. It is planned for BIND 10 to build, install and run on
  84. Windows and standard Unix-type platforms.
  85. </para>
  86. </section>
  87. <section id="required-software">
  88. <title>Required Software at Run-time</title>
  89. <para>
  90. Running BIND 10 uses various extra software which may
  91. not be provided in some operating systems' default
  92. installations nor standard packages collections. You may
  93. need to install this required software separately.
  94. (For the build requirements, also see
  95. <xref linkend="build-requirements"/>.)
  96. </para>
  97. <para>
  98. BIND 10 requires at least Python 3.1
  99. (<ulink url="http://www.python.org/"/>).
  100. It also works with Python 3.2.
  101. </para>
  102. <para>
  103. BIND 10 uses the Botan crypto library for C++
  104. (<ulink url="http://botan.randombit.net/"/>).
  105. It requires at least Botan version 1.8.
  106. </para>
  107. <para>
  108. BIND 10 uses the log4cplus C++ logging library
  109. (<ulink url="http://log4cplus.sourceforge.net/"/>).
  110. It requires at least log4cplus version 1.0.3.
  111. <!-- TODO: It is recommended to use at least version .... -->
  112. </para>
  113. <para>
  114. The authoritative DNS server uses SQLite3
  115. (<ulink url="http://www.sqlite.org/"/>).
  116. <!-- TODO: is this still required? -->
  117. It needs at least SQLite version 3.3.9.
  118. </para>
  119. <para>
  120. The <command>b10-ddns</command>, <command>b10-xfrin</command>,
  121. <command>b10-xfrout</command>, and <command>b10-zonemgr</command>
  122. components require the libpython3 library and the Python
  123. _sqlite3.so module (which is included with Python).
  124. Python modules need to be built for the corresponding Python 3.
  125. </para>
  126. <!-- TODO: this will change ... -->
  127. </section>
  128. <section id="starting_stopping">
  129. <title>Starting and Stopping the Server</title>
  130. <para>
  131. BIND 10 is modular. Part of this modularity is
  132. accomplished using multiple cooperating processes which, together,
  133. provide the server functionality. This is a change from
  134. the previous generation of BIND software, which used a
  135. single process.
  136. </para>
  137. <para>
  138. At first, running many different processes may seem confusing.
  139. However, these processes are started, stopped, and maintained
  140. by a single command, <command>bind10</command>.
  141. This command starts a master process which will start other
  142. required processes and other processes when configured.
  143. The processes that may be started by the <command>bind10</command>
  144. command have names starting with "b10-", including:
  145. </para>
  146. <para>
  147. <itemizedlist>
  148. <listitem>
  149. <simpara>
  150. <command>b10-auth</command> &mdash;
  151. Authoritative DNS server.
  152. This process serves DNS requests.
  153. </simpara>
  154. </listitem>
  155. <listitem>
  156. <simpara>
  157. <command>b10-cfgmgr</command> &mdash;
  158. Configuration manager.
  159. This process maintains all of the configuration for BIND 10.
  160. </simpara>
  161. </listitem>
  162. <listitem>
  163. <simpara>
  164. <command>b10-cmdctl</command> &mdash;
  165. Command and control service.
  166. This process allows external control of the BIND 10 system.
  167. </simpara>
  168. </listitem>
  169. <listitem>
  170. <simpara>
  171. <command>b10-ddns</command> &mdash;
  172. Dynamic DNS update service.
  173. This process is used to handle incoming DNS update
  174. requests to allow granted clients to update zones
  175. for which BIND 10 is serving as a primary server.
  176. </simpara>
  177. </listitem>
  178. <listitem>
  179. <simpara>
  180. <command>b10-msgq</command> &mdash;
  181. Message bus daemon.
  182. This process coordinates communication between all of the other
  183. BIND 10 processes.
  184. </simpara>
  185. </listitem>
  186. <listitem>
  187. <simpara>
  188. <command>b10-resolver</command> &mdash;
  189. Recursive name server.
  190. This process handles incoming DNS queries and provides
  191. answers from its cache or by recursively doing remote lookups.
  192. </simpara>
  193. </listitem>
  194. <listitem>
  195. <simpara>
  196. <command>b10-sockcreator</command> &mdash;
  197. Socket creator daemon.
  198. This process creates sockets used by
  199. network-listening BIND 10 processes.
  200. </simpara>
  201. </listitem>
  202. <listitem>
  203. <simpara>
  204. <command>b10-stats</command> &mdash;
  205. Statistics collection daemon.
  206. This process collects and reports statistics data.
  207. </simpara>
  208. </listitem>
  209. <listitem>
  210. <simpara>
  211. <command>b10-stats-httpd</command> &mdash;
  212. HTTP server for statistics reporting.
  213. This process reports statistics data in XML format over HTTP.
  214. </simpara>
  215. </listitem>
  216. <listitem>
  217. <simpara>
  218. <command>b10-xfrin</command> &mdash;
  219. Incoming zone transfer service.
  220. This process is used to transfer a new copy
  221. of a zone into BIND 10, when acting as a secondary server.
  222. </simpara>
  223. </listitem>
  224. <listitem>
  225. <simpara>
  226. <command>b10-xfrout</command> &mdash;
  227. Outgoing zone transfer service.
  228. This process is used to handle transfer requests to
  229. send a local zone to a remote secondary server.
  230. </simpara>
  231. </listitem>
  232. <listitem>
  233. <simpara>
  234. <command>b10-zonemgr</command> &mdash;
  235. Secondary zone manager.
  236. This process keeps track of timers and other
  237. necessary information for BIND 10 to act as a slave server.
  238. </simpara>
  239. </listitem>
  240. </itemizedlist>
  241. </para>
  242. <para>
  243. These do not need to be manually started independently.
  244. </para>
  245. </section>
  246. <section id="managing_once_running">
  247. <title>Managing BIND 10</title>
  248. <para>
  249. Once BIND 10 is running, a few commands are used to interact
  250. directly with the system:
  251. <itemizedlist>
  252. <listitem>
  253. <simpara>
  254. <command>bindctl</command> &mdash;
  255. Interactive administration interface.
  256. This is a low-level command-line tool which allows
  257. a developer or an experienced administrator to control
  258. BIND 10.
  259. </simpara>
  260. </listitem>
  261. <listitem>
  262. <simpara>
  263. <command>b10-loadzone</command> &mdash;
  264. Zone file loader.
  265. This tool will load standard masterfile-format zone files into
  266. BIND 10.
  267. </simpara>
  268. </listitem>
  269. <listitem>
  270. <simpara>
  271. <command>b10-cmdctl-usermgr</command> &mdash;
  272. User access control.
  273. This tool allows an administrator to authorize additional users
  274. to manage BIND 10.
  275. </simpara>
  276. </listitem>
  277. <!-- TODO usermgr -->
  278. </itemizedlist>
  279. </para>
  280. </section>
  281. <para>
  282. The tools and modules are covered in full detail in this guide.
  283. <!-- TODO point to these -->
  284. In addition, manual pages are also provided in the default installation.
  285. </para>
  286. <!--
  287. bin/
  288. bindctl*
  289. host*
  290. lib/
  291. libauth
  292. libdns
  293. libexceptions
  294. python3.1/site-packages/isc/{cc,config}
  295. sbin/
  296. bind10
  297. share/
  298. share/bind10/
  299. auth.spec
  300. b10-cmdctl.pem
  301. bob.spec
  302. passwd.csv
  303. man/
  304. var/
  305. bind10/b10-config.db
  306. -->
  307. <para>
  308. BIND 10 also provides libraries and programmer interfaces
  309. for C++ and Python for the message bus, configuration backend,
  310. and, of course, DNS. These include detailed developer
  311. documentation and code examples.
  312. <!-- TODO: DHCP also but no Python yet. -->
  313. <!-- TODO point to this -->
  314. </para>
  315. </chapter>
  316. <chapter id="quickstart">
  317. <title>Quick start</title>
  318. <para>
  319. This quickly covers the standard steps for installing
  320. and deploying BIND 10.
  321. For further details, full customizations, and troubleshooting,
  322. see the respective chapters in the BIND 10 guide.
  323. </para>
  324. <section id="quick-start-auth-dns">
  325. <title>Quick start guide for authoritative DNS service</title>
  326. <orderedlist>
  327. <listitem>
  328. <simpara>
  329. Install required run-time and build dependencies.
  330. </simpara>
  331. </listitem>
  332. <listitem>
  333. <simpara>
  334. Download the BIND 10 source tar file from
  335. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  336. </simpara>
  337. </listitem>
  338. <listitem>
  339. <para>Extract the tar file:
  340. <screen>$ <userinput>gzcat bind10-<replaceable>VERSION</replaceable>.tar.gz | tar -xvf -</userinput></screen>
  341. </para>
  342. </listitem>
  343. <listitem>
  344. <para>Go into the source and run configure:
  345. <screen>$ <userinput>cd bind10-<replaceable>VERSION</replaceable></userinput>
  346. $ <userinput>./configure</userinput></screen>
  347. </para>
  348. </listitem>
  349. <listitem>
  350. <para>Build it:
  351. <screen>$ <userinput>make</userinput></screen>
  352. </para>
  353. </listitem>
  354. <listitem>
  355. <para>Install it as root (to default /usr/local):
  356. <screen>$ <userinput>make install</userinput></screen>
  357. </para>
  358. </listitem>
  359. <listitem>
  360. <para>Start the server (as root):
  361. <screen>$ <userinput>/usr/local/sbin/bind10</userinput></screen>
  362. </para>
  363. </listitem>
  364. <listitem>
  365. <para>In another console, enable the authoritative DNS service
  366. (by using the <command>bindctl</command> utility to configure
  367. the <command>b10-auth</command> component to run):
  368. <screen>$ <userinput>bindctl</userinput></screen>
  369. (Login with the provided default username and password.)
  370. <screen>
  371. &gt; <userinput>config add Boss/components b10-auth</userinput>
  372. &gt; <userinput>config set Boss/components/b10-auth/special auth</userinput>
  373. &gt; <userinput>config set Boss/components/b10-auth/kind needed</userinput>
  374. &gt; <userinput>config commit</userinput>
  375. &gt; <userinput>quit</userinput>
  376. </screen>
  377. </para>
  378. </listitem>
  379. <listitem>
  380. <para>Test it; for example:
  381. <screen>$ <userinput>dig @127.0.0.1 -c CH -t TXT version.bind</userinput></screen>
  382. </para>
  383. </listitem>
  384. <listitem>
  385. <para>Load desired zone file(s), for example:
  386. <screen>$ <userinput>b10-loadzone <replaceable>your.zone.example.org</replaceable></userinput></screen>
  387. </para>
  388. </listitem>
  389. <listitem>
  390. <simpara>
  391. Test the new zone.
  392. </simpara>
  393. </listitem>
  394. </orderedlist>
  395. </section>
  396. </chapter>
  397. <chapter id="installation">
  398. <title>Installation</title>
  399. <section id="packages">
  400. <title>Packages</title>
  401. <para>
  402. Some operating systems or softare package vendors may
  403. provide ready-to-use, pre-built software packages for
  404. the BIND 10 suite.
  405. Installing a pre-built package means you do not need to
  406. install build-only prerequisites and do not need to
  407. <emphasis>make</emphasis> the software.
  408. </para>
  409. <para>
  410. FreeBSD ports, NetBSD pkgsrc, and Debian
  411. <emphasis>testing</emphasis> package collections provide
  412. all the prerequisite packages.
  413. </para>
  414. </section>
  415. <section id="install-hierarchy">
  416. <title>Install Hierarchy</title>
  417. <para>
  418. The following is the standard, common layout of the
  419. complete BIND 10 installation:
  420. <itemizedlist>
  421. <listitem>
  422. <simpara>
  423. <filename>bin/</filename> &mdash;
  424. general tools and diagnostic clients.
  425. </simpara>
  426. </listitem>
  427. <listitem>
  428. <simpara>
  429. <filename>etc/bind10-devel/</filename> &mdash;
  430. configuration files.
  431. </simpara>
  432. </listitem>
  433. <listitem>
  434. <simpara>
  435. <filename>lib/</filename> &mdash;
  436. libraries and python modules.
  437. </simpara>
  438. </listitem>
  439. <listitem>
  440. <simpara>
  441. <filename>libexec/bind10-devel/</filename> &mdash;
  442. executables that a user wouldn't normally run directly and
  443. are not run independently.
  444. These are the BIND 10 modules which are daemons started by
  445. the <command>bind10</command> tool.
  446. </simpara>
  447. </listitem>
  448. <listitem>
  449. <simpara>
  450. <filename>sbin/</filename> &mdash;
  451. commands used by the system administrator.
  452. </simpara>
  453. </listitem>
  454. <listitem>
  455. <simpara>
  456. <filename>share/bind10-devel/</filename> &mdash;
  457. configuration specifications.
  458. </simpara>
  459. </listitem>
  460. <listitem>
  461. <simpara>
  462. <filename>share/doc/bind10-devel/</filename> &mdash;
  463. this guide and other supplementary documentation.
  464. </simpara>
  465. </listitem>
  466. <listitem>
  467. <simpara>
  468. <filename>share/man/</filename> &mdash;
  469. manual pages (online documentation).
  470. </simpara>
  471. </listitem>
  472. <listitem>
  473. <simpara>
  474. <filename>var/bind10-devel/</filename> &mdash;
  475. data source and configuration databases.
  476. </simpara>
  477. </listitem>
  478. </itemizedlist>
  479. </para>
  480. </section>
  481. <section id="build-requirements">
  482. <title>Building Requirements</title>
  483. <para>
  484. In addition to the run-time requirements (listed in
  485. <xref linkend="required-software"/>), building BIND 10
  486. from source code requires various development include headers and
  487. program development tools.
  488. </para>
  489. <note>
  490. <simpara>
  491. Some operating systems have split their distribution packages into
  492. a run-time and a development package. You will need to install
  493. the development package versions, which include header files and
  494. libraries, to build BIND 10 from source code.
  495. </simpara>
  496. </note>
  497. <para>
  498. Building from source code requires the Boost
  499. build-time headers
  500. (<ulink url="http://www.boost.org/"/>).
  501. At least Boost version 1.35 is required.
  502. <!-- TODO: we don't check for this version -->
  503. <!-- NOTE: jreed has tested with 1.34, 1.38, and 1.41. -->
  504. </para>
  505. <para>
  506. To build BIND 10, also install the Botan (at least version
  507. 1.8) and the log4cplus (at least version 1.0.3)
  508. development include headers.
  509. </para>
  510. <!--
  511. TODO
  512. Debian and Ubuntu:
  513. libgmp3-dev and libbz2-dev required for botan too
  514. -->
  515. <!-- NOTE: _sqlite3 is only needed at test time; it is already listed
  516. as a dependency earlier -->
  517. <para>
  518. Building BIND 10 also requires a C++ compiler and
  519. standard development headers, make, and pkg-config.
  520. BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
  521. 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10.
  522. </para>
  523. <para>
  524. Visit the user-contributed wiki at <ulink
  525. url="http://bind10.isc.org/wiki/SystemSpecificNotes" />
  526. for system-specific installation tips.
  527. </para>
  528. </section>
  529. <section id="install">
  530. <title>Installation from source</title>
  531. <para>
  532. BIND 10 is open source software written in C++ and Python.
  533. It is freely available in source code form from ISC as a
  534. downloadable tar file or via BIND 10's Git code revision control
  535. service. (It may also be available in pre-compiled ready-to-use
  536. packages from operating system vendors.)
  537. </para>
  538. <section>
  539. <title>Download Tar File</title>
  540. <para>
  541. Downloading a release tar file is the recommended method to
  542. obtain the source code.
  543. </para>
  544. <para>
  545. The BIND 10 releases are available as tar file downloads from
  546. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  547. Periodic development snapshots may also be available.
  548. </para>
  549. <!-- TODO -->
  550. </section>
  551. <section>
  552. <title>Retrieve from Git</title>
  553. <para>
  554. Downloading this "bleeding edge" code is recommended only for
  555. developers or advanced users. Using development code in a production
  556. environment is not recommended.
  557. </para>
  558. <note>
  559. <para>
  560. When using source code retrieved via Git, additional
  561. software will be required: automake (v1.11 or newer),
  562. libtoolize, and autoconf (2.59 or newer).
  563. These may need to be installed.
  564. </para>
  565. </note>
  566. <para>
  567. The latest development code (and temporary experiments
  568. and un-reviewed code) is available via the BIND 10 code revision
  569. control system. This is powered by Git and all the BIND 10
  570. development is public.
  571. The leading development is done in the <quote>master</quote>
  572. branch.
  573. </para>
  574. <para>
  575. The code can be checked out from
  576. <filename>git://git.bind10.isc.org/bind10</filename>;
  577. for example:
  578. <screen>$ <userinput>git clone git://git.bind10.isc.org/bind10</userinput></screen>
  579. </para>
  580. <para>
  581. When checking out the code from
  582. the code version control system, it doesn't include the
  583. generated configure script, Makefile.in files, nor their
  584. related build files.
  585. They can be created by running <command>autoreconf</command>
  586. with the <option>--install</option> switch.
  587. This will run <command>autoconf</command>,
  588. <command>aclocal</command>,
  589. <command>libtoolize</command>,
  590. <command>autoheader</command>,
  591. <command>automake</command>,
  592. and related commands.
  593. </para>
  594. </section>
  595. <section id="configure">
  596. <title>Configure before the build</title>
  597. <para>
  598. BIND 10 uses the GNU Build System to discover build environment
  599. details.
  600. To generate the makefiles using the defaults, simply run:
  601. <screen>$ <userinput>./configure</userinput></screen>
  602. </para>
  603. <para>
  604. Run <command>./configure</command> with the <option>--help</option>
  605. switch to view the different options. Some commonly-used options are:
  606. <variablelist>
  607. <varlistentry>
  608. <term>--prefix</term>
  609. <listitem>
  610. <simpara>Define the installation location (the
  611. default is <filename>/usr/local/</filename>).
  612. </simpara>
  613. </listitem>
  614. </varlistentry>
  615. <varlistentry>
  616. <term>--with-boost-include</term>
  617. <listitem>
  618. <simpara>Define the path to find the Boost headers.
  619. </simpara>
  620. </listitem>
  621. </varlistentry>
  622. <varlistentry>
  623. <term>--with-pythonpath</term>
  624. <listitem>
  625. <simpara>Define the path to Python 3.1 if it is not in the
  626. standard execution path.
  627. </simpara>
  628. </listitem>
  629. </varlistentry>
  630. <varlistentry>
  631. <term>--with-gtest</term>
  632. <listitem>
  633. <simpara>Enable building the C++ Unit Tests using the
  634. Google Tests framework. Optionally this can define the
  635. path to the gtest header files and library.
  636. </simpara>
  637. </listitem>
  638. </varlistentry>
  639. </variablelist>
  640. </para>
  641. <!-- TODO: lcov -->
  642. <para>
  643. For example, the following configures it to
  644. find the Boost headers, find the
  645. Python interpreter, and sets the installation location:
  646. <screen>$ <userinput>./configure \
  647. --with-boost-include=/usr/pkg/include \
  648. --with-pythonpath=/usr/pkg/bin/python3.1 \
  649. --prefix=/opt/bind10</userinput></screen>
  650. </para>
  651. <para>
  652. If the configure fails, it may be due to missing or old
  653. dependencies.
  654. </para>
  655. <note>
  656. <para>For notes on configuring and building DHCPv6 with MySQL see <xref linkend="dhcp6-install">.</xref></para>
  657. </note>
  658. </section>
  659. <section>
  660. <title>Build</title>
  661. <para>
  662. After the configure step is complete, to build the executables
  663. from the C++ code and prepare the Python scripts, run:
  664. <screen>$ <userinput>make</userinput></screen>
  665. </para>
  666. </section>
  667. <section>
  668. <title>Install</title>
  669. <para>
  670. To install the BIND 10 executables, support files,
  671. and documentation, run:
  672. <screen>$ <userinput>make install</userinput></screen>
  673. </para>
  674. <note>
  675. <para>The install step may require superuser privileges.</para>
  676. </note>
  677. </section>
  678. <!-- TODO: tests -->
  679. </section>
  680. <!--
  681. <section id="install.troubleshooting">
  682. <title>Troubleshooting</title>
  683. <para>
  684. </para>
  685. </section>
  686. -->
  687. </chapter>
  688. <chapter id="bind10">
  689. <title>Starting BIND 10 with <command>bind10</command></title>
  690. <para>
  691. BIND 10 provides the <command>bind10</command> command which
  692. starts up the required processes.
  693. <command>bind10</command>
  694. will also restart some processes that exit unexpectedly.
  695. This is the only command needed to start the BIND 10 system.
  696. </para>
  697. <para>
  698. After starting the <command>b10-msgq</command> communications channel,
  699. <command>bind10</command> connects to it,
  700. runs the configuration manager, and reads its own configuration.
  701. Then it starts the other modules.
  702. </para>
  703. <para>
  704. The <command>b10-sockcreator</command>, <command>b10-msgq</command> and
  705. <command>b10-cfgmgr</command>
  706. services make up the core. The <command>b10-msgq</command> daemon
  707. provides the communication channel between every part of the system.
  708. The <command>b10-cfgmgr</command> daemon is always needed by every
  709. module, if only to send information about themselves somewhere,
  710. but more importantly to ask about their own settings, and
  711. about other modules. The <command>b10-sockcreator</command> daemon
  712. helps allocate Internet addresses and ports as needed for BIND 10
  713. network services.
  714. </para>
  715. <para>
  716. In its default configuration, the <command>bind10</command>
  717. master process will also start up
  718. <command>b10-cmdctl</command> for administration tools to
  719. communicate with the system, and
  720. <command>b10-stats</command> for statistics collection.
  721. The DNS and DHCP servers are not started by default.
  722. The configuration of components to start is covered in
  723. <xref linkend="bind10.components"/>.
  724. </para>
  725. <section id="start">
  726. <title>Starting BIND 10</title>
  727. <para>
  728. To start the BIND 10 service, simply run <command>bind10</command>
  729. as root.
  730. It will run in the foreground and your shell prompt will not
  731. be available. It will output various log messages as it starts up
  732. and is used.
  733. Run it with the <option>--verbose</option> switch to
  734. get additional debugging or diagnostic output.
  735. </para>
  736. <!-- TODO: user switch -->
  737. <!-- TODO: example: nohup /usr/local/sbin/bind10 1>bind10.log 2>&1 -->
  738. <note>
  739. <para>
  740. If the setproctitle Python module is detected at start up,
  741. the process names for the Python-based daemons will be renamed
  742. to better identify them instead of just <quote>python</quote>.
  743. This is not needed on some operating systems.
  744. </para>
  745. </note>
  746. </section>
  747. </chapter>
  748. <chapter id="msgq">
  749. <title>Command channel</title>
  750. <para>
  751. The BIND 10 components use the <command>b10-msgq</command>
  752. message routing daemon to communicate with other BIND 10 components.
  753. The <command>b10-msgq</command> implements what is called the
  754. <quote>Command Channel</quote>.
  755. Processes intercommunicate by sending messages on the command
  756. channel.
  757. Example messages include shutdown, get configurations, and set
  758. configurations.
  759. This Command Channel is not used for DNS message passing.
  760. It is used only to control and monitor the BIND 10 system.
  761. </para>
  762. <para>
  763. Administrators do not communicate directly with the
  764. <command>b10-msgq</command> daemon.
  765. By default, BIND 10 uses a UNIX domain socket file named
  766. <filename>/usr/local/var/bind10-devel/msg_socket</filename>
  767. for this interprocess communication.
  768. </para>
  769. </chapter>
  770. <chapter id="cfgmgr">
  771. <title>Configuration manager</title>
  772. <para>
  773. The configuration manager, <command>b10-cfgmgr</command>,
  774. handles all BIND 10 system configuration. It provides
  775. persistent storage for configuration, and notifies running
  776. modules of configuration changes.
  777. </para>
  778. <para>
  779. The <command>b10-auth</command> and <command>b10-xfrin</command>
  780. daemons and other components receive their configurations
  781. from the configuration manager over the <command>b10-msgq</command>
  782. command channel.
  783. </para>
  784. <para>The administrator doesn't connect to it directly, but
  785. uses a user interface to communicate with the configuration
  786. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  787. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  788. </para>
  789. <!-- TODO -->
  790. <note>
  791. <para>
  792. The current release only provides
  793. <command>bindctl</command> as a user interface to
  794. <command>b10-cmdctl</command>.
  795. Upcoming releases will provide another interactive command-line
  796. interface and a web-based interface.
  797. </para>
  798. </note>
  799. <para>
  800. The <command>b10-cfgmgr</command> daemon can send all
  801. specifications and all current settings to the
  802. <command>bindctl</command> client (via
  803. <command>b10-cmdctl</command>).
  804. <command>b10-cfgmgr</command> relays configurations received
  805. from <command>b10-cmdctl</command> to the appropriate modules.
  806. </para>
  807. <!-- TODO:
  808. Configuration settings for itself are defined as ConfigManager.
  809. TODO: show examples
  810. -->
  811. <!-- TODO:
  812. config changes are actually commands to cfgmgr
  813. -->
  814. <!-- TODO: what about run time config to change this? -->
  815. <!-- jelte: > config set cfgmgr/config_database <file> -->
  816. <!-- TODO: what about command line switch to change this? -->
  817. <para>
  818. The stored configuration file is at
  819. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  820. (The directory is what was defined at build configure time for
  821. <option>--localstatedir</option>.
  822. The default is <filename>/usr/local/var/</filename>.)
  823. The format is loosely based on JSON and is directly parseable
  824. python, but this may change in a future version.
  825. This configuration data file is not manually edited by the
  826. administrator.
  827. </para>
  828. <!--
  829. Well the specfiles have a more fixed format (they must contain specific
  830. stuff), but those are also directly parseable python structures (and
  831. 'coincidentally', our data::element string representation is the same)
  832. loosely based on json, tweaked to be directly parseable in python, but a
  833. subset of that.
  834. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  835. nope, spec files are written by module developers, and db should be done
  836. through bindctl and friends
  837. -->
  838. <para>
  839. The configuration manager does not have any command line arguments.
  840. Normally it is not started manually, but is automatically
  841. started using the <command>bind10</command> master process
  842. (as covered in <xref linkend="bind10"/>).
  843. </para>
  844. <!-- TODO: upcoming plans:
  845. configuration for configuration manager itself. And perhaps we might
  846. change the messaging protocol, but an admin should never see any of that
  847. -->
  848. <!-- TODO: show examples, test this -->
  849. <!--
  850. , so an admin can simply run bindctl,
  851. do config show, and it shows all modules; config show >module> shows all
  852. options for that module
  853. -->
  854. </chapter>
  855. <chapter id="cmdctl">
  856. <title>Remote control daemon</title>
  857. <para>
  858. <command>b10-cmdctl</command> is the gateway between
  859. administrators and the BIND 10 system.
  860. It is a HTTPS server that uses standard HTTP Digest
  861. Authentication for username and password validation.
  862. It provides a REST-ful interface for accessing and controlling
  863. BIND 10.
  864. </para>
  865. <!-- TODO: copy examples from wiki, try with wget -->
  866. <para>
  867. When <command>b10-cmdctl</command> starts, it firsts
  868. asks <command>b10-cfgmgr</command> about what modules are
  869. running and what their configuration is (over the
  870. <command>b10-msgq</command> channel). Then it will start listening
  871. on HTTPS for clients &mdash; the user interface &mdash; such
  872. as <command>bindctl</command>.
  873. </para>
  874. <para>
  875. <command>b10-cmdctl</command> directly sends commands
  876. (received from the user interface) to the specified component.
  877. Configuration changes are actually commands to
  878. <command>b10-cfgmgr</command> so are sent there.
  879. </para>
  880. <!--
  881. TODO:
  882. "For bindctl to list a module's available configurations and
  883. available commands, it communicates over the cmdctl REST interface.
  884. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  885. asks the module for its specification and also cfgmgr looks in its
  886. own configuration database for current values."
  887. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  888. GET, but rather requests it once and then listens in for updates,
  889. but you might wanna check with likun
  890. -->
  891. <!-- TODO: replace /usr/local -->
  892. <!-- TODO: permissions -->
  893. <para>The HTTPS server requires a private key,
  894. such as a RSA PRIVATE KEY.
  895. The default location is at
  896. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  897. (A sample key is at
  898. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  899. It also uses a certificate located at
  900. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  901. (A sample certificate is at
  902. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  903. This may be a self-signed certificate or purchased from a
  904. certification authority.
  905. </para>
  906. <note><para>
  907. The HTTPS server doesn't support a certificate request from a
  908. client (at this time).
  909. <!-- TODO: maybe allow request from server side -->
  910. The <command>b10-cmdctl</command> daemon does not provide a
  911. public service. If any client wants to control BIND 10, then
  912. a certificate needs to be first received from the BIND 10
  913. administrator.
  914. The BIND 10 installation provides a sample PEM bundle that matches
  915. the sample key and certificate.
  916. </para></note>
  917. <!-- TODO: cross-ref -->
  918. <!-- TODO
  919. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  920. but that is a single file, maybe this should go back to that format?
  921. -->
  922. <!--
  923. <para>
  924. (08:20:56) shane: It is in theory possible to run without cmdctl.
  925. (08:21:02) shane: I think we discussed this.
  926. </para>
  927. -->
  928. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  929. <para>
  930. The <command>b10-cmdctl</command> daemon also requires
  931. the user account file located at
  932. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  933. This comma-delimited file lists the accounts with a user name,
  934. hashed password, and salt.
  935. (A sample file is at
  936. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  937. It contains the user named <quote>root</quote> with the password
  938. <quote>bind10</quote>.)
  939. </para>
  940. <para>
  941. The administrator may create a user account with the
  942. <command>b10-cmdctl-usermgr</command> tool.
  943. </para>
  944. <!-- TODO: show example -->
  945. <!-- TODO: does cmdctl need to be restarted to change cert or key
  946. or accounts database -->
  947. <para>
  948. By default the HTTPS server listens on the localhost port 8080.
  949. The port can be set by using the <option>--port</option> command line option.
  950. The address to listen on can be set using the <option>--address</option> command
  951. line argument.
  952. Each HTTPS connection is stateless and times out in 1200 seconds
  953. by default. This can be
  954. redefined by using the <option>--idle-timeout</option> command line argument.
  955. </para>
  956. <section id="cmdctl.spec">
  957. <title>Configuration specification for b10-cmdctl</title>
  958. <para>
  959. The configuration items for <command>b10-cmdctl</command> are:
  960. <varname>accounts_file</varname> which defines the path to the
  961. user accounts database (the default is
  962. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>);
  963. <varname>cert_file</varname> which defines the path to the
  964. PEM certificate file (the default is
  965. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>);
  966. and
  967. <varname>key_file</varname> which defines the path to the
  968. PEM private key file (the default is
  969. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>).
  970. </para>
  971. </section>
  972. <!--
  973. TODO
  974. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  975. -->
  976. </chapter>
  977. <chapter id="bindctl">
  978. <title>Control and configure user interface</title>
  979. <note><para>
  980. For the current release, <command>bindctl</command>
  981. is the only user interface. It is expected that upcoming
  982. releases will provide another interactive command-line
  983. interface and a web-based interface for controlling and
  984. configuring BIND 10.
  985. </para></note>
  986. <note><para>
  987. <command>bindctl</command> has an internal command history, as
  988. well as tab-completion for most of the commands and arguments.
  989. However, these are only enabled if the python readline module
  990. is available on the system. If not, neither of these
  991. features will be supported.
  992. </para></note>
  993. <para>
  994. The <command>bindctl</command> tool provides an interactive
  995. prompt for configuring, controlling, and querying the BIND 10
  996. components.
  997. It communicates directly with a REST-ful interface over HTTPS
  998. provided by <command>b10-cmdctl</command>. It doesn't
  999. communicate to any other components directly.
  1000. </para>
  1001. <section id="bindctl_commandline_options">
  1002. <title>bindctl command-line options</title>
  1003. <variablelist>
  1004. <varlistentry>
  1005. <term>-a <replaceable>&lt;address&gt;</replaceable>, --address=<replaceable>&lt;address&gt;</replaceable></term>
  1006. <listitem>
  1007. <simpara>
  1008. IP address that BIND 10's <command>b10-cmdctl</command>
  1009. module is listening on. By default, this is 127.0.0.1.
  1010. </simpara>
  1011. </listitem>
  1012. </varlistentry>
  1013. <varlistentry>
  1014. <term>-c <replaceable>&lt;certificate file&gt;</replaceable>, --certificate-chain=<replaceable>&lt;certificate file&gt;</replaceable></term>
  1015. <listitem>
  1016. <simpara>
  1017. PEM-formatted server certificate file. When this option is
  1018. given, <command>bindctl</command> will verify the server
  1019. certificate using the given file as the root of the
  1020. certificate chain. If not specified, <command>bindctl
  1021. </command> does not validate the certificate.
  1022. </simpara>
  1023. </listitem>
  1024. </varlistentry>
  1025. <varlistentry>
  1026. <term>--csv-file-dir=<replaceable>&lt;csv file&gt;</replaceable></term>
  1027. <listitem>
  1028. <simpara>
  1029. <command>bindctl</command> stores the username and
  1030. password for logging in in a file called
  1031. <filename>default_user.csv</filename>;
  1032. this option specifies the directory where this file is
  1033. stored and read from. When not specified,
  1034. <filename>~/.bind10/</filename> is used.
  1035. <note>Currently, this file contains an unencrypted password.</note>
  1036. </simpara>
  1037. </listitem>
  1038. </varlistentry>
  1039. <varlistentry>
  1040. <term>-h, --help</term>
  1041. <listitem>
  1042. <simpara>
  1043. Shows a short overview of the command-line options of
  1044. <command>bindctl</command>, and exits.
  1045. </simpara>
  1046. </listitem>
  1047. </varlistentry>
  1048. <varlistentry>
  1049. <term>--version</term>
  1050. <listitem>
  1051. <simpara>
  1052. Shows the version of <command>bindctl</command>, and exits.
  1053. </simpara>
  1054. </listitem>
  1055. </varlistentry>
  1056. <varlistentry>
  1057. <term>-p <replaceable>&lt;port number&gt;</replaceable>, --port=<replaceable>&lt;port number&gt;</replaceable></term>
  1058. <listitem>
  1059. <simpara>
  1060. Port number that BIND 10's <command>b10-cmdctl</command>
  1061. module is listening on. By default, this is port 8080.
  1062. </simpara>
  1063. </listitem>
  1064. </varlistentry>
  1065. </variablelist>
  1066. </section>
  1067. <section id="bindctl_general_syntax">
  1068. <title>General syntax of bindctl commands</title>
  1069. The <command>bindctl</command> tool is an interactive
  1070. command-line tool, with dynamic commands depending on the
  1071. BIND 10 modules that are running. There are a number of
  1072. fixed commands that have no module and that are always
  1073. available.
  1074. The general syntax of a command is
  1075. <screen><userinput>&lt;module&gt; &lt;command&gt; <replaceable>[argument(s)]</replaceable></userinput></screen>
  1076. For example, the Boss module has a 'shutdown' command to shut down
  1077. BIND 10, with an optional argument 'help':
  1078. <screen>&gt; <userinput>Boss shutdown help</userinput>
  1079. Command shutdown (Shut down BIND 10)
  1080. help (Get help for command)
  1081. This command has no parameters
  1082. </screen>
  1083. There are no mandatory arguments, only the optional 'help'.
  1084. </section>
  1085. <section id="bindctl_help">
  1086. <title>Bindctl help</title>
  1087. <command>help</command> is both a command and an option that is available to all other commands. When run as a command directly, it shows the available modules.
  1088. <screen>&gt; <userinput>help</userinput>
  1089. usage: &lt;module name&gt; &lt;command name&gt; [param1 = value1 [, param2 = value2]]
  1090. Type Tab character to get the hint of module/command/parameters.
  1091. Type "help(? h)" for help on bindctl.
  1092. Type "&lt;module_name&gt; help" for help on the specific module.
  1093. Type "&lt;module_name&gt; &lt;command_name&gt; help" for help on the specific command.
  1094. Available module names:
  1095. <emphasis>(list of modules)</emphasis>
  1096. </screen>
  1097. When 'help' is used as a command to a module, it shows the supported commands for the module; for example:
  1098. <screen>&gt; <userinput>Boss help</userinput>
  1099. Module Boss Master process
  1100. Available commands:
  1101. help Get help for module.
  1102. shutdown Shut down BIND 10
  1103. ping Ping the boss process
  1104. show_processes
  1105. List the running BIND 10 processes
  1106. </screen>
  1107. And when added to a module command, it shows the description and parameters of that specific command; for example:
  1108. <screen>&gt; <userinput>Auth loadzone help</userinput>
  1109. Command loadzone ((Re)load a specified zone)
  1110. help (Get help for command)
  1111. Parameters:
  1112. class (string, optional)
  1113. origin (string, mandatory)
  1114. </screen>
  1115. </section>
  1116. <section id="bindctl_command_arguments">
  1117. <title>Command arguments</title>
  1118. <simpara>
  1119. Commands can have arguments, which can be either optional or
  1120. mandatory. They can be specified by name
  1121. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument name&gt;=&lt;argument value&gt;</replaceable></command>), or positionally,
  1122. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument value 1&gt;</replaceable> <replaceable>&lt;argument value 2&gt;</replaceable></command>).
  1123. </simpara>
  1124. <simpara>
  1125. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>help</replaceable></command>
  1126. shows the arguments a command supports and which of those are
  1127. mandatory, and in which order the arguments are expected if
  1128. positional arguments are used.
  1129. </simpara>
  1130. <simpara>
  1131. For example, the <command>loadzone</command> command of the Auth
  1132. module, as shown in the last example of the previous section, has
  1133. two arguments, one of which is optional. The positional arguments in
  1134. this case are class first and origin second; for example:
  1135. <screen>&gt; <userinput>Auth loadzone IN example.com.</userinput></screen>
  1136. But since the class is optional (defaulting to IN), leaving it out
  1137. works as well:
  1138. <screen>&gt; <userinput>Auth loadzone example.com.</userinput></screen>
  1139. </simpara>
  1140. <simpara>
  1141. The arguments can also be provided with their names, in which
  1142. case the order does not matter:
  1143. <screen>&gt; <userinput>Auth loadzone origin="example.com." class="IN"</userinput></screen>
  1144. </simpara>
  1145. </section>
  1146. <section id="bindctl_module_commands">
  1147. <title>Module commands</title>
  1148. Each module has its own set of commands (if any), which will only be
  1149. available if the module is running. For instance, the
  1150. Auth module has a <command>loadzone</command> command.
  1151. The commands a module provides are documented in
  1152. this guide in the section of that module or in the module's
  1153. corresponding manual page.
  1154. </section>
  1155. <section>
  1156. <title>Configuration commands</title>
  1157. Configuration commands are used to view and change the configuration
  1158. of BIND 10 and its modules. Module configuration is only shown if
  1159. that module is running, but similar to commands, there are a number
  1160. of top-level configuration items that are always available (for
  1161. instance <varname>tsig_keys</varname> and
  1162. <varname>data_sources</varname>).
  1163. Configuration changes (set, unset, add and remove) are done locally
  1164. first, and have no immediate effect. The changes can be viewed with
  1165. <command>config diff</command>, and either reverted
  1166. (<command>config revert</command>), or committed
  1167. (<command>config commit</command>).
  1168. In the latter case, all local changes are submitted
  1169. to the configuration manager, which verifies them, and if they are
  1170. accepted, applied and saved in persistent storage.
  1171. When identifying items in configuration commands, the format is
  1172. <screen><userinput>Module/example/item</userinput></screen>
  1173. Sub-elements of names, lists and sets (see <xref linkend=
  1174. "bindctl_configuration_data_types"/>) are separated with the '/'
  1175. character, and list indices are identified with [<replaceable>&lt;index&gt;</replaceable>]; for example:
  1176. <screen><userinput>Module/example/list[2]/foo</userinput></screen>
  1177. <section id="bindctl_configuration_command_list">
  1178. <title>List of configuration commands</title>
  1179. The following configuration commands are available:
  1180. <variablelist>
  1181. <varlistentry>
  1182. <term>show [all] [item name]</term>
  1183. <listitem>
  1184. <simpara>
  1185. Shows the current configuration of the given item. If 'all'
  1186. is given, it will recurse through the entire set, and show
  1187. every nested value.
  1188. </simpara>
  1189. </listitem>
  1190. </varlistentry>
  1191. <varlistentry>
  1192. <term>show_json [item name]</term>
  1193. <listitem>
  1194. <simpara>
  1195. Shows the full configuration of the given item in JSON format.
  1196. </simpara>
  1197. </listitem>
  1198. </varlistentry>
  1199. <varlistentry>
  1200. <term>add &lt;item name&gt; [value]</term>
  1201. <listitem>
  1202. <simpara>
  1203. Add an entry to configuration list or a named set (see <xref
  1204. linkend="bindctl_configuration_data_types"/>).
  1205. When adding to a list, the command has one optional
  1206. argument, a value to add to the list. The value must
  1207. be in correct JSON and complete. When adding to a
  1208. named set, it has one mandatory parameter (the name to
  1209. add), and an optional parameter value, similar to when
  1210. adding to a list. In either case, when no value is
  1211. given, an entry will be constructed with default
  1212. values.
  1213. </simpara>
  1214. </listitem>
  1215. </varlistentry>
  1216. <varlistentry>
  1217. <term>remove</term>
  1218. <listitem>
  1219. <simpara>
  1220. Remove an item from a configuration list or a named set.
  1221. When removing an item for a list, either the index needs to
  1222. be specified, or the complete value of the element to remove
  1223. must be specified (in JSON format).
  1224. </simpara>
  1225. </listitem>
  1226. </varlistentry>
  1227. <varlistentry>
  1228. <term>set &lt;item name&gt; &lt;value&gt;</term>
  1229. <listitem>
  1230. <simpara>
  1231. Directly set the value of the given item to the given value.
  1232. </simpara>
  1233. </listitem>
  1234. </varlistentry>
  1235. <varlistentry>
  1236. <term>unset &lt;item name&gt;</term>
  1237. <listitem>
  1238. <simpara>
  1239. Remove any user-specified value for the given item.
  1240. </simpara>
  1241. </listitem>
  1242. </varlistentry>
  1243. <varlistentry>
  1244. <term>diff</term>
  1245. <listitem>
  1246. <simpara>
  1247. Show all current local changes that have not been
  1248. committed yet.
  1249. </simpara>
  1250. </listitem>
  1251. </varlistentry>
  1252. <varlistentry>
  1253. <term>revert</term>
  1254. <listitem>
  1255. <simpara>
  1256. Revert all local changes without committing them.
  1257. </simpara>
  1258. </listitem>
  1259. </varlistentry>
  1260. <varlistentry>
  1261. <term>commit</term>
  1262. <listitem>
  1263. <simpara>
  1264. Send all local changes to the configuration manager, which
  1265. will validate them, and apply them if validation succeeds.
  1266. </simpara>
  1267. </listitem>
  1268. </varlistentry>
  1269. <varlistentry>
  1270. <term>go</term>
  1271. <listitem>
  1272. <simpara>
  1273. Go to a specific configuration part, similar to the 'cd'
  1274. command in a shell.
  1275. <note>There are a number of problems with the current
  1276. implementation of go within <command>bindctl</command>,
  1277. and we recommend not using it for general cases.</note>
  1278. </simpara>
  1279. </listitem>
  1280. </varlistentry>
  1281. </variablelist>
  1282. </section>
  1283. <section id="bindctl_configuration_data_types">
  1284. <title>Configuration data types</title>
  1285. Configuration data can be of different types, which can be modified
  1286. in ways that depend on the types. There are a few syntax
  1287. restrictions on these types, but only basic ones. Modules may impose
  1288. additional restrictions on the values of elements.
  1289. <variablelist>
  1290. <varlistentry>
  1291. <term>integer</term>
  1292. <listitem>
  1293. <simpara>
  1294. A basic integer; can be set directly with <command>config set</command>, to any integer value.
  1295. </simpara>
  1296. </listitem>
  1297. </varlistentry>
  1298. <varlistentry>
  1299. <term>real</term>
  1300. <listitem>
  1301. <simpara>
  1302. A basic floating point number; can be set directly with <command>config set</command>, to any floating point value.
  1303. </simpara>
  1304. </listitem>
  1305. </varlistentry>
  1306. <varlistentry>
  1307. <term>boolean</term>
  1308. <listitem>
  1309. <simpara>
  1310. A basic boolean value; can be set directly with <command>config set</command>, to either <command>true</command> or <command>false</command>.
  1311. </simpara>
  1312. </listitem>
  1313. </varlistentry>
  1314. <varlistentry>
  1315. <term>string</term>
  1316. <listitem>
  1317. <simpara>
  1318. A basic string value; can be set directly with <command>config set,</command> so any string. Double quotation marks are optional.
  1319. </simpara>
  1320. </listitem>
  1321. </varlistentry>
  1322. <varlistentry>
  1323. <term>null</term>
  1324. <listitem>
  1325. <simpara>
  1326. This is a special type representing 'no value at all'; usable in compound structures that have optional elements that are not set.
  1327. </simpara>
  1328. </listitem>
  1329. </varlistentry>
  1330. <varlistentry>
  1331. <term>maps</term>
  1332. <listitem>
  1333. <simpara>
  1334. Maps are (pre-defined) compound collections of other
  1335. elements of any other type. They are not usually
  1336. modified directly, but their elements are. Every
  1337. top-level element for a module is a map containing
  1338. the configuration values for that map, which can
  1339. themselves be maps again. For instance, the Auth
  1340. module configuration is a map containing the
  1341. elements '<varname>listen_on</varname>' (list) and '<varname>tcp_recv_timeout</varname>'
  1342. (integer). When changing one of its values, they can
  1343. be modified directly with <command>config set
  1344. Auth/tcp_recv_timeout 3000</command>.
  1345. </simpara>
  1346. <simpara>
  1347. Some map entries are optional. If they are, and
  1348. currently have a value, the value can be unset by
  1349. using either <command>config unset
  1350. <replaceable>&lt;item name&gt;</replaceable>
  1351. </command> or <command>config set
  1352. <replaceable>&lt;item name&gt;</replaceable>
  1353. null</command>.
  1354. </simpara>
  1355. <simpara>
  1356. Maps <emphasis>can</emphasis> be modified as a whole,
  1357. but using the full JSON representation of
  1358. the entire map to set.
  1359. Since this involves a lot of text, this is usually
  1360. not recommended.
  1361. </simpara>
  1362. <simpara>
  1363. Another example is the Logging virtual module, which
  1364. is, like any module, a map, but it only contains one
  1365. element: a list of loggers. Normally, an
  1366. administrator would only modify that list (or its
  1367. elements) directly, but it is possible to set the
  1368. entire map in one command; for example:
  1369. <command> config set Logging { "loggers": [] } </command>
  1370. </simpara>
  1371. </listitem>
  1372. </varlistentry>
  1373. <varlistentry>
  1374. <term>list</term>
  1375. <listitem>
  1376. <simpara>
  1377. A list is a compound list of other elements of the
  1378. same type. Elements can be added with <command>config
  1379. add <replaceable>&lt;list name&gt; [value]</replaceable></command>, and removed with
  1380. <command>config remove <replaceable>&lt;list name&gt; [value]</replaceable></command> or
  1381. <command>config remove <replaceable>&lt;list name&gt;</replaceable><replaceable>&lt;index&gt;</replaceable></command>.
  1382. The index is of the form <emphasis>square bracket, number,
  1383. square bracket</emphasis> (e.g.
  1384. <command>[0]</command>), and it immediately follows
  1385. the list name (there is no separator or space
  1386. between them). List indices start with 0 for the
  1387. first element.
  1388. </simpara>
  1389. <simpara>
  1390. For addition, if the value is omitted, an entry with
  1391. default values will be added. For removal, either
  1392. the index or the full value (in JSON format) needs
  1393. to be specified.
  1394. </simpara>
  1395. <simpara>
  1396. Lists can also be used with
  1397. <command>config set</command>,
  1398. but like maps, only by specifying the
  1399. entire list value in JSON format.
  1400. </simpara>
  1401. <simpara>
  1402. For example, this command shows the port number used for the second element of the list <varname>listen_on</varname> in the Auth module:
  1403. <command> config show Auth/listen_on[1]/port</command>
  1404. </simpara>
  1405. </listitem>
  1406. </varlistentry>
  1407. <varlistentry>
  1408. <term>named set</term>
  1409. <listitem>
  1410. <simpara>
  1411. Named sets are similar to lists, in that they are
  1412. sets of elements of the same type, but they are not
  1413. indexed by numbers, but by strings.
  1414. </simpara>
  1415. <simpara>
  1416. Values can be added with
  1417. <command>config add <replaceable>&lt;item name&gt; &lt;string&gt; [value]</replaceable></command>
  1418. where 'string' is the name of the element. If 'value'
  1419. is ommitted, default values will be used. Elements
  1420. can be removed with <command>config remove
  1421. <replaceable>&lt;item
  1422. name&gt; &lt;string&gt;</replaceable></command>
  1423. </simpara>
  1424. <simpara>
  1425. Elements in a named set can be addressed similarly
  1426. to maps.
  1427. </simpara>
  1428. <simpara>
  1429. For example, the <command>Boss/components</command>
  1430. elements is a named set;
  1431. adding, showing, and then removing an element
  1432. can be done with the following three commands (note
  1433. the '/'-character versus the space before
  1434. 'example_module'):
  1435. </simpara>
  1436. <simpara>
  1437. <command>config add Boss/components example_module</command>
  1438. </simpara>
  1439. <simpara>
  1440. <command>config show Boss/components/example_module</command>
  1441. </simpara>
  1442. <simpara>
  1443. <command>config remove Boss/components example_module</command>
  1444. </simpara>
  1445. </listitem>
  1446. </varlistentry>
  1447. <varlistentry>
  1448. <term>any</term>
  1449. <listitem>
  1450. <simpara>
  1451. The 'any' type is a special type that can have any
  1452. form. Apart from that, it must consist of elements as
  1453. described in this chapter, there is no restriction
  1454. on which element types are used. This type is used
  1455. in places where different data formats could be
  1456. used. Element modification commands depend on the
  1457. actual type of the value. For instance, if the value
  1458. of an 'any' element is a list, <command>config add
  1459. </command> and <command>config remove</command> work
  1460. as for other lists.
  1461. </simpara>
  1462. </listitem>
  1463. </varlistentry>
  1464. </variablelist>
  1465. </section>
  1466. </section>
  1467. <section>
  1468. <title>The execute command</title>
  1469. The <command>execute</command> command executes a set of commands,
  1470. either from a file
  1471. or from a pre-defined set. Currently, the only predefined set is
  1472. <command>init_authoritative_server</command>, which adds
  1473. <command>b10-auth</command>, <command>b10-xfrin</command>, and
  1474. <command>b10-xfrout</command> to the set of components to be
  1475. started by BIND 10. This
  1476. pre-defined set does not commit the changes, so these modules do not
  1477. show up for commands or configuration until the user enters
  1478. <command>config commit</command> after
  1479. <command>execute init_authoritative_server</command>. For example:
  1480. <screen>&gt; <userinput>execute init_authoritative_server</userinput></screen>
  1481. <screen>&gt; <userinput>execute file /tmp/example_commands</userinput></screen>
  1482. The optional argument <command>show</command> displays the exact set of
  1483. commands that would be executed; for example:
  1484. <screen>&gt; <userinput>execute init_authoritative_server show</userinput>
  1485. !echo adding Authoritative server component
  1486. config add /Boss/components b10-auth
  1487. config set /Boss/components/b10-auth/kind needed
  1488. config set /Boss/components/b10-auth/special auth
  1489. !echo adding Xfrin component
  1490. config add /Boss/components b10-xfrin
  1491. config set /Boss/components/b10-xfrin/address Xfrin
  1492. config set /Boss/components/b10-xfrin/kind dispensable
  1493. !echo adding Xfrout component
  1494. config add /Boss/components b10-xfrout
  1495. config set /Boss/components/b10-xfrout/address Xfrout
  1496. config set /Boss/components/b10-xfrout/kind dispensable
  1497. !echo adding Zone Manager component
  1498. config add /Boss/components b10-zonemgr
  1499. config set /Boss/components/b10-zonemgr/address Zonemgr
  1500. config set /Boss/components/b10-zonemgr/kind dispensable
  1501. !echo Components added. Please enter "config commit" to
  1502. !echo finalize initial setup and run the components.
  1503. </screen>
  1504. The optional <command>show</command> argument may also be used when
  1505. executing a script from a file; for example:
  1506. <screen>&gt; <userinput>execute file /tmp/example_commands show</userinput></screen>
  1507. <section id="bindctl_execute_directives">
  1508. <title>Execute directives</title>
  1509. Within sets of commands to be run with the <command>execute</command>
  1510. command, a number of directives are supported:
  1511. <variablelist>
  1512. <varlistentry>
  1513. <term>!echo <replaceable>&lt;string&gt;</replaceable></term>
  1514. <listitem>
  1515. <simpara>
  1516. Prints the given string to <command>bindctl</command>'s
  1517. output.
  1518. </simpara>
  1519. </listitem>
  1520. </varlistentry>
  1521. <varlistentry>
  1522. <term>!verbose on</term>
  1523. <listitem>
  1524. <simpara>
  1525. Enables verbose mode; all following commands that are to
  1526. be executed are also printed.
  1527. </simpara>
  1528. </listitem>
  1529. </varlistentry>
  1530. <varlistentry>
  1531. <term>!verbose off</term>
  1532. <listitem>
  1533. <simpara>
  1534. Disables verbose mode; following commands that are to
  1535. be executed are no longer printed.
  1536. </simpara>
  1537. </listitem>
  1538. </varlistentry>
  1539. </variablelist>
  1540. </section>
  1541. <section id="bindctl_execute_notes">
  1542. <title>Notes on execute scripts</title>
  1543. Within scripts, you can add or remove modules with the normal
  1544. configuration commands for <command>Boss/components</command>.
  1545. However, as module
  1546. configuration and commands do not show up until the module is
  1547. running, it is currently not possible to add a module and set
  1548. its configuration in one script. This will be addressed in the
  1549. future, but for now the only option is to add and configure
  1550. modules in separate commands and execute scripts.
  1551. </section>
  1552. </section>
  1553. </chapter>
  1554. <chapter id="common">
  1555. <title>Common configuration elements</title>
  1556. <para>
  1557. Some things are configured in the same or similar manner across
  1558. many modules. So we show them here in one place.
  1559. </para>
  1560. <section id='common-tsig'>
  1561. <title>TSIG keys</title>
  1562. <para>
  1563. TSIG is a way to sign requests and responses in DNS. It is defined in
  1564. RFC 2845 and uses symmetric cryptography to sign the DNS messages. If
  1565. you want to make any use of TSIG (to authenticate transfers or DDNS,
  1566. for example), you need to set up shared secrets between the endpoints.
  1567. </para>
  1568. <para>
  1569. BIND 10 uses a global key ring for the secrets. It doesn't currently
  1570. mean they would be stored differently, they are just in one place of
  1571. the configuration.
  1572. </para>
  1573. <section id='tsig-key-syntax'>
  1574. <title>Key anatomy and syntax</title>
  1575. <para>
  1576. Each key has three attributes. One is a name by which it is referred
  1577. both in DNS packets and the rest of the configuration. Another is the
  1578. algorithm used to compute the signature. And the last part is a
  1579. base64 encoded secret, which might be any blob of data.
  1580. </para>
  1581. <para>
  1582. The parts are written into a string, concatenated together by colons.
  1583. So if you wanted to have a key called "example.key", used as a
  1584. HMAC-MD5 key with secret "secret", you'd write it as:
  1585. <screen>"example.key.:c2VjcmV0:hmac-md5"</screen>
  1586. </para>
  1587. <para>
  1588. The HMAC-MD5 algorithm is the default, so you can omit it. You could
  1589. write the same key as:
  1590. <screen>"example.key.:c2VjcmV0"</screen>
  1591. </para>
  1592. <para>
  1593. You can also use these algorithms (which may not be omitted from the
  1594. key definition if used):
  1595. <itemizedlist>
  1596. <listitem>hmac-sha1</listitem>
  1597. <listitem>hmac-sha224</listitem>
  1598. <listitem>hmac-sha256</listitem>
  1599. <listitem>hmac-sha384</listitem>
  1600. <listitem>hmac-sha512</listitem>
  1601. </itemizedlist>
  1602. </para>
  1603. <para>
  1604. The name of the key must be a valid DNS name.
  1605. </para>
  1606. </section>
  1607. <section id='tsig-key-ring'>
  1608. <title>Key ring</title>
  1609. <para>
  1610. The key ring lives in the configuration in "tsig_keys/keys". Most of
  1611. the system uses the keys from there &mdash; ACLs, authoritative server to
  1612. sign responses to signed queries, and <command>b10-xfrout</command>
  1613. to sign transfers. The <command>b10-xfrin</command> uses its own
  1614. configuration for keys, but that will be fixed in Trac ticket
  1615. <ulink url="http://bind10.isc.org/ticket/1351">#1351</ulink>.
  1616. </para>
  1617. <para>
  1618. The key ring is just a list of strings, each describing one key. So,
  1619. to add a new key, you can do this:
  1620. <screen>&gt; <userinput>config add tsig_keys/keys "example.key.:c2VjcmV0"</userinput>
  1621. &gt; <userinput>config show tsig_keys/keys</userinput>
  1622. tsig_keys/keys[0] "example.key.:c2VjcmV0" string (modified)
  1623. &gt; <userinput>config commit</userinput></screen>
  1624. </para>
  1625. <para>
  1626. You can keep as many keys as you want in the key ring, but each must
  1627. have a different name.
  1628. </para>
  1629. </section>
  1630. </section>
  1631. <section id='common-acl'>
  1632. <title>ACLs</title>
  1633. <para>
  1634. An ACL, or Access Control List, is a way to describe if a request
  1635. is allowed or disallowed. The principle is, there's a list of rules.
  1636. Each rule is a name-value mapping (a dictionary, in the JSON
  1637. terminology). Each rule must contain exactly one mapping called
  1638. "action", which describes what should happen if the rule applies.
  1639. There may be more mappings, calld matches, which describe the
  1640. conditions under which the rule applies.
  1641. </para>
  1642. <para>
  1643. When there's a query, the first rule is examined. If it matches, the
  1644. action in it is taken. If not, next rule is examined. If there are no
  1645. more rules to examine, a default action is taken.
  1646. </para>
  1647. <para>
  1648. There are three possible "action" values. The "ACCEPT" value means
  1649. the query is handled. If it is "REJECT", the query is not answered,
  1650. but a polite error message is sent back (if that makes sense in the
  1651. context). The "DROP" action acts like a black hole. The query is
  1652. not answered and no error message is sent.
  1653. </para>
  1654. <para>
  1655. If there are multiple matching conditions inside the rule, all of
  1656. them must be satisfied for the rule to apply. This can be used,
  1657. for example, to require the query to be signed by a TSIG key and
  1658. originate from given address.
  1659. </para>
  1660. <para>
  1661. This is encoded in form of JSON. Semi-formal description could look
  1662. something like this. It is described in more details below.
  1663. <!-- FIXME: Is <screen> really the correct one?-->
  1664. <screen>ACL := [ RULE, RULE, ... ]
  1665. RULE := { "action": "ACCEPT"|"REJECT"|"DROP", MATCH, MATCH, ... }
  1666. RULE_RAW := { MATCH, MATCH, ... }
  1667. MATCH := FROM_MATCH|KEY_MATCH|NOT_MATCH|OR_MATCH|AND_MATCH|...
  1668. FROM_MATCH := "from": [RANGE, RANGE, RANGE, ...] | RANGE
  1669. RANGE := "&lt;ip range&gt;"
  1670. KEY_MATCH := "key": [KEY, KEY, KEY, ...] | KEY
  1671. KEY := "&lt;key name&gt;"
  1672. NOT_MATCH := "NOT": RULE_RAW
  1673. OR_MATCH := "ANY": [ RULE_RAW, RULE_RAW, ... ]
  1674. AND_MATCH := "ALL": [ RULE_RAW, RULE_RAW, ... ]
  1675. </screen>
  1676. </para>
  1677. <section>
  1678. <title>Matching properties</title>
  1679. <para>
  1680. The first thing you can check against is the source address
  1681. of request. The name is <varname>from</varname> and the value
  1682. is a string containing either a single IPv4 or IPv6 address,
  1683. or a range in the usual slash notation (eg. "192.0.2.0/24").
  1684. </para>
  1685. <para>
  1686. The other is TSIG key by which the message was signed. The ACL
  1687. contains only the name (under the name "key"), the key itself
  1688. must be stored in the global key ring (see <xref
  1689. linkend="tsig-key-ring"/>).
  1690. This property is applicable only to the DNS context.
  1691. </para>
  1692. <para>
  1693. More properties to match are planned &mdash; the destination
  1694. address, ports, matches against the packet content.
  1695. </para>
  1696. </section>
  1697. <section>
  1698. <title>More complicated matches</title>
  1699. <para>
  1700. From time to time, you need to express something more complex
  1701. than just a single address or key.
  1702. </para>
  1703. <para>
  1704. You can specify a list of values instead of single value. Then
  1705. the property needs to match at least one of the values listed
  1706. &mdash; so you can say <quote>"from": ["192.0.2.0/24",
  1707. "2001:db8::/32"]</quote> to match any address in the ranges
  1708. set aside for documentation. The keys or any future properties
  1709. will work in a similar way.
  1710. </para>
  1711. <para>
  1712. If that is not enough, you can compose the matching conditions
  1713. to logical expressions. They are called "ANY", "ALL" and "NOT".
  1714. The "ANY" and "ALL" ones contain lists of subexpressions &mdash;
  1715. each subexpression is a similar dictionary, just not containing
  1716. the "action" element. The "NOT" contains single subexpression.
  1717. Their function should be obvious &mdash; "NOT" matches if and
  1718. only if the subexpression does not match. The "ALL" matches exactly
  1719. when each of the subexpressions matches and "ANY" when at least
  1720. one matches.
  1721. </para>
  1722. </section>
  1723. <section>
  1724. <title>Examples</title>
  1725. <para>
  1726. All the examples here is just the JSON representing the ACL,
  1727. nicely formatted and split across lines. They are out of any
  1728. surrounding context. This is similar to what you'd get from
  1729. <command>config show_json</command> called on the entry containing
  1730. the ACL.
  1731. </para>
  1732. <para>
  1733. In the first example, the ACL accepts queries from two known hosts.
  1734. Each host has an IP addresses (both IPv4 and IPv6) and a TSIG
  1735. key. Other queries are politely rejected. The last entry in the list
  1736. has no conditions &mdash; making it match any query.
  1737. <screen>[
  1738. {
  1739. "from": ["192.0.2.1", "2001:db8::1"],
  1740. "key": "first.key",
  1741. "action": "ACCEPT"
  1742. },
  1743. {
  1744. "from": ["192.0.2.2", "2001:db8::2"],
  1745. "key": "second.key",
  1746. "action": "ACCEPT"
  1747. },
  1748. {
  1749. "action": "REJECT"
  1750. }
  1751. ]</screen>
  1752. </para>
  1753. <para>
  1754. Now we show two ways to accept only the queries from private ranges.
  1755. This is the same as rejecting anything that is outside.
  1756. <screen>[
  1757. {
  1758. "from": [
  1759. "10.0.0.0/8",
  1760. "172.16.0.0/12",
  1761. "192.168.0.0/16",
  1762. "fc00::/7"
  1763. ],
  1764. "action": "ACCEPT"
  1765. },
  1766. {
  1767. "action": "REJECT"
  1768. }
  1769. ]</screen>
  1770. <screen>[
  1771. {
  1772. "NOT": {
  1773. "ANY": [
  1774. {"from": "10.0.0.0/8"},
  1775. {"from": "172.16.0.0/12"},
  1776. {"from": "192.168.0.0/16"},
  1777. {"from": "fc00::/7"}
  1778. ]
  1779. },
  1780. "action": "REJECT"
  1781. },
  1782. {
  1783. "action": "ACCEPT"
  1784. }
  1785. ]</screen>
  1786. </para>
  1787. </section>
  1788. <section>
  1789. <title>Interaction with <command>bindctl</command></title>
  1790. <para>
  1791. Currently, <command>bindctl</command> has hard time coping with
  1792. the variable nature of the ACL syntax. This technical limitation
  1793. makes it impossible to edit parts of the entries. You need to
  1794. set the whole entry at once, providing the whole JSON value.
  1795. </para>
  1796. <para>
  1797. This limitation is planned to be solved soon at least partially.
  1798. </para>
  1799. <para>
  1800. You'd do something like this to create the second example.
  1801. Note that the whole JSON must be on a single line.
  1802. <screen>&gt; <userinput>config add somewhere/acl</userinput>
  1803. &gt; <userinput>config set somewhere/acl[0] { "from": [ "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7" ], "action": "ACCEPT" }</userinput>
  1804. &gt; <userinput>config add somewhere/acl</userinput>
  1805. &gt; <userinput>config set somewhere/acl[1] { "action": "REJECT" }</userinput>
  1806. &gt; <userinput>config commit</userinput></screen>
  1807. </para>
  1808. </section>
  1809. </section>
  1810. </chapter>
  1811. <chapter id="bind10.config">
  1812. <title>bind10 Control and Configuration</title>
  1813. <para>
  1814. This chapter explains how to control and configure the
  1815. <command>bind10</command> parent.
  1816. The startup of this resident process that runs the BIND 10
  1817. daemons is covered in <xref linkend="bind10"/>.
  1818. </para>
  1819. <section id="bind10.shutdown">
  1820. <title>Stopping bind10</title>
  1821. <para>
  1822. The BIND 10 suite may be shut down by stopping the
  1823. parent <command>bind10</command> process. This may be done
  1824. by running the <userinput>Boss shutdown</userinput> command
  1825. at the <command>bindctl</command> prompt.
  1826. </para>
  1827. </section>
  1828. <section id="bind10.components">
  1829. <title>Configuration to start processes</title>
  1830. <para>
  1831. The processes to be used can be configured for
  1832. <command>bind10</command> to start, with the exception
  1833. of the required <command>b10-sockcreator</command>,
  1834. <command>b10-msgq</command> and <command>b10-cfgmgr</command>
  1835. components.
  1836. The configuration is in the <varname>Boss/components</varname>
  1837. section. Each element represents one component, which is
  1838. an abstraction of a process.
  1839. </para>
  1840. <para>
  1841. To add a process to the set, let's say the resolver (which
  1842. is not started by default), you would do this:
  1843. <screen>&gt; <userinput>config add Boss/components b10-resolver</userinput>
  1844. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  1845. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  1846. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  1847. &gt; <userinput>config commit</userinput></screen></para>
  1848. <para>
  1849. Now, what it means. We add an entry called
  1850. <quote>b10-resolver</quote>. It is both a name used to
  1851. reference this component in the configuration and the name
  1852. of the process to start. Then we set some parameters on
  1853. how to start it.
  1854. </para>
  1855. <para>
  1856. The <varname>special</varname> setting is for components
  1857. that need some kind of special care during startup or
  1858. shutdown. Unless specified, the component is started in a
  1859. usual way. This is the list of components that need to be
  1860. started in a special way, with the value of special used
  1861. for them:
  1862. <!-- TODO: this still doesn't explain why they are special -->
  1863. <table>
  1864. <title>Special startup components</title>
  1865. <tgroup cols='3' align='left'>
  1866. <colspec colname='component'/>
  1867. <colspec colname='special'/>
  1868. <colspec colname='description'/>
  1869. <thead><row><entry>Component</entry><entry>Special</entry><entry>Description</entry></row></thead>
  1870. <tbody>
  1871. <row><entry>b10-auth</entry><entry>auth</entry><entry>Authoritative DNS server</entry></row>
  1872. <row><entry>b10-resolver</entry><entry>resolver</entry><entry>DNS resolver</entry></row>
  1873. <row><entry>b10-cmdctl</entry><entry>cmdctl</entry><entry>Command control (remote control interface)</entry></row>
  1874. <!-- TODO Either add xfrin and xfrout as well or clean up the workarounds in boss before the release -->
  1875. </tbody>
  1876. </tgroup>
  1877. </table>
  1878. </para>
  1879. <para>
  1880. The <varname>kind</varname> specifies how a failure of the
  1881. component should be handled. If it is set to
  1882. <quote>dispensable</quote> (the default unless you set
  1883. something else), it will get started again if it fails. If
  1884. it is set to <quote>needed</quote> and it fails at startup,
  1885. the whole <command>bind10</command> shuts down and exits
  1886. with an error exit code. But if it fails some time later, it
  1887. is just started again. If you set it to <quote>core</quote>,
  1888. you indicate that the system is not usable without the
  1889. component and if such component fails, the system shuts
  1890. down no matter when the failure happened. This is the
  1891. behaviour of the core components (the ones you can't turn
  1892. off), but you can declare any other components as core as
  1893. well if you wish (but you can turn these off, they just
  1894. can't fail).
  1895. </para>
  1896. <para>
  1897. The <varname>priority</varname> defines order in which the
  1898. components should start. The ones with higher numbers are
  1899. started sooner than the ones with lower ones. If you don't
  1900. set it, 0 (zero) is used as the priority. Usually, leaving
  1901. it at the default is enough.
  1902. </para>
  1903. <para>
  1904. There are other parameters we didn't use in our example.
  1905. One of them is <varname>address</varname>. It is the address
  1906. used by the component on the <command>b10-msgq</command>
  1907. message bus. The special components already know their
  1908. address, but the usual ones don't. The address is by
  1909. convention the thing after <emphasis>b10-</emphasis>, with
  1910. the first letter capitalized (eg. <command>b10-stats</command>
  1911. would have <quote>Stats</quote> as its address).
  1912. <!-- TODO: this should be simplified so we don't even have to document it -->
  1913. </para>
  1914. <!-- TODO: what does "The special components already know their
  1915. address, but the usual ones don't." mean? -->
  1916. <!-- TODO: document params when is enabled -->
  1917. <para>
  1918. The last one is <varname>process</varname>. It is the name
  1919. of the process to be started. It defaults to the name of
  1920. the component if not set, but you can use this to override
  1921. it. (The special components also already know their
  1922. executable name.)
  1923. </para>
  1924. <!-- TODO Add parameters when they work, not implemented yet-->
  1925. <note>
  1926. <para>
  1927. The configuration is quite powerful, but that includes
  1928. a lot of space for mistakes. You could turn off the
  1929. <command>b10-cmdctl</command>, but then you couldn't
  1930. change it back the usual way, as it would require it to
  1931. be running (you would have to find and edit the configuration
  1932. directly). Also, some modules might have dependencies:
  1933. <command>b10-stats-httpd</command> needs
  1934. <command>b10-stats</command>, <command>b10-xfrout</command>
  1935. needs <command>b10-auth</command> to be running, etc.
  1936. <!-- TODO: should we define dependencies? -->
  1937. </para>
  1938. <para>
  1939. In short, you should think twice before disabling something here.
  1940. </para>
  1941. </note>
  1942. <para>
  1943. It is possible to start some components multiple times (currently
  1944. <command>b10-auth</command> and <command>b10-resolver</command>).
  1945. You might want to do that to gain more performance (each one uses only
  1946. single core). Just put multiple entries under different names, like
  1947. this, with the same config:
  1948. <screen>&gt; <userinput>config add Boss/components b10-resolver-2</userinput>
  1949. &gt; <userinput>config set Boss/components/b10-resolver-2/special resolver</userinput>
  1950. &gt; <userinput>config set Boss/components/b10-resolver-2/kind needed</userinput>
  1951. &gt; <userinput>config commit</userinput></screen>
  1952. </para>
  1953. <para>
  1954. However, this is work in progress and the support is not yet complete.
  1955. For example, each resolver will have its own cache, each authoritative
  1956. server will keep its own copy of in-memory data and there could be
  1957. problems with locking the sqlite database, if used. The configuration
  1958. might be changed to something more convenient in future.
  1959. Other components don't expect such a situation, so it would
  1960. probably not do what you want. Such support is yet to be
  1961. implemented.
  1962. </para>
  1963. <para>
  1964. The running processes started by <command>bind10</command>
  1965. may be listed by running <userinput>Boss show_processes</userinput>
  1966. using <command>bindctl</command>.
  1967. </para>
  1968. </section>
  1969. </chapter>
  1970. <chapter id="authserver">
  1971. <title>Authoritative Server</title>
  1972. <para>
  1973. The <command>b10-auth</command> is the authoritative DNS server.
  1974. It supports EDNS0, DNSSEC, IPv6, and SQLite3 and in-memory zone
  1975. data backends.
  1976. Normally it is started by the <command>bind10</command> master
  1977. process.
  1978. </para>
  1979. <section>
  1980. <title>Server Configurations</title>
  1981. <!-- TODO: offers command line options but not used
  1982. since we used bind10 -->
  1983. <para>
  1984. <command>b10-auth</command> is configured via the
  1985. <command>b10-cfgmgr</command> configuration manager.
  1986. The module name is <quote>Auth</quote>.
  1987. The configuration data items are:
  1988. <variablelist>
  1989. <varlistentry>
  1990. <term>database_file</term>
  1991. <listitem>
  1992. <simpara>This is an optional string to define the path to find
  1993. the SQLite3 database file.
  1994. <!-- TODO: -->
  1995. Note: This may be a temporary setting because the DNS server
  1996. can use various data source backends.
  1997. </simpara>
  1998. </listitem>
  1999. </varlistentry>
  2000. <!-- NOTE: docs pulled in verbatim from the b10-auth.xml manual page.
  2001. TODO: automate this if want this or rewrite
  2002. -->
  2003. <varlistentry>
  2004. <term>datasources</term>
  2005. <listitem>
  2006. <simpara>
  2007. <varname>datasources</varname> configures data sources.
  2008. The list items include:
  2009. <varname>type</varname> to define the required data source type
  2010. (such as <quote>memory</quote>);
  2011. <varname>class</varname> to optionally select the class
  2012. (it defaults to <quote>IN</quote>);
  2013. and
  2014. <varname>zones</varname> to define
  2015. the <varname>file</varname> path name,
  2016. the <varname>filetype</varname> (<quote>sqlite3</quote> to load
  2017. from a SQLite3 database file or <quote>text</quote> to
  2018. load from a master text file),
  2019. and the <varname>origin</varname> (default domain).
  2020. By default, this is empty.
  2021. <note><simpara>
  2022. Currently this is only used for the memory data source.
  2023. Only the IN class is supported at this time.
  2024. By default, the memory data source is disabled.
  2025. Also, currently the zone file must be canonical such as
  2026. generated by <command>named-compilezone -D</command>, or
  2027. must be an SQLite3 database.
  2028. </simpara></note>
  2029. </simpara>
  2030. </listitem>
  2031. </varlistentry>
  2032. <varlistentry>
  2033. <term>listen_on</term>
  2034. <listitem>
  2035. <simpara>
  2036. <varname>listen_on</varname> is a list of addresses and ports for
  2037. <command>b10-auth</command> to listen on.
  2038. The list items are the <varname>address</varname> string
  2039. and <varname>port</varname> number.
  2040. By default, <command>b10-auth</command> listens on port 53
  2041. on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
  2042. <note>
  2043. <simpara>
  2044. The default configuration is currently not appropriate for a multi-homed host.
  2045. In case you have multiple public IP addresses, it is possible the
  2046. query UDP packet comes through one interface and the answer goes out
  2047. through another. The answer will probably be dropped by the client, as it
  2048. has a different source address than the one it sent the query to. The
  2049. client would fallback on TCP after several attempts, which works
  2050. well in this situation, but is clearly not ideal.
  2051. </simpara>
  2052. <simpara>
  2053. There are plans to solve the problem such that the server handles
  2054. it by itself. But until it is actually implemented, it is recommended to
  2055. alter the configuration &mdash; remove the wildcard addresses and list all
  2056. addresses explicitly. Then the server will answer on the same
  2057. interface the request came on, preserving the correct address.
  2058. </simpara>
  2059. </note>
  2060. </simpara>
  2061. </listitem>
  2062. </varlistentry>
  2063. <varlistentry>
  2064. <term>tcp_recv_timeout</term>
  2065. <listitem>
  2066. <simpara>
  2067. <varname>tcp_recv_timeout</varname> is the timeout used on
  2068. incoming TCP connections, in milliseconds. If the query
  2069. is not sent within this time, the connection is closed.
  2070. Setting this to 0 will disable TCP timeouts completely.
  2071. </simpara>
  2072. </listitem>
  2073. </varlistentry>
  2074. </variablelist>
  2075. </para>
  2076. <para>
  2077. The configuration commands are:
  2078. <variablelist>
  2079. <varlistentry>
  2080. <term>loadzone</term>
  2081. <listitem>
  2082. <simpara>
  2083. <command>loadzone</command> tells <command>b10-auth</command>
  2084. to load or reload a zone file. The arguments include:
  2085. <varname>class</varname> which optionally defines the class
  2086. (it defaults to <quote>IN</quote>);
  2087. <varname>origin</varname> is the domain name of the zone;
  2088. and
  2089. <varname>datasrc</varname> optionally defines the type of datasource
  2090. (it defaults to <quote>memory</quote>).
  2091. <note><simpara>
  2092. Currently this only supports the
  2093. IN class and the memory data source.
  2094. </simpara></note>
  2095. </simpara>
  2096. </listitem>
  2097. </varlistentry>
  2098. <varlistentry>
  2099. <term>getstats</term>
  2100. <listitem>
  2101. <simpara>
  2102. <command>getstats</command> requests <command>b10-auth</command>
  2103. to send its statistics data to
  2104. <citerefentry><refentrytitle>b10-stats</refentrytitle>
  2105. <manvolnum>8</manvolnum></citerefentry>
  2106. as a response of the command.
  2107. </simpara>
  2108. </listitem>
  2109. </varlistentry>
  2110. <varlistentry>
  2111. <term>shutdown</term>
  2112. <listitem>
  2113. <simpara>Stop the authoritative DNS server.
  2114. This has an optional <varname>pid</varname> argument to
  2115. select the process ID to stop.
  2116. (Note that the BIND 10 boss process may restart this service
  2117. if configured.)
  2118. </simpara>
  2119. </listitem>
  2120. </varlistentry>
  2121. </variablelist>
  2122. </para>
  2123. <!-- TODO: examples of setting or running above? -->
  2124. </section>
  2125. <section id='datasrc'>
  2126. <title>Data Source Backends</title>
  2127. <para>
  2128. Bind 10 has the concept of data sources. A data source is a place
  2129. where authoritative zone data reside and where they can be served
  2130. from. This can be a master file, a database or something completely
  2131. different.
  2132. </para>
  2133. <para>
  2134. Once a query arrives, <command>b10-auth</command> goes through a
  2135. configured list of data sources and finds the one containing a best
  2136. matching zone. From the equally good ones, the first one is taken.
  2137. This data source is then used to answer the query.
  2138. </para>
  2139. <note><para>
  2140. In the current release, <command>b10-auth</command>
  2141. can serve data from a SQLite3 data source backend and from master
  2142. files.
  2143. Upcoming versions will be able to use multiple different
  2144. data sources, such as MySQL and Berkeley DB.
  2145. </para></note>
  2146. <para>
  2147. The configuration is located in data_sources/classes. Each item there
  2148. represents one RR class and a list used to answer queries for that
  2149. class. The default contains two classes. The CH class contains a static
  2150. data source &mdash; one that serves things like
  2151. <quote>AUTHORS.BIND.</quote>. The IN class contains single SQLite3
  2152. data source with database file located at
  2153. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  2154. </para>
  2155. <para>
  2156. Each data source has several options. The first one is
  2157. <varname>type</varname>, which specifies the type of data source to
  2158. use. Valid types include the ones listed below, but BIND 10 uses
  2159. dynamically loaded modules for them, so there may be more in your
  2160. case. This option is mandatory.
  2161. </para>
  2162. <para>
  2163. Another option is <varname>params</varname>. This option is type
  2164. specific; it holds different data depending on the type
  2165. above. Also, depending on the type, it could be possible to omit it.
  2166. </para>
  2167. <para>
  2168. There are two options related to the so-called cache. If you enable
  2169. cache, zone data from the data source are loaded into memory.
  2170. Then, when answering a query, <command>b10-auth</command> looks
  2171. into the memory only instead of the data source, which speeds
  2172. answering up. The first option is <varname>cache-enable</varname>,
  2173. a boolean value turning the cache on and off (off is the default).
  2174. The second one, <varname>cache-zones</varname>, is a list of zone
  2175. origins to load into in-memory.
  2176. <!-- NOT YET: http://bind10.isc.org/ticket/2240
  2177. Once the cache is enabled,
  2178. the zones in the data source not listed in
  2179. <varname>cache-zones</varname> will not be loaded and will
  2180. not be available at all.
  2181. -->
  2182. </para>
  2183. <section id='datasource-types'>
  2184. <title>Data source types</title>
  2185. <para>
  2186. As mentioned, the type used by default is <quote>sqlite3</quote>.
  2187. It has single configuration option inside <varname>params</varname>
  2188. &mdash; <varname>database_file</varname>, which contains the path
  2189. to the SQLite3 file containing the data.
  2190. </para>
  2191. <para>
  2192. Another type is called <quote>MasterFiles</quote>. This one is
  2193. slightly special. The data are stored in RFC1034 master files.
  2194. Because answering directly from them would be impractical,
  2195. this type mandates the cache to be enabled. Also, the list of
  2196. zones (<varname>cache-zones</varname>) should be omitted. The
  2197. <varname>params</varname> is a dictionary mapping from zone
  2198. origins to the files they reside in.
  2199. </para>
  2200. </section>
  2201. <section id='datasrc-examples'>
  2202. <title>Examples</title>
  2203. <para>
  2204. As this is one of the more complex configurations of BIND 10,
  2205. we show some examples. They all assume they start with default
  2206. configuration.
  2207. </para>
  2208. <para>
  2209. First, let's disable the static data source
  2210. (<quote>VERSION.BIND</quote> and friends). As it is the only
  2211. data source in the CH class, we can remove the whole class.
  2212. <screen>&gt; <userinput>config remove data_sources/classes CH</userinput>
  2213. &gt; <userinput>config commit</userinput></screen>
  2214. </para>
  2215. <para>
  2216. Another one, let's say our default data source contains zones
  2217. <quote>example.org.</quote> and <quote>example.net.</quote>.
  2218. We want them to be served from memory to make the answering
  2219. faster.
  2220. <screen>&gt; <userinput>config set data_sources/classes/IN[0]/cache-enable true</userinput>
  2221. &gt; <userinput>config add data_sources/classes/IN[0]/cache-zones example.org.</userinput>
  2222. &gt; <userinput>config add data_sources/classes/IN[0]/cache-zones example.net.</userinput>
  2223. &gt; <userinput>config commit</userinput></screen>
  2224. Now every time the zone in the data source is changed by the
  2225. operator, the authoritative server needs to be told to reload it, by
  2226. <screen>&gt; <userinput>Auth loadzone example.org</userinput></screen>
  2227. You don't need to do this when the zone is modified by
  2228. <command>b10-xfrin</command>; it does so automatically.
  2229. </para>
  2230. <para>
  2231. Now, the last example is when there are master files we want to
  2232. serve in addition to whatever is inside the SQLite3 database.
  2233. <screen>&gt; <userinput>config add data_sources/classes/IN</userinput>
  2234. &gt; <userinput>config set data_sources/classes/IN[1]/type MasterFiles</userinput>
  2235. &gt; <userinput>config set data_sources/classes/IN[1]/cache-enable true</userinput>
  2236. &gt; <userinput>config set data_sources/classes/IN[1]/params { "example.org": "/path/to/example.org", "example.com": "/path/to/example.com" }</userinput>
  2237. &gt; <userinput>config commit</userinput></screen>
  2238. Initially, a map value has to be set, but this value may be an
  2239. empty map. After that, key/value pairs can be added with 'config
  2240. add' and keys can be removed with 'config remove'. The initial
  2241. value may be an empty map, but it has to be set before zones are
  2242. added or removed.
  2243. <screen>
  2244. &gt; <userinput>config set data_sources/classes/IN[1]/params {}</userinput>
  2245. &gt; <userinput>config add data_sources/classes/IN[1]/params another.example.org /path/to/another.example.org</userinput>
  2246. &gt; <userinput>config add data_sources/classes/IN[1]/params another.example.com /path/to/another.example.com</userinput>
  2247. &gt; <userinput>config remove data_sources/classes/IN[1]/params another.example.org</userinput>
  2248. </screen>
  2249. <command>bindctl</command>. To reload a zone, you the same command
  2250. as above.
  2251. </para>
  2252. </section>
  2253. <note>
  2254. <para>
  2255. There's also <varname>Auth/database_file</varname> configuration
  2256. variable, pointing to a SQLite3 database file. This is no longer
  2257. used by <command>b10-auth</command>, but it is left in place for
  2258. now, since other modules use it. Once <command>b10-xfrin</command>,
  2259. <command>b10-xfrout</command> and <command>b10-ddns</command>
  2260. are ported to the new configuration, this will disappear. But for
  2261. now, make sure that if you use any of these modules, the new
  2262. and old configuration correspond. The defaults are consistent, so
  2263. unless you tweaked either the new or the old configuration, you're
  2264. good.
  2265. </para>
  2266. </note>
  2267. </section>
  2268. <section>
  2269. <title>Loading Master Zones Files</title>
  2270. <para>
  2271. RFC 1035 style DNS master zone files may imported
  2272. into a BIND 10 SQLite3 data source by using the
  2273. <command>b10-loadzone</command> utility.
  2274. </para>
  2275. <para>
  2276. <command>b10-loadzone</command> supports the following
  2277. special directives (control entries):
  2278. <variablelist>
  2279. <varlistentry>
  2280. <term>$INCLUDE</term>
  2281. <listitem>
  2282. <simpara>Loads an additional zone file. This may be recursive.
  2283. </simpara>
  2284. </listitem>
  2285. </varlistentry>
  2286. <varlistentry>
  2287. <term>$ORIGIN</term>
  2288. <listitem>
  2289. <simpara>Defines the relative domain name.
  2290. </simpara>
  2291. </listitem>
  2292. </varlistentry>
  2293. <varlistentry>
  2294. <term>$TTL</term>
  2295. <listitem>
  2296. <simpara>Defines the time-to-live value used for following
  2297. records that don't include a TTL.
  2298. </simpara>
  2299. </listitem>
  2300. </varlistentry>
  2301. </variablelist>
  2302. </para>
  2303. <para>
  2304. The <option>-o</option> argument may be used to define the
  2305. default origin for loaded zone file records.
  2306. </para>
  2307. <note>
  2308. <para>
  2309. In the current release, only the SQLite3 back
  2310. end is used by <command>b10-loadzone</command>.
  2311. By default, it stores the zone data in
  2312. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  2313. unless the <option>-d</option> switch is used to set the
  2314. database filename.
  2315. Multiple zones are stored in a single SQLite3 zone database.
  2316. </para>
  2317. </note>
  2318. <para>
  2319. If you reload a zone already existing in the database,
  2320. all records from that prior zone disappear and a whole new set
  2321. appears.
  2322. </para>
  2323. <!--TODO: permissions for xfrin or loadzone to create the file -->
  2324. </section>
  2325. <!--
  2326. TODO
  2327. <section>
  2328. <title>Troubleshooting</title>
  2329. <para>
  2330. </para>
  2331. </section>
  2332. -->
  2333. </chapter>
  2334. <chapter id="xfrin">
  2335. <title>Incoming Zone Transfers</title>
  2336. <para>
  2337. Incoming zones are transferred using the <command>b10-xfrin</command>
  2338. process which is started by <command>bind10</command>.
  2339. When received, the zone is stored in the corresponding BIND 10
  2340. data source, and its records can be served by
  2341. <command>b10-auth</command>.
  2342. In combination with <command>b10-zonemgr</command> (for
  2343. automated SOA checks), this allows the BIND 10 server to
  2344. provide <emphasis>secondary</emphasis> service.
  2345. </para>
  2346. <para>
  2347. The <command>b10-xfrin</command> process supports both AXFR and
  2348. IXFR. Due to some implementation limitations of the current
  2349. development release, however, it only tries AXFR by default,
  2350. and care should be taken to enable IXFR.
  2351. </para>
  2352. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  2353. <section>
  2354. <title>Configuration for Incoming Zone Transfers</title>
  2355. <para>
  2356. In practice, you need to specify a list of secondary zones to
  2357. enable incoming zone transfers for these zones (you can still
  2358. trigger a zone transfer manually, without a prior configuration
  2359. (see below)).
  2360. </para>
  2361. <para>
  2362. For example, to enable zone transfers for a zone named "example.com"
  2363. (whose master address is assumed to be 2001:db8::53 here),
  2364. run the following at the <command>bindctl</command> prompt:
  2365. <screen>&gt; <userinput>config add Xfrin/zones</userinput>
  2366. &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
  2367. &gt; <userinput>config set Xfrin/zones[0]/master_addr "<option>2001:db8::53</option>"</userinput>
  2368. &gt; <userinput>config commit</userinput></screen>
  2369. (We assume there has been no zone configuration before).
  2370. </para>
  2371. </section>
  2372. <section>
  2373. <title>Enabling IXFR</title>
  2374. <para>
  2375. As noted above, <command>b10-xfrin</command> uses AXFR for
  2376. zone transfers by default. To enable IXFR for zone transfers
  2377. for a particular zone, set the <varname>use_ixfr</varname>
  2378. configuration parameter to <quote>true</quote>.
  2379. In the above example of configuration sequence, you'll need
  2380. to add the following before performing <userinput>commit</userinput>:
  2381. <screen>&gt; <userinput>config set Xfrin/zones[0]/use_ixfr true</userinput></screen>
  2382. </para>
  2383. <!-- TODO: http://bind10.isc.org/ticket/1279 -->
  2384. <note><simpara>
  2385. One reason why IXFR is disabled by default in the current
  2386. release is because it does not support automatic fallback from IXFR to
  2387. AXFR when it encounters a primary server that doesn't support
  2388. outbound IXFR (and, not many existing implementations support
  2389. it). Another, related reason is that it does not use AXFR even
  2390. if it has no knowledge about the zone (like at the very first
  2391. time the secondary server is set up). IXFR requires the
  2392. "current version" of the zone, so obviously it doesn't work
  2393. in this situation and AXFR is the only workable choice.
  2394. The current release of <command>b10-xfrin</command> does not
  2395. make this selection automatically.
  2396. These features will be implemented in a near future
  2397. version, at which point we will enable IXFR by default.
  2398. </simpara></note>
  2399. </section>
  2400. <!-- TODO:
  2401. how to tell bind10 you are a secondary?
  2402. when will it first attempt to check for new zone? (using REFRESH?)
  2403. what if zonemgr is not running?
  2404. what if a NOTIFY is sent?
  2405. -->
  2406. <section id="zonemgr">
  2407. <title>Secondary Manager</title>
  2408. <para>
  2409. The <command>b10-zonemgr</command> process is started by
  2410. <command>bind10</command>.
  2411. It keeps track of SOA refresh, retry, and expire timers
  2412. and other details for BIND 10 to perform as a slave.
  2413. When the <command>b10-auth</command> authoritative DNS server
  2414. receives a NOTIFY message, <command>b10-zonemgr</command>
  2415. may tell <command>b10-xfrin</command> to do a refresh
  2416. to start an inbound zone transfer.
  2417. The secondary manager resets its counters when a new zone is
  2418. transferred in.
  2419. </para>
  2420. <note><simpara>
  2421. Access control (such as allowing notifies) is not yet provided.
  2422. The primary/secondary service is not yet complete.
  2423. </simpara></note>
  2424. <para>
  2425. The following example shows using <command>bindctl</command>
  2426. to configure the server to be a secondary for the example zone:
  2427. <screen>&gt; <userinput>config add Zonemgr/secondary_zones</userinput>
  2428. &gt; <userinput>config set Zonemgr/secondary_zones[0]/name "<option>example.com</option>"</userinput>
  2429. &gt; <userinput>config commit</userinput></screen>
  2430. </para>
  2431. <para>
  2432. If the zone does not exist in the data source already
  2433. (i.e. no SOA record for it), <command>b10-zonemgr</command>
  2434. will automatically tell <command>b10-xfrin</command>
  2435. to transfer the zone in.
  2436. </para>
  2437. </section>
  2438. <section>
  2439. <title>Trigger an Incoming Zone Transfer Manually</title>
  2440. <para>
  2441. To manually trigger a zone transfer to retrieve a remote zone,
  2442. you may use the <command>bindctl</command> utility.
  2443. For example, at the <command>bindctl</command> prompt run:
  2444. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  2445. </para>
  2446. </section>
  2447. <section>
  2448. <title>Incoming Transfers with In-memory Datasource</title>
  2449. <para>
  2450. In the case of an incoming zone transfer, the received zone is
  2451. first stored in the corresponding BIND 10 datasource. In
  2452. case the secondary zone is served by an in-memory datasource
  2453. with an SQLite3 backend, <command>b10-auth</command> is
  2454. automatically sent a <varname>loadzone</varname> command to
  2455. reload the corresponding zone into memory from the backend.
  2456. </para>
  2457. <!-- TODO: currently it delays the queries; see
  2458. http://bind10.isc.org/wiki/ScalableZoneLoadDesign#a7.2UpdatingaZone
  2459. -->
  2460. <para>
  2461. The administrator doesn't have to do anything for
  2462. <command>b10-auth</command> to serve the new version of the
  2463. zone, except for the configuration such as the one described in
  2464. <xref linkend="datasrc" />.
  2465. </para>
  2466. </section>
  2467. <!-- TODO: can that retransfer be used to identify a new zone? -->
  2468. <!-- TODO: what if doesn't exist at that master IP? -->
  2469. </chapter>
  2470. <chapter id="xfrout">
  2471. <title>Outbound Zone Transfers</title>
  2472. <para>
  2473. The <command>b10-xfrout</command> process is started by
  2474. <command>bind10</command>.
  2475. When the <command>b10-auth</command> authoritative DNS server
  2476. receives an AXFR or IXFR request, <command>b10-auth</command>
  2477. internally forwards the request to <command>b10-xfrout</command>,
  2478. which handles the rest of this request processing.
  2479. This is used to provide primary DNS service to share zones
  2480. to secondary name servers.
  2481. The <command>b10-xfrout</command> is also used to send
  2482. NOTIFY messages to secondary servers.
  2483. </para>
  2484. <para>
  2485. A global or per zone <option>transfer_acl</option> configuration
  2486. can be used to control accessibility of the outbound zone
  2487. transfer service.
  2488. By default, <command>b10-xfrout</command> allows any clients to
  2489. perform zone transfers for any zones.
  2490. </para>
  2491. <screen>&gt; <userinput>config show Xfrout/transfer_acl</userinput>
  2492. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</screen>
  2493. <para>
  2494. If you want to require TSIG in access control, a system wide TSIG
  2495. key ring must be configured (see <xref linkend="tsig-key-ring"/>).
  2496. In this example, we allow client matching both the IP address
  2497. and key.
  2498. </para>
  2499. <screen>&gt; <userinput>config set tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</userinput>
  2500. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]</userinput>
  2501. &gt; <userinput>config commit</userinput></screen>
  2502. <para>Both <command>b10-xfrout</command> and <command>b10-auth</command>
  2503. will use the system wide key ring to check
  2504. TSIGs in the incoming messages and to sign responses.</para>
  2505. <para>
  2506. For further details on ACL configuration, see
  2507. <xref linkend="common-acl" />.
  2508. </para>
  2509. <note><simpara>
  2510. The way to specify zone specific configuration (ACLs, etc) is
  2511. likely to be changed.
  2512. </simpara></note>
  2513. <!--
  2514. TODO:
  2515. xfrout section:
  2516. auth servers checks for AXFR query
  2517. sends the XFR query to the xfrout module
  2518. uses /tmp/auth_xfrout_conn which is a socket
  2519. what is XfroutClient xfr_client??
  2520. /tmp/auth_xfrout_conn is not removed
  2521. -->
  2522. </chapter>
  2523. <chapter id="ddns">
  2524. <title>Dynamic DNS Update</title>
  2525. <para>
  2526. BIND 10 supports the server side of the Dynamic DNS Update
  2527. (DDNS) protocol as defined in RFC 2136.
  2528. This service is provided by the <command>b10-ddns</command>
  2529. component, which is started by the <command>bind10</command>
  2530. process if configured so.
  2531. </para>
  2532. <para>
  2533. When the <command>b10-auth</command> authoritative DNS server
  2534. receives an UPDATE request, it internally forwards the request
  2535. to <command>b10-ddns</command>, which handles the rest of
  2536. this request processing.
  2537. When the processing is completed, <command>b10-ddns</command>
  2538. will send a response to the client as specified in RFC 2136
  2539. (NOERROR for successful update, REFUSED if rejected due to
  2540. ACL check, etc).
  2541. If the zone has been changed as a result, it will internally
  2542. notify <command>b10-xfrout</command> so that other secondary
  2543. servers will be notified via the DNS NOTIFY protocol.
  2544. In addition, if <command>b10-auth</command> serves the updated
  2545. zone (as described in
  2546. <xref linkend="datasrc" />),
  2547. <command>b10-ddns</command> will also
  2548. notify <command>b10-auth</command> so that <command>b10-auth</command>
  2549. will re-cache the updated zone content if necessary.
  2550. </para>
  2551. <para>
  2552. The <command>b10-ddns</command> component supports requests over
  2553. both UDP and TCP, and both IPv6 and IPv4; for TCP requests,
  2554. however, it terminates the TCP connection immediately after
  2555. each single request has been processed. Clients cannot reuse the
  2556. same TCP connection for multiple requests. (This is a current
  2557. implementation limitation of <command>b10-ddns</command>.
  2558. While RFC 2136 doesn't specify anything about such reuse of TCP
  2559. connection, there is no reason for disallowing it as RFC 1035
  2560. generally allows multiple requests sent over a single TCP
  2561. connection. BIND 9 supports such reuse.)
  2562. </para>
  2563. <para>
  2564. As of this writing <command>b10-ddns</command> does not support
  2565. update forwarding for secondary zones.
  2566. If it receives an update request for a secondary zone, it will
  2567. immediately return a <quote>not implemented</quote> response.
  2568. <note><simpara>
  2569. For feature completeness, update forwarding should be
  2570. eventually supported. But currently it's considered a lower
  2571. priority task and there is no specific plan of implementing
  2572. this feature.
  2573. <!-- See Trac #2063 -->
  2574. </simpara></note>
  2575. </para>
  2576. <section>
  2577. <title>Enabling Dynamic Update</title>
  2578. <para>
  2579. First off, it must be made sure that a few components on which
  2580. <command>b10-ddns</command> depends are configured to run,
  2581. which are <command>b10-auth</command>
  2582. and <command>b10-zonemgr</command>.
  2583. In addition, <command>b10-xfrout</command> should also be
  2584. configured to run; otherwise the notification after an update
  2585. (see above) will fail with a timeout, suspending the DDNS
  2586. service while <command>b10-ddns</command> waits for the
  2587. response (see the description of the <ulink
  2588. url="bind10-messages.html#DDNS_UPDATE_NOTIFY_FAIL">DDNS_UPDATE_NOTIFY_FAIL</ulink>
  2589. log message for further details).
  2590. If BIND 10 is already configured to provide authoritative DNS
  2591. service they should normally be configured to run already.
  2592. </para>
  2593. <para>
  2594. Second, for the obvious reason dynamic update requires that the
  2595. underlying data source storing the zone data be writable.
  2596. In the current implementation this means the zone must be stored
  2597. in an SQLite3-based data source.
  2598. <!-- TODO -->
  2599. Also, in this current version, the <command>b10-ddns</command>
  2600. component configures itself with the data source referring to the
  2601. <varname>database_file</varname> configuration parameter of
  2602. <command>b10-auth</command>.
  2603. So this information must be configured correctly before starting
  2604. <command>b10-ddns</command>.
  2605. <note><simpara>
  2606. The way to configure data sources is now being revised.
  2607. Configuration on the data source for DDNS will be very
  2608. likely to be changed in a backward incompatible manner in
  2609. a near future version.
  2610. </simpara></note>
  2611. </para>
  2612. <para>
  2613. In general, if something goes wrong regarding the dependency
  2614. described above, <command>b10-ddns</command> will log the
  2615. related event at the warning or error level.
  2616. It's advisable to check the log message when you first enable
  2617. DDNS or if it doesn't work as you expect to see if there's any
  2618. warning or error log message.
  2619. </para>
  2620. <para>
  2621. Next, to enable the DDNS service, <command>b10-ddns</command>
  2622. needs to be explicitly configured to run.
  2623. It can be done by using the <command>bindctl</command>
  2624. utility. For example:
  2625. <screen>
  2626. &gt; <userinput>config add Boss/components b10-ddns</userinput>
  2627. &gt; <userinput>config set Boss/components/b10-ddns/address DDNS</userinput>
  2628. &gt; <userinput>config set Boss/components/b10-ddns/kind dispensable</userinput>
  2629. &gt; <userinput>config commit</userinput>
  2630. </screen>
  2631. <note><simpara>
  2632. In theory <varname>kind</varname> could be omitted because
  2633. "dispensable" is its default.
  2634. But there's some peculiar behavior (which should be a
  2635. bug and should be fixed eventually; see Trac ticket #2064)
  2636. with <command>bindctl</command> and you'll still need to
  2637. specify that explicitly. Likewise, <varname>address</varname>
  2638. may look unnecessary because <command>b10-ddns</command>
  2639. would start and work without specifying it. But for it
  2640. to shutdown gracefully this parameter should also be
  2641. specified.
  2642. </simpara></note>
  2643. </para>
  2644. </section>
  2645. <section>
  2646. <title>Access Control</title>
  2647. <para>
  2648. By default, <command>b10-ddns</command> rejects any update
  2649. requests from any clients by returning a REFUSED response.
  2650. To allow updates to take effect, an access control rule
  2651. (called update ACL) with a policy allowing updates must explicitly be
  2652. configured.
  2653. Update ACL must be configured per zone basis in the
  2654. <varname>zones</varname> configuration parameter of
  2655. <command>b10-ddns</command>.
  2656. This is a list of per-zone configurations regarding DDNS.
  2657. Each list element consists of the following parameters:
  2658. <variablelist>
  2659. <varlistentry>
  2660. <term>origin</term>
  2661. <listitem>
  2662. <simpara>The zone's origin name</simpara>
  2663. </listitem>
  2664. </varlistentry>
  2665. <varlistentry>
  2666. <term>class</term>
  2667. <listitem>
  2668. <simpara>The RR class of the zone
  2669. (normally <quote>IN</quote>, and in that case
  2670. can be omitted in configuration)</simpara>
  2671. </listitem>
  2672. </varlistentry>
  2673. <varlistentry>
  2674. <term>update_acl</term>
  2675. <listitem>
  2676. <simpara>List of access control rules (ACL) for the zone</simpara>
  2677. </listitem>
  2678. </varlistentry>
  2679. </variablelist>
  2680. The syntax of the ACL is the same as ACLs for other
  2681. components.
  2682. Specific examples are given below.
  2683. </para>
  2684. <para>
  2685. In general, an update ACL rule that allows an update request
  2686. should be configured with a TSIG key.
  2687. This is an example update ACL that allows updates to the zone
  2688. named <quote>example.org</quote> (of default RR class <quote>IN</quote>)
  2689. from clients that send requests signed with a TSIG whose
  2690. key name is "key.example.org" (and refuses all others):
  2691. <screen>
  2692. &gt; <userinput>config add DDNS/zones</userinput>
  2693. &gt; <userinput>config set DDNS/zones[0]/origin example.org</userinput>
  2694. &gt; <userinput>config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "key.example.org"}</userinput>
  2695. &gt; <userinput>config commit</userinput>
  2696. </screen>
  2697. The TSIG key must be configured system wide
  2698. (see <xref linkend="common-tsig"/>).
  2699. </para>
  2700. <para>
  2701. The full description of ACLs can be found in <xref
  2702. linkend="common-acl" />.
  2703. </para>
  2704. <note><simpara>
  2705. The <command>b10-ddns</command> component accepts an ACL
  2706. rule that just allows updates from a specific IP address
  2707. (i.e., without requiring TSIG), but this is highly
  2708. discouraged (remember that requests can be made over UDP and
  2709. spoofing the source address of a UDP packet is often pretty
  2710. easy).
  2711. Unless you know what you are doing and that you can accept
  2712. its consequence, any update ACL rule that allows updates
  2713. should have a TSIG key in its constraints.
  2714. </simpara></note>
  2715. <para>
  2716. Currently update ACL can only control updates per zone basis;
  2717. it's not possible to specify access control with higher
  2718. granularity such as for particular domain names or specific
  2719. types of RRs.
  2720. <!-- See Trac ticket #2065 -->
  2721. </para>
  2722. <note><simpara>
  2723. Contrary to what RFC 2136 (literally) specifies,
  2724. <command>b10-ddns</command> checks the update ACL before
  2725. checking the prerequisites of the update request.
  2726. This is a deliberate implementation decision.
  2727. This counter intuitive specification has been repeatedly
  2728. discussed among implementers and in the IETF, and it is now
  2729. widely agreed that it does not make sense to strictly follow
  2730. that part of RFC.
  2731. One known specific bad result of following the RFC is that it
  2732. could leak information about which name or record exists or does not
  2733. exist in the zone as a result of prerequisite checks even if a
  2734. zone is somehow configured to reject normal queries from
  2735. arbitrary clients.
  2736. There have been other troubles that could have been avoided if
  2737. the ACL could be checked before the prerequisite check.
  2738. </simpara></note>
  2739. </section>
  2740. <section>
  2741. <title>Miscellaneous Operational Issues</title>
  2742. <para>
  2743. Unlike BIND 9, BIND 10 currently does not support automatic
  2744. re-signing of DNSSEC-signed zone when it's updated via DDNS.
  2745. It could be possible to re-sign the updated zone afterwards
  2746. or make sure the update request also updates related DNSSEC
  2747. records, but that will be pretty error-prone operation.
  2748. In general, it's not advisable to allow DDNS for a signed zone
  2749. at this moment.
  2750. </para>
  2751. <para>
  2752. Also unlike BIND 9, it's currently not possible
  2753. to <quote>freeze</quote> a zone temporarily in order to
  2754. suspend DDNS while you manually update the zone.
  2755. If you need to make manual updates to a dynamic zone,
  2756. you'll need to temporarily reject any updates to the zone via
  2757. the update ACLs.
  2758. </para>
  2759. <para>
  2760. Dynamic updates are only applicable to primary zones.
  2761. In order to avoid updating secondary zones via DDNS requests,
  2762. <command>b10-ddns</command> refers to the
  2763. <quote>secondary_zones</quote> configuration of
  2764. <command>b10-zonemgr</command>. Zones listed in
  2765. <quote>secondary_zones</quote> will never be updated via DDNS
  2766. regardless of the update ACL configuration;
  2767. <command>b10-ddns</command> will return a NOTAUTH (server
  2768. not authoritative for the zone) response.
  2769. If you have a "conceptual" secondary zone whose content is a
  2770. copy of some external source but is not updated via the
  2771. standard zone transfers and therefore not listed in
  2772. <quote>secondary_zones</quote>, be careful not to allow DDNS
  2773. for the zone; it would be quite likely to lead to inconsistent
  2774. state between different servers.
  2775. Normally this should not be a problem because the default
  2776. update ACL rejects any update requests, but you may want to
  2777. take an extra care about the configuration if you have such
  2778. type of secondary zones.
  2779. </para>
  2780. <para>
  2781. The difference of two versions of a zone, before and after a
  2782. DDNS transaction, is automatically recorded in the underlying
  2783. data source, and can be retrieved in the form of outbound
  2784. IXFR.
  2785. This is done automatically; it does not require specific
  2786. configuration to make this possible.
  2787. </para>
  2788. </section>
  2789. </chapter>
  2790. <chapter id="resolverserver">
  2791. <title>Recursive Name Server</title>
  2792. <para>
  2793. The <command>b10-resolver</command> process is started by
  2794. <command>bind10</command>.
  2795. <!-- TODO
  2796. It provides a resolver so DNS clients can ask it to do recursion
  2797. and it will return answers.
  2798. -->
  2799. </para>
  2800. <para>
  2801. The main <command>bind10</command> process can be configured
  2802. to select to run either the authoritative or resolver or both.
  2803. By default, it doesn't start either one. You may change this using
  2804. <command>bindctl</command>, for example:
  2805. <screen>
  2806. &gt; <userinput>config add Boss/components b10-resolver</userinput>
  2807. &gt; <userinput>config set Boss/components/b10-resolver/special resolver</userinput>
  2808. &gt; <userinput>config set Boss/components/b10-resolver/kind needed</userinput>
  2809. &gt; <userinput>config set Boss/components/b10-resolver/priority 10</userinput>
  2810. &gt; <userinput>config commit</userinput>
  2811. </screen>
  2812. </para>
  2813. <para>
  2814. The master <command>bind10</command> will stop and start
  2815. the desired services.
  2816. </para>
  2817. <para>
  2818. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  2819. The following example shows how it can be configured to
  2820. listen on an additional address (and port):
  2821. <screen>
  2822. &gt; <userinput>config add Resolver/listen_on</userinput>
  2823. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
  2824. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
  2825. &gt; <userinput>config commit</userinput>
  2826. </screen>
  2827. </para>
  2828. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  2829. as needed; run <quote><userinput>config show
  2830. Resolver/listen_on</userinput></quote> if needed.)</simpara>
  2831. <!-- TODO: this example should not include the port, ticket #1185 -->
  2832. <section>
  2833. <title>Access Control</title>
  2834. <para>
  2835. By default, the <command>b10-resolver</command> daemon only accepts
  2836. DNS queries from the localhost (127.0.0.1 and ::1).
  2837. The <option>Resolver/query_acl</option> configuration may
  2838. be used to reject, drop, or allow specific IPs or networks.
  2839. See <xref linkend="common-acl" />.
  2840. </para>
  2841. <para>
  2842. The following session is an example of extending the ACL to also
  2843. allow queries from 192.0.2.0/24:
  2844. <screen>
  2845. > <userinput>config show Resolver/query_acl</userinput>
  2846. Resolver/query_acl[0] {"action": "ACCEPT", "from": "127.0.0.1"} any (default)
  2847. Resolver/query_acl[1] {"action": "ACCEPT", "from": "::1"} any (default)
  2848. > <userinput>config add Resolver/query_acl</userinput>
  2849. > <userinput>config set Resolver/query_acl[2] {"action": "ACCEPT", "from": "192.0.2.0/24"}</userinput>
  2850. > <userinput>config add Resolver/query_acl</userinput>
  2851. > <userinput>config show Resolver/query_acl</userinput>
  2852. Resolver/query_acl[0] {"action": "ACCEPT", "from": "127.0.0.1"} any (modified)
  2853. Resolver/query_acl[1] {"action": "ACCEPT", "from": "::1"} any (modified)
  2854. Resolver/query_acl[2] {"action": "ACCEPT", "from": "192.0.2.0/24"} any (modified)
  2855. Resolver/query_acl[3] {"action": "REJECT"} any (modified)
  2856. > <userinput>config commit</userinput></screen>
  2857. Note that we didn't set the value of the last final rule
  2858. (query_acl[3]) -- in the case of resolver, rejecting all queries is
  2859. the default value of a new rule. In fact, this rule can even be
  2860. omitted completely, as the default, when a query falls off the list,
  2861. is rejection.
  2862. </para>
  2863. </section>
  2864. <section>
  2865. <title>Forwarding</title>
  2866. <para>
  2867. To enable forwarding, the upstream address and port must be
  2868. configured to forward queries to, such as:
  2869. <screen>
  2870. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  2871. &gt; <userinput>config commit</userinput>
  2872. </screen>
  2873. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  2874. full resolver.)
  2875. </para>
  2876. <para>
  2877. Normal iterative name service can be re-enabled by clearing the
  2878. forwarding address(es); for example:
  2879. <screen>
  2880. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  2881. &gt; <userinput>config commit</userinput>
  2882. </screen>
  2883. </para>
  2884. </section>
  2885. <!-- TODO: later try this
  2886. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  2887. > config set Resolver/forward_addresses[0]/port 53
  2888. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  2889. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  2890. -->
  2891. </chapter>
  2892. <chapter id="dhcp4">
  2893. <title>DHCPv4 Server</title>
  2894. <para>Dynamic Host Configuration Protocol for IPv4 (DHCP or
  2895. DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  2896. are protocols that allow one node (server) to provision
  2897. configuration parameters to many hosts and devices (clients). To
  2898. ease deployment in larger networks, additional nodes (relays) may
  2899. be deployed that facilitate communication between servers and
  2900. clients. Even though principles of both DHCPv4 and DHCPv6 are
  2901. somewhat similar, these are two radically different
  2902. protocols. BIND 10 offers server implementations for both DHCPv4
  2903. and DHCPv6. This chapter is about DHCP for IPv4. For a description
  2904. of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para>
  2905. <para>The DHCPv4 server component is currently under intense
  2906. development. You may want to check out <ulink
  2907. url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
  2908. and recent posts on <ulink
  2909. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
  2910. developers mailing list</ulink>.</para>
  2911. <para>The DHCPv4 and DHCPv6 components in BIND 10 architecture are
  2912. internally code named <quote>Kea</quote>.</para>
  2913. <note>
  2914. <para>
  2915. As of November 2012, the DHCPv4 component is a
  2916. skeleton server. That means that while it is capable of
  2917. performing DHCP configuration, it is not fully functional.
  2918. In particular, it does not have a functional lease
  2919. database. This means that they will assign the same, fixed,
  2920. hardcoded addresses to any client that will ask. See <xref
  2921. linkend="dhcp4-limit"/> for a
  2922. detailed description.
  2923. </para>
  2924. </note>
  2925. <section id="dhcp4-usage">
  2926. <title>DHCPv4 Server Usage</title>
  2927. <para>BIND 10 has provided the DHCPv4 server component since December
  2928. 2011. It is a skeleton server and can be described as an early
  2929. prototype that is not fully functional yet. It is mature enough
  2930. to conduct first tests in lab environment, but it has
  2931. significant limitations. See <xref linkend="dhcp4-limit"/> for
  2932. details.
  2933. </para>
  2934. <para>
  2935. <command>b10-dhcp4</command> is a BIND 10 component and is being
  2936. run under BIND 10 framework. To add a DHCPv4 process to the set of running
  2937. BIND 10 services, you can use following commands in <command>bindctl</command>:
  2938. <screen>&gt; <userinput>config add Boss/components b10-dhcp4</userinput>
  2939. &gt; <userinput>config set Boss/components/b10-dhcp4/kind dispensable</userinput>
  2940. &gt; <userinput>config commit</userinput></screen></para>
  2941. <para>
  2942. To stop running <command>b10-dhcp4</command>, please use the
  2943. following command:
  2944. <screen>&gt; <userinput>config remove Boss/components b10-dhcp4</userinput>
  2945. &gt; <userinput>config commit</userinput></screen></para>
  2946. <para>
  2947. During start-up the server will detect available network interfaces
  2948. and will attempt to open UDP sockets on all interfaces that
  2949. are up, running, are not loopback, and have IPv4 address
  2950. assigned.
  2951. The server will then listen to incoming traffic. Currently
  2952. supported client messages are DISCOVER and REQUEST. The server
  2953. will respond to them with OFFER and ACK, respectively.
  2954. Since the DHCPv4 server opens privileged ports, it requires root
  2955. access. Make sure you run this daemon as root.
  2956. </para>
  2957. </section>
  2958. <section id="dhcp4-config">
  2959. <title>DHCPv4 Server Configuration</title>
  2960. <para>
  2961. The DHCPv4 server does not have a lease database implemented yet
  2962. nor any support for configuration, so the same set
  2963. of configuration options (including the same fixed address)
  2964. will be assigned every time.
  2965. </para>
  2966. <para>
  2967. At this stage of development, the only way to alter the server
  2968. configuration is to modify its source code. To do so, please
  2969. edit src/bin/dhcp4/dhcp4_srv.cc file and modify following
  2970. parameters and recompile:
  2971. <screen>
  2972. const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
  2973. const std::string HARDCODED_NETMASK = "255.255.255.0";
  2974. const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds
  2975. const std::string HARDCODED_GATEWAY = "192.0.2.1";
  2976. const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
  2977. const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
  2978. const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
  2979. Lease database and configuration support is planned for 2012.
  2980. </para>
  2981. </section>
  2982. <section id="dhcp4-std">
  2983. <title>Supported standards</title>
  2984. <para>The following standards and draft standards are currently
  2985. supported:</para>
  2986. <itemizedlist>
  2987. <listitem>
  2988. <simpara>RFC2131: Supported messages are DISCOVER, OFFER,
  2989. REQUEST, and ACK.</simpara>
  2990. </listitem>
  2991. <listitem>
  2992. <simpara>RFC2132: Supported options are: PAD (0),
  2993. END(255), Message Type(53), DHCP Server Identifier (54),
  2994. Domain Name (15), DNS Servers (6), IP Address Lease Time
  2995. (51), Subnet mask (1), and Routers (3).</simpara>
  2996. </listitem>
  2997. </itemizedlist>
  2998. </section>
  2999. <section id="dhcp4-limit">
  3000. <title>DHCPv4 Server Limitations</title>
  3001. <para>These are the current limitations of the DHCPv4 server
  3002. software. Most of them are reflections of the early stage of
  3003. development and should be treated as <quote>not implemented
  3004. yet</quote>, rather than actual limitations.</para>
  3005. <itemizedlist>
  3006. <listitem>
  3007. <simpara>During initial IPv4 node configuration, the
  3008. server is expected to send packets to a node that does not
  3009. have IPv4 address assigned yet. The server requires
  3010. certain tricks (or hacks) to transmit such packets. This
  3011. is not implemented yet, therefore DHCPv4 server supports
  3012. relayed traffic only (that is, normal point to point
  3013. communication).</simpara>
  3014. </listitem>
  3015. <listitem>
  3016. <simpara><command>b10-dhcp4</command> provides a single,
  3017. fixed, hardcoded lease to any client that asks. There is
  3018. no lease manager implemented. If two clients request
  3019. addresses, they will both get the same fixed
  3020. address.</simpara>
  3021. </listitem>
  3022. <listitem>
  3023. <simpara><command>b10-dhcp4</command> does not support any
  3024. configuration mechanisms yet. The whole configuration is
  3025. currently hardcoded. The only way to tweak configuration
  3026. is to directly modify source code. See see <xref
  3027. linkend="dhcp4-config"/> for details.</simpara>
  3028. </listitem>
  3029. <listitem>
  3030. <simpara>Upon start, the server will open sockets on all
  3031. interfaces that are not loopback, are up and running and
  3032. have IPv4 address.</simpara>
  3033. </listitem>
  3034. <listitem>
  3035. <simpara>PRL (Parameter Request List, a list of options
  3036. requested by a client) is currently ignored and server
  3037. assigns DNS SERVER and DOMAIN NAME options.</simpara>
  3038. </listitem>
  3039. <listitem>
  3040. <simpara><command>b10-dhcp4</command> does not support
  3041. BOOTP. That is a design choice. This limitation is
  3042. permanent. If you have legacy nodes that can't use DHCP and
  3043. require BOOTP support, please use the latest version of ISC DHCP
  3044. via <ulink url="http://www.isc.org/software/dhcp"/>.</simpara>
  3045. </listitem>
  3046. <listitem>
  3047. <simpara>Interface detection is currently working on Linux
  3048. only. See <xref linkend="iface-detect"/> for details.</simpara>
  3049. </listitem>
  3050. <listitem>
  3051. <simpara><command>b10-dhcp4</command> does not verify that
  3052. assigned address is unused. According to RFC2131, the
  3053. allocating server should verify that address is no used by
  3054. sending ICMP echo request.</simpara>
  3055. </listitem>
  3056. <listitem>
  3057. <simpara>Address renewal (RENEW), rebinding (REBIND),
  3058. confirmation (CONFIRM), duplication report (DECLINE) and
  3059. release (RELEASE) are not supported yet.</simpara>
  3060. </listitem>
  3061. <listitem>
  3062. <simpara>DNS Update is not supported yet.</simpara>
  3063. </listitem>
  3064. <listitem>
  3065. <simpara>-v (verbose) command line option is currently
  3066. the default, and cannot be disabled.</simpara>
  3067. </listitem>
  3068. </itemizedlist>
  3069. </section>
  3070. </chapter>
  3071. <chapter id="dhcp6">
  3072. <title>DHCPv6 Server</title>
  3073. <para>The Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is
  3074. specified in RFC3315. BIND 10 provides a DHCPv6 server implementation
  3075. that is described in this chapter. For a description of the DHCPv4
  3076. server implementation, see <xref linkend="dhcp4"/>.
  3077. </para>
  3078. <para>The DHCPv6 server component is currently under intense
  3079. development. You may want to check out <ulink
  3080. url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
  3081. and recent posts on <ulink
  3082. url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
  3083. developers mailing list</ulink>.</para>
  3084. <note>
  3085. <para>
  3086. As of November 2012, the DHCPv6 component is partially functioning,
  3087. having the following capabilities:
  3088. </para>
  3089. <itemizedlist>
  3090. <listitem>
  3091. <simpara>DHCPv6 server able to allocate leases (but not renew them).</simpara>
  3092. </listitem>
  3093. <listitem>
  3094. <simpara>Some configuration available through the BIND 10 configuration mechanism.</simpara>
  3095. </listitem>
  3096. <listitem>
  3097. <simpara>Lease storage in a MySQL database.</simpara>
  3098. </listitem>
  3099. </itemizedlist>
  3100. </note>
  3101. <section id="dhcp6-install">
  3102. <title>DHCPv6 Server Build and Installation</title>
  3103. <para>
  3104. DHCPv6 is part of the BIND 10 suite of programs and is built as part of
  3105. the build of BIND 10. With the use of MySQL, some additional
  3106. installation steps are needed:
  3107. </para>
  3108. <section>
  3109. <title>Install MySQL</title>
  3110. <para>
  3111. Install MySQL according to the instructions for your system. The client development
  3112. libraries must be installed.
  3113. </para>
  3114. </section>
  3115. <section>
  3116. <title>Build and Install BIND 10</title>
  3117. <para>
  3118. Build and install BIND 10 as described in <xref linkend="installation"/>, with
  3119. the following modification: to enable the MySQL database code, the
  3120. "configure" step (see <xref linkend="configure"/>), specify the location of the
  3121. MySQL configuration program "mysql_config" with the "--with-mysql-config" switch,
  3122. i.e.
  3123. <screen><userinput>./configure [other-options] --with-dhcp-mysql</userinput></screen>
  3124. ...if MySQL was installed in the default location, or:
  3125. <screen><userinput>./configure [other-options] --with-dhcp-mysql=<replaceable>&lt;path-to-mysql_config&gt;</replaceable></userinput></screen>
  3126. ...if not.
  3127. </para>
  3128. </section>
  3129. <section>
  3130. <title>Create MySQL Database and BIND 10 User</title>
  3131. <para>
  3132. The next task is to create both the DHCPv6 lease database and the user under which the DHCPv6 server will
  3133. access it. Although the intention is to have the name of the database and the user configurable,
  3134. at the moment they are hard-coded as "kea", as is the associated password. ("kea" is an internal
  3135. code name for BIND 10 DHCP.) There are a number of steps required:
  3136. </para>
  3137. <para>
  3138. 1. Log into MySQL as "root":
  3139. <screen>$ <userinput>mysql -u root -p</userinput>
  3140. Enter password:<userinput/>
  3141. :<userinput/>
  3142. mysql></screen>
  3143. </para>
  3144. <para>
  3145. 2. Create the database:
  3146. <screen>mysql> <userinput>CREATE DATABASE kea;</userinput></screen>
  3147. </para>
  3148. <para>
  3149. 3. Create the database tables:
  3150. <screen>mysql> <userinput>CONNECT kea;</userinput>
  3151. mysql> <userinput>SOURCE <replaceable>&lt;path-to-bind10&gt;</replaceable>/share/bind10-devel/dhcpdb_create.mysql</userinput></screen>
  3152. </para>
  3153. <para>
  3154. 4. Create the user under which BIND 10 will access the database and grant it access to the database tables:
  3155. <screen>mysql> <userinput>CREATE USER 'kea'@'localhost' IDENTIFIED BY 'kea';</userinput>
  3156. mysql> <userinput>GRANT ALL ON kea.* TO 'kea'@'localhost';</userinput></screen>
  3157. </para>
  3158. <para>
  3159. 5. Exit MySQL:
  3160. <screen>mysql> <userinput>quit</userinput>
  3161. Bye<userinput/>
  3162. $</screen>
  3163. </para>
  3164. </section>
  3165. </section>
  3166. <section id="dhcp6-usage">
  3167. <title>DHCPv6 Server Usage</title>
  3168. <para>
  3169. <command>b10-dhcp6</command> is a BIND 10 component and is being
  3170. run under BIND 10 framework. To add a DHCPv6 process to the set of running
  3171. BIND 10 services, you can use following commands in <command>bindctl</command>:
  3172. <screen>&gt; <userinput>config add Boss/components b10-dhcp6</userinput>
  3173. &gt; <userinput>config set Boss/components/b10-dhcp6/kind dispensable</userinput>
  3174. &gt; <userinput>config commit</userinput></screen>
  3175. </para>
  3176. <para>
  3177. To stop running <command>b10-dhcp6</command>, use the
  3178. following command:
  3179. <screen>&gt; <userinput>config remove Boss/components b10-dhcp6</userinput>
  3180. &gt; <userinput>config commit</userinput></screen>
  3181. </para>
  3182. <para>
  3183. During start-up the server will detect available network interfaces
  3184. and will attempt to open UDP sockets on all interfaces that
  3185. are up, running, are not loopback, are multicast-capable, and
  3186. have IPv6 address assigned. It will then listen to incoming traffic. The
  3187. currently supported client messages are SOLICIT and REQUEST. The server
  3188. will respond to them with ADVERTISE and REPLY, respectively.
  3189. </para>
  3190. <para>
  3191. Since the DHCPv6 server opens privileged ports, it requires root
  3192. access. Make sure you run this daemon as root.
  3193. </para>
  3194. </section>
  3195. <section id="dhcp6-config">
  3196. <title>DHCPv6 Server Configuration</title>
  3197. <para>
  3198. Once the server has been started, it can be configured. To view the
  3199. current configuration, use the following command in <command>bindctl</command>:
  3200. <screen>&gt; <userinput>config show Dhcp6</userinput></screen>
  3201. When starting the Dhcp6 daemon for the first time, the default configuration
  3202. will be available. It will look similar to this:
  3203. <screen>
  3204. &gt; <userinput>config show Dhcp6</userinput>
  3205. Dhcp6/interface "eth0" string (default)
  3206. Dhcp6/renew-timer 1000 integer (default)
  3207. Dhcp6/rebind-timer 2000 integer (default)
  3208. Dhcp6/preferred-lifetime 3000 integer (default)
  3209. Dhcp6/valid-lifetime 4000 integer (default)
  3210. Dhcp6/subnet6 [] list (default)</screen>
  3211. </para>
  3212. <para>
  3213. To change one of the parameters, simply follow
  3214. the usual <command>bindctl</command> procedure. For example, to make the
  3215. leases longer, change their valid-lifetime parameter:
  3216. <screen>
  3217. &gt; <userinput>config set Dhcp6/valid-lifetime 7200</userinput>
  3218. &gt; <userinput>config commit</userinput></screen>
  3219. Most Dhcp6 parameters are of global scope
  3220. and apply to all defined subnets, unless they are overridden on a
  3221. per-subnet basis.
  3222. </para>
  3223. <para>
  3224. The essential role of a DHCPv6 server is address assignment. For this,
  3225. the server has to be configured with at least one subnet and one pool of dynamic
  3226. addresses to be managed. For example, assume that the server
  3227. is connected to a network segment that uses the 2001:db8:1::/64
  3228. prefix. The Administrator of that network has decided that addresses from range
  3229. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  3230. server. Such a configuration can be achieved in the following way:
  3231. <screen>
  3232. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3233. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3234. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  3235. &gt; <userinput>config commit</userinput></screen>
  3236. Note that subnet is defined as a simple string, but the pool parameter
  3237. is actually a list of pools: for this reason, the pool definition is
  3238. enclosed in square brackets, even though only one range of addresses
  3239. is specified.</para>
  3240. <para>It is possible to define more than one pool in a
  3241. subnet: continuing the previous example, further assume that
  3242. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  3243. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  3244. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  3245. formats are supported by Dhcp6 and can be mixed in the pool list.
  3246. For example, one could define the following pools:
  3247. <screen>
  3248. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]</userinput>
  3249. &gt; <userinput>config commit</userinput></screen>
  3250. The number of pools is not limited, but for performance reasons it is recommended to
  3251. use as few as possible.
  3252. </para>
  3253. <para>
  3254. The server may be configured to serve more than one subnet. To add a second subnet,
  3255. use a command similar to the following:
  3256. <screen>
  3257. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3258. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  3259. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  3260. &gt; <userinput>config commit</userinput></screen>
  3261. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  3262. previous example. The <command>config add Dhcp6/subnet6</command> adds
  3263. another (second) subnet. It can be referred to as
  3264. <command>Dhcp6/subnet6[1]</command>. In this example, we allow server to
  3265. dynamically assign all addresses available in the whole subnet. Although
  3266. very wasteful, it is certainly a valid configuration to dedicate the
  3267. whole /48 subnet for that purpose.
  3268. </para>
  3269. <para>
  3270. When configuring a DHCPv6 server using prefix/length notation, please pay
  3271. attention to the boundary values. When specifying that the server should use
  3272. a given pool, it will be able to allocate also first (typically network
  3273. address) address from that pool. For example for pool 2001:db8::/64 the
  3274. 2001:db8:: address may be assigned as well. If you want to avoid this,
  3275. please use min-max notation.
  3276. </para>
  3277. <para>
  3278. Options can also be configured: the following commands configure
  3279. the DNS-SERVERS option for all subnets with the following addresses:
  3280. 2001:db8:1::1 and 2001:db8:1::2
  3281. <screen>
  3282. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3283. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  3284. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  3285. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001 0DB8 0001 0000 0000 0000</userinput>
  3286. <userinput>0000 0001 2001 0DB8 0001 0000 0000 0000 0000 0002"</userinput>
  3287. &gt; <userinput>config commit</userinput>
  3288. </screen>
  3289. (The value for the setting of the "data" element is split across two
  3290. lines in this document for clarity: when entering the command, all the
  3291. string should be entered on the same line.)
  3292. </para>
  3293. <para>
  3294. Currently the only way to set option data is to specify the
  3295. data as a string of hexadecimal digits. It is planned to allow
  3296. alternative ways of specifying the data as a comma-separated list,
  3297. e.g. "2001:db8:1::1,2001:db8:1::2".
  3298. </para>
  3299. <para>
  3300. As with global settings, it is also possible to override options on a
  3301. per-subnet basis, e.g. the following commands override the global DNS
  3302. servers option for a particular subnet, setting a single DNS server with
  3303. address 2001:db8:1::3.
  3304. <screen>
  3305. &gt; <userinput>config add Dhcp6/subnet6[0]/option-data</userinput>
  3306. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/name "dns-servers"</userinput>
  3307. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/code 23</userinput>
  3308. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/data "2001 0DB8 0001 0000</userinput>
  3309. <userinput>0000 0000 0000 0003"</userinput>
  3310. &gt; <userinput>config commit</userinput></screen>
  3311. (As before, the setting of the "data" element has been split across two
  3312. lines for clarity.)
  3313. </para>
  3314. <note>
  3315. <para>
  3316. With this version of BIND 10, there are a number of known limitations
  3317. and problems in the DHCPv6 server. See <xref linkend="dhcp6-limit"/>.
  3318. </para>
  3319. </note>
  3320. </section>
  3321. <section id="dhcp6-std">
  3322. <title>Supported DHCPv6 Standards</title>
  3323. <para>The following standards and draft standards are currently
  3324. supported:</para>
  3325. <itemizedlist>
  3326. <listitem>
  3327. <simpara>RFC3315: Supported messages are SOLICIT,
  3328. ADVERTISE, REQUEST, and REPLY. Supported options are
  3329. SERVER_ID, CLIENT_ID, IA_NA, and IAADDRESS.</simpara>
  3330. </listitem>
  3331. <listitem>
  3332. <simpara>RFC3646: Supported option is DNS_SERVERS.</simpara>
  3333. </listitem>
  3334. </itemizedlist>
  3335. </section>
  3336. <section id="dhcp6-limit">
  3337. <title>DHCPv6 Server Limitations</title>
  3338. <para> These are the current limitations and known problems
  3339. with the the DHCPv6 server
  3340. software. Most of them are reflections of the early stage of
  3341. development and should be treated as <quote>not implemented
  3342. yet</quote>, rather than actual limitations.</para>
  3343. <para>
  3344. <itemizedlist>
  3345. <listitem>
  3346. <para>The DHCPv6 server has only been tested on Debian
  3347. operating systems. There are known problems with the
  3348. handling of packets in CentOS and RHEL.</para>
  3349. </listitem>
  3350. <listitem>
  3351. <para>Relayed traffic is not supported.</para>
  3352. </listitem>
  3353. <listitem>
  3354. <para><command>b10-dhcp6</command> only supports
  3355. a limited number of configuration options.</para>
  3356. </listitem>
  3357. <listitem>
  3358. <para>
  3359. On startup, the DHCPv6 server does not get the full configuration from
  3360. BIND 10. To remedy this, after starting BIND 10, modify any parameter
  3361. and commit the changes, e.g.
  3362. <screen>
  3363. &gt; <userinput>config show Dhcp6/renew-timer</userinput>
  3364. Dhcp6/renew-timer 1000 integer (default)
  3365. &gt; <userinput>config set Dhcp6/renew-timer 1001</userinput>
  3366. &gt; <userinput>config commit</userinput></screen>
  3367. </para>
  3368. </listitem>
  3369. <listitem>
  3370. <para>Upon start, the server will open sockets on all
  3371. interfaces that are not loopback, are up, running and are
  3372. multicast capable and have IPv6 address. Support for
  3373. multiple interfaces is not coded in reception routines yet,
  3374. so if you are running this code on a machine that has many
  3375. interfaces and <command>b10-dhcp6</command> happens to
  3376. listen on wrong interface, the easiest way to work around
  3377. this problem is to turn down other interfaces. This
  3378. limitation will be fixed shortly.</para>
  3379. </listitem>
  3380. <listitem>
  3381. <para>ORO (Option Request Option, a list of options
  3382. requested by a client) is currently unsupported.</para>
  3383. </listitem>
  3384. <listitem>
  3385. <para>Temporary addresses are not supported.</para>
  3386. </listitem>
  3387. <listitem>
  3388. <para>Prefix delegation is not supported.</para>
  3389. </listitem>
  3390. <listitem>
  3391. <para>Address renewal (RENEW), rebinding (REBIND),
  3392. confirmation (CONFIRM), duplication report (DECLINE) and
  3393. release (RELEASE) are not supported.</para>
  3394. </listitem>
  3395. <listitem>
  3396. <para>DNS Update is not supported.</para>
  3397. </listitem>
  3398. <listitem>
  3399. <para>Interface detection is currently working on Linux
  3400. only. See <xref linkend="iface-detect"/> for details.</para>
  3401. </listitem>
  3402. </itemizedlist>
  3403. </para>
  3404. </section>
  3405. </chapter>
  3406. <chapter id="libdhcp">
  3407. <title>libdhcp++ library</title>
  3408. <para>
  3409. libdhcp++ is a common library written in C++ that handles
  3410. many DHCP-related tasks, including
  3411. <itemizedlist>
  3412. <listitem>
  3413. <simpara>DHCPv4 and DHCPv6 packets parsing, manipulation and assembly</simpara>
  3414. </listitem>
  3415. <listitem>
  3416. <simpara>Option parsing, manipulation and assembly</simpara>
  3417. </listitem>
  3418. <listitem>
  3419. <simpara>Network interface detection</simpara>
  3420. </listitem>
  3421. <listitem>
  3422. <simpara>Socket operations such as creation, data transmission and reception and socket closing.</simpara>
  3423. </listitem>
  3424. </itemizedlist>
  3425. </para>
  3426. <para>
  3427. While this library is currently used by
  3428. <command>b10-dhcp4</command> and <command>b10-dhcp6</command>
  3429. only, it is designed to be a portable, universal library, useful for
  3430. any kind of DHCP-related software.
  3431. </para>
  3432. <!-- TODO: point to doxygen docs -->
  3433. <section id="iface-detect">
  3434. <title>Interface detection</title>
  3435. <para>Both the DHCPv4 and DHCPv6 components share network
  3436. interface detection routines. Interface detection is
  3437. currently only supported on Linux systems.</para>
  3438. <para>For non-Linux systems, there is currently a stub
  3439. implementation provided. The interface manager detects loopback
  3440. interfaces only as their name (lo or lo0) can be easily predicted.
  3441. Please contact the BIND 10 development team if you are interested
  3442. in running DHCP components on systems other than Linux.</para>
  3443. </section>
  3444. <!--
  3445. <section id="packet-handling">
  3446. <title>DHCPv4/DHCPv6 packet handling</title>
  3447. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  3448. </section>
  3449. -->
  3450. </chapter>
  3451. <chapter id="statistics">
  3452. <title>Statistics</title>
  3453. <para>
  3454. The <command>b10-stats</command> process is started by
  3455. <command>bind10</command>.
  3456. It periodically collects statistics data from various modules
  3457. and aggregates it.
  3458. <!-- TODO -->
  3459. </para>
  3460. <para>
  3461. This stats daemon provides commands to identify if it is
  3462. running, show specified or all statistics data, and show specified
  3463. or all statistics data schema.
  3464. For example, using <command>bindctl</command>:
  3465. <screen>
  3466. &gt; <userinput>Stats show</userinput>
  3467. {
  3468. "Auth": {
  3469. "opcode.iquery": 0,
  3470. "opcode.notify": 10,
  3471. "opcode.query": 869617,
  3472. ...
  3473. "queries.tcp": 1749,
  3474. "queries.udp": 867868
  3475. },
  3476. "Boss": {
  3477. "boot_time": "2011-01-20T16:59:03Z"
  3478. },
  3479. "Stats": {
  3480. "boot_time": "2011-01-20T16:59:05Z",
  3481. "last_update_time": "2011-01-20T17:04:05Z",
  3482. "lname": "4d3869d9_a@jreed.example.net",
  3483. "report_time": "2011-01-20T17:04:06Z",
  3484. "timestamp": 1295543046.823504
  3485. }
  3486. }
  3487. </screen>
  3488. </para>
  3489. </chapter>
  3490. <chapter id="logging">
  3491. <title>Logging</title>
  3492. <section>
  3493. <title>Logging configuration</title>
  3494. <para>
  3495. The logging system in BIND 10 is configured through the
  3496. Logging module. All BIND 10 modules will look at the
  3497. configuration in Logging to see what should be logged and
  3498. to where.
  3499. <!-- TODO: what is context of Logging module for readers of this guide? -->
  3500. </para>
  3501. <section>
  3502. <title>Loggers</title>
  3503. <para>
  3504. Within BIND 10, a message is logged through a component
  3505. called a "logger". Different parts of BIND 10 log messages
  3506. through different loggers, and each logger can be configured
  3507. independently of one another.
  3508. </para>
  3509. <para>
  3510. In the Logging module, you can specify the configuration
  3511. for zero or more loggers; any that are not specified will
  3512. take appropriate default values.
  3513. </para>
  3514. <para>
  3515. The three most important elements of a logger configuration
  3516. are the <option>name</option> (the component that is
  3517. generating the messages), the <option>severity</option>
  3518. (what to log), and the <option>output_options</option>
  3519. (where to log).
  3520. </para>
  3521. <section>
  3522. <title>name (string)</title>
  3523. <para>
  3524. Each logger in the system has a name, the name being that
  3525. of the component using it to log messages. For instance,
  3526. if you want to configure logging for the resolver module,
  3527. you add an entry for a logger named <quote>Resolver</quote>. This
  3528. configuration will then be used by the loggers in the
  3529. Resolver module, and all the libraries used by it.
  3530. </para>
  3531. <!-- TODO: later we will have a way to know names of all modules
  3532. Right now you can only see what their names are if they are running
  3533. (a simple 'help' without anything else in bindctl for instance).
  3534. -->
  3535. <para>
  3536. If you want to specify logging for one specific library
  3537. within the module, you set the name to
  3538. <replaceable>module.library</replaceable>. For example, the
  3539. logger used by the nameserver address store component
  3540. has the full name of <quote>Resolver.nsas</quote>. If
  3541. there is no entry in Logging for a particular library,
  3542. it will use the configuration given for the module.
  3543. <!-- TODO: how to know these specific names?
  3544. We will either have to document them or tell the administrator to
  3545. specify module-wide logging and see what appears...
  3546. -->
  3547. </para>
  3548. <para>
  3549. <!-- TODO: severity has not been covered yet -->
  3550. To illustrate this, suppose you want the cache library
  3551. to log messages of severity DEBUG, and the rest of the
  3552. resolver code to log messages of severity INFO. To achieve
  3553. this you specify two loggers, one with the name
  3554. <quote>Resolver</quote> and severity INFO, and one with
  3555. the name <quote>Resolver.cache</quote> with severity
  3556. DEBUG. As there are no entries for other libraries (e.g.
  3557. the nsas), they will use the configuration for the module
  3558. (<quote>Resolver</quote>), so giving the desired behavior.
  3559. </para>
  3560. <para>
  3561. One special case is that of a module name of <quote>*</quote>
  3562. (asterisks), which is interpreted as <emphasis>any</emphasis>
  3563. module. You can set global logging options by using this,
  3564. including setting the logging configuration for a library
  3565. that is used by multiple modules (e.g. <quote>*.config</quote>
  3566. specifies the configuration library code in whatever
  3567. module is using it).
  3568. </para>
  3569. <para>
  3570. If there are multiple logger specifications in the
  3571. configuration that might match a particular logger, the
  3572. specification with the more specific logger name takes
  3573. precedence. For example, if there are entries for for
  3574. both <quote>*</quote> and <quote>Resolver</quote>, the
  3575. resolver module &mdash; and all libraries it uses &mdash;
  3576. will log messages according to the configuration in the
  3577. second entry (<quote>Resolver</quote>). All other modules
  3578. will use the configuration of the first entry
  3579. (<quote>*</quote>). If there was also a configuration
  3580. entry for <quote>Resolver.cache</quote>, the cache library
  3581. within the resolver would use that in preference to the
  3582. entry for <quote>Resolver</quote>.
  3583. </para>
  3584. <para>
  3585. One final note about the naming. When specifying the
  3586. module name within a logger, use the name of the module
  3587. as specified in <command>bindctl</command>, e.g.
  3588. <quote>Resolver</quote> for the resolver module,
  3589. <quote>Xfrout</quote> for the xfrout module, etc. When
  3590. the message is logged, the message will include the name
  3591. of the logger generating the message, but with the module
  3592. name replaced by the name of the process implementing
  3593. the module (so for example, a message generated by the
  3594. <quote>Auth.cache</quote> logger will appear in the output
  3595. with a logger name of <quote>b10-auth.cache</quote>).
  3596. </para>
  3597. </section>
  3598. <section>
  3599. <title>severity (string)</title>
  3600. <para>
  3601. This specifies the category of messages logged.
  3602. Each message is logged with an associated severity which
  3603. may be one of the following (in descending order of
  3604. severity):
  3605. </para>
  3606. <itemizedlist>
  3607. <listitem>
  3608. <simpara> FATAL </simpara>
  3609. </listitem>
  3610. <listitem>
  3611. <simpara> ERROR </simpara>
  3612. </listitem>
  3613. <listitem>
  3614. <simpara> WARN </simpara>
  3615. </listitem>
  3616. <listitem>
  3617. <simpara> INFO </simpara>
  3618. </listitem>
  3619. <listitem>
  3620. <simpara> DEBUG </simpara>
  3621. </listitem>
  3622. </itemizedlist>
  3623. <para>
  3624. When the severity of a logger is set to one of these
  3625. values, it will only log messages of that severity, and
  3626. the severities above it. The severity may also be set to
  3627. NONE, in which case all messages from that logger are
  3628. inhibited.
  3629. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  3630. </para>
  3631. </section>
  3632. <section>
  3633. <title>output_options (list)</title>
  3634. <para>
  3635. Each logger can have zero or more
  3636. <option>output_options</option>. These specify where log
  3637. messages are sent to. These are explained in detail below.
  3638. </para>
  3639. <para>
  3640. The other options for a logger are:
  3641. </para>
  3642. </section>
  3643. <section>
  3644. <title>debuglevel (integer)</title>
  3645. <para>
  3646. When a logger's severity is set to DEBUG, this value
  3647. specifies what debug messages should be printed. It ranges
  3648. from 0 (least verbose) to 99 (most verbose).
  3649. </para>
  3650. <!-- TODO: complete this sentence:
  3651. The general classification of debug message types is
  3652. TODO; there's a ticket to determine these levels, see #1074
  3653. -->
  3654. <para>
  3655. If severity for the logger is not DEBUG, this value is ignored.
  3656. </para>
  3657. </section>
  3658. <section>
  3659. <title>additive (true or false)</title>
  3660. <para>
  3661. If this is true, the <option>output_options</option> from
  3662. the parent will be used. For example, if there are two
  3663. loggers configured; <quote>Resolver</quote> and
  3664. <quote>Resolver.cache</quote>, and <option>additive</option>
  3665. is true in the second, it will write the log messages
  3666. not only to the destinations specified for
  3667. <quote>Resolver.cache</quote>, but also to the destinations
  3668. as specified in the <option>output_options</option> in
  3669. the logger named <quote>Resolver</quote>.
  3670. <!-- TODO: check this -->
  3671. </para>
  3672. </section>
  3673. </section>
  3674. <section>
  3675. <title>Output Options</title>
  3676. <para>
  3677. The main settings for an output option are the
  3678. <option>destination</option> and a value called
  3679. <option>output</option>, the meaning of which depends on
  3680. the destination that is set.
  3681. </para>
  3682. <section>
  3683. <title>destination (string)</title>
  3684. <para>
  3685. The destination is the type of output. It can be one of:
  3686. </para>
  3687. <itemizedlist>
  3688. <listitem>
  3689. <simpara> console </simpara>
  3690. </listitem>
  3691. <listitem>
  3692. <simpara> file </simpara>
  3693. </listitem>
  3694. <listitem>
  3695. <simpara> syslog </simpara>
  3696. </listitem>
  3697. </itemizedlist>
  3698. </section>
  3699. <section>
  3700. <title>output (string)</title>
  3701. <para>
  3702. Depending on what is set as the output destination, this
  3703. value is interpreted as follows:
  3704. </para>
  3705. <variablelist>
  3706. <varlistentry>
  3707. <term><option>destination</option> is <quote>console</quote></term>
  3708. <listitem>
  3709. <para>
  3710. The value of output must be one of <quote>stdout</quote>
  3711. (messages printed to standard output) or
  3712. <quote>stderr</quote> (messages printed to standard
  3713. error).
  3714. </para>
  3715. <para>
  3716. Note: if output is set to <quote>stderr</quote> and a lot of
  3717. messages are produced in a short time (e.g. if the logging
  3718. level is set to DEBUG), you may occasionally see some messages
  3719. jumbled up together. This is due to a combination of the way
  3720. that messages are written to the screen and the unbuffered
  3721. nature of the standard error stream. If this occurs, it is
  3722. recommended that output be set to <quote>stdout</quote>.
  3723. </para>
  3724. </listitem>
  3725. </varlistentry>
  3726. <varlistentry>
  3727. <term><option>destination</option> is <quote>file</quote></term>
  3728. <listitem>
  3729. <para>
  3730. The value of output is interpreted as a file name;
  3731. log messages will be appended to this file.
  3732. </para>
  3733. </listitem>
  3734. </varlistentry>
  3735. <varlistentry>
  3736. <term><option>destination</option> is <quote>syslog</quote></term>
  3737. <listitem>
  3738. <para>
  3739. The value of output is interpreted as the
  3740. <command>syslog</command> facility (e.g.
  3741. <emphasis>local0</emphasis>) that should be used
  3742. for log messages.
  3743. </para>
  3744. </listitem>
  3745. </varlistentry>
  3746. </variablelist>
  3747. <para>
  3748. The other options for <option>output_options</option> are:
  3749. </para>
  3750. <section>
  3751. <title>flush (true of false)</title>
  3752. <para>
  3753. Flush buffers after each log message. Doing this will
  3754. reduce performance but will ensure that if the program
  3755. terminates abnormally, all messages up to the point of
  3756. termination are output.
  3757. </para>
  3758. </section>
  3759. <section>
  3760. <title>maxsize (integer)</title>
  3761. <para>
  3762. Only relevant when destination is file, this is maximum
  3763. file size of output files in bytes. When the maximum
  3764. size is reached, the file is renamed and a new file opened.
  3765. (For example, a ".1" is appended to the name &mdash;
  3766. if a ".1" file exists, it is renamed ".2",
  3767. etc.)
  3768. </para>
  3769. <para>
  3770. If this is 0, no maximum file size is used.
  3771. </para>
  3772. </section>
  3773. <section>
  3774. <title>maxver (integer)</title>
  3775. <para>
  3776. Maximum number of old log files to keep around when
  3777. rolling the output file. Only relevant when
  3778. <option>destination</option> is <quote>file</quote>.
  3779. </para>
  3780. </section>
  3781. </section>
  3782. </section>
  3783. <section>
  3784. <title>Example session</title>
  3785. <para>
  3786. In this example we want to set the global logging to
  3787. write to the file <filename>/var/log/my_bind10.log</filename>,
  3788. at severity WARN. We want the authoritative server to
  3789. log at DEBUG with debuglevel 40, to a different file
  3790. (<filename>/tmp/debug_messages</filename>).
  3791. </para>
  3792. <para>
  3793. Start <command>bindctl</command>.
  3794. </para>
  3795. <para>
  3796. <screen>["login success "]
  3797. &gt; <userinput>config show Logging</userinput>
  3798. Logging/loggers [] list
  3799. </screen>
  3800. </para>
  3801. <para>
  3802. By default, no specific loggers are configured, in which
  3803. case the severity defaults to INFO and the output is
  3804. written to stderr.
  3805. </para>
  3806. <para>
  3807. Let's first add a default logger:
  3808. </para>
  3809. <!-- TODO: adding the empty loggers makes no sense -->
  3810. <para>
  3811. <screen>&gt; <userinput>config add Logging/loggers</userinput>
  3812. &gt; <userinput>config show Logging</userinput>
  3813. Logging/loggers/ list (modified)
  3814. </screen>
  3815. </para>
  3816. <para>
  3817. The loggers value line changed to indicate that it is no
  3818. longer an empty list:
  3819. </para>
  3820. <para>
  3821. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  3822. Logging/loggers[0]/name "" string (default)
  3823. Logging/loggers[0]/severity "INFO" string (default)
  3824. Logging/loggers[0]/debuglevel 0 integer (default)
  3825. Logging/loggers[0]/additive false boolean (default)
  3826. Logging/loggers[0]/output_options [] list (default)
  3827. </screen>
  3828. </para>
  3829. <para>
  3830. The name is mandatory, so we must set it. We will also
  3831. change the severity as well. Let's start with the global
  3832. logger.
  3833. </para>
  3834. <para>
  3835. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  3836. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  3837. &gt; <userinput>config show Logging/loggers</userinput>
  3838. Logging/loggers[0]/name "*" string (modified)
  3839. Logging/loggers[0]/severity "WARN" string (modified)
  3840. Logging/loggers[0]/debuglevel 0 integer (default)
  3841. Logging/loggers[0]/additive false boolean (default)
  3842. Logging/loggers[0]/output_options [] list (default)
  3843. </screen>
  3844. </para>
  3845. <para>
  3846. Of course, we need to specify where we want the log
  3847. messages to go, so we add an entry for an output option.
  3848. </para>
  3849. <para>
  3850. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  3851. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  3852. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  3853. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  3854. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  3855. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  3856. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  3857. </screen>
  3858. </para>
  3859. <para>
  3860. These aren't the values we are looking for.
  3861. </para>
  3862. <para>
  3863. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  3864. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  3865. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  3866. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  3867. </screen>
  3868. </para>
  3869. <para>
  3870. Which would make the entire configuration for this logger
  3871. look like:
  3872. </para>
  3873. <para>
  3874. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  3875. Logging/loggers[0]/name "*" string (modified)
  3876. Logging/loggers[0]/severity "WARN" string (modified)
  3877. Logging/loggers[0]/debuglevel 0 integer (default)
  3878. Logging/loggers[0]/additive false boolean (default)
  3879. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  3880. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  3881. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  3882. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  3883. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  3884. </screen>
  3885. </para>
  3886. <para>
  3887. That looks OK, so let's commit it before we add the
  3888. configuration for the authoritative server's logger.
  3889. </para>
  3890. <para>
  3891. <screen>&gt; <userinput> config commit</userinput></screen>
  3892. </para>
  3893. <para>
  3894. Now that we have set it, and checked each value along
  3895. the way, adding a second entry is quite similar.
  3896. </para>
  3897. <para>
  3898. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  3899. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  3900. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  3901. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  3902. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  3903. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  3904. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  3905. &gt; <userinput> config commit</userinput>
  3906. </screen>
  3907. </para>
  3908. <para>
  3909. And that's it. Once we have found whatever it was we
  3910. needed the debug messages for, we can simply remove the
  3911. second logger to let the authoritative server use the
  3912. same settings as the rest.
  3913. </para>
  3914. <para>
  3915. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  3916. &gt; <userinput> config commit</userinput>
  3917. </screen>
  3918. </para>
  3919. <para>
  3920. And every module will now be using the values from the
  3921. logger named <quote>*</quote>.
  3922. </para>
  3923. </section>
  3924. </section>
  3925. <section>
  3926. <title>Logging Message Format</title>
  3927. <para>
  3928. Each message written by BIND 10 to the configured logging
  3929. destinations comprises a number of components that identify
  3930. the origin of the message and, if the message indicates
  3931. a problem, information about the problem that may be
  3932. useful in fixing it.
  3933. </para>
  3934. <para>
  3935. Consider the message below logged to a file:
  3936. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  3937. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  3938. </para>
  3939. <para>
  3940. Note: the layout of messages written to the system logging
  3941. file (syslog) may be slightly different. This message has
  3942. been split across two lines here for display reasons; in the
  3943. logging file, it will appear on one line.)
  3944. </para>
  3945. <para>
  3946. The log message comprises a number of components:
  3947. <variablelist>
  3948. <varlistentry>
  3949. <term>2011-06-15 13:48:22.034</term>
  3950. <!-- TODO: timestamp repeated even if using syslog? -->
  3951. <listitem><para>
  3952. The date and time at which the message was generated.
  3953. </para></listitem>
  3954. </varlistentry>
  3955. <varlistentry>
  3956. <term>ERROR</term>
  3957. <listitem><para>
  3958. The severity of the message.
  3959. </para></listitem>
  3960. </varlistentry>
  3961. <varlistentry>
  3962. <term>[b10-resolver.asiolink]</term>
  3963. <listitem><para>
  3964. The source of the message. This comprises two components:
  3965. the BIND 10 process generating the message (in this
  3966. case, <command>b10-resolver</command>) and the module
  3967. within the program from which the message originated
  3968. (which in the example is the asynchronous I/O link
  3969. module, asiolink).
  3970. </para></listitem>
  3971. </varlistentry>
  3972. <varlistentry>
  3973. <term>ASIODNS_OPENSOCK</term>
  3974. <listitem><para>
  3975. The message identification. Every message in BIND 10
  3976. has a unique identification, which can be used as an
  3977. index into the <ulink
  3978. url="bind10-messages.html"><citetitle>BIND 10 Messages
  3979. Manual</citetitle></ulink> (<ulink
  3980. url="http://bind10.isc.org/docs/bind10-messages.html"
  3981. />) from which more information can be obtained.
  3982. </para></listitem>
  3983. </varlistentry>
  3984. <varlistentry>
  3985. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  3986. <listitem><para>
  3987. A brief description of the cause of the problem.
  3988. Within this text, information relating to the condition
  3989. that caused the message to be logged will be included.
  3990. In this example, error number 111 (an operating
  3991. system-specific error number) was encountered when
  3992. trying to open a TCP connection to port 53 on the
  3993. local system (address 127.0.0.1). The next step
  3994. would be to find out the reason for the failure by
  3995. consulting your system's documentation to identify
  3996. what error number 111 means.
  3997. </para></listitem>
  3998. </varlistentry>
  3999. </variablelist>
  4000. </para>
  4001. </section>
  4002. </chapter>
  4003. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  4004. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  4005. <!-- <index> <title>Index</title> </index> -->
  4006. </book>
  4007. <!--
  4008. TODO:
  4009. Overview
  4010. Getting BIND 10 Installed
  4011. Basics
  4012. Dependencies
  4013. Optional
  4014. Advanced
  4015. How Does Everything Work Together?
  4016. Need Help?
  4017. -->