bind10-guide.xml 240 KB

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