bind10-guide.xml 232 KB

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