bind10-guide.xml 257 KB

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