bind10-guide.xml 179 KB

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