bind10-guide.xml 234 KB

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