bind10-guide.xml 352 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352
  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-2014 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 (codenamed Kea).
  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. <para>
  724. Please don't use any form of parallel or job server options
  725. (such as GNU make's <command>-j</command> option) when
  726. performing this step. Doing so may cause errors.
  727. </para>
  728. <note>
  729. <para>The install step may require superuser privileges.</para>
  730. </note>
  731. <para>
  732. If required, run <command>ldconfig</command> as root with
  733. <filename>/usr/local/lib</filename> (or with ${prefix}/lib if
  734. configured with --prefix) in
  735. <filename>/etc/ld.so.conf</filename> (or the relevant linker
  736. cache configuration file for your OS):
  737. <screen>$ <userinput>ldconfig</userinput></screen>
  738. </para>
  739. <note>
  740. <para>
  741. If you do not run <command>ldconfig</command> where it is
  742. required, you may see errors like the following:
  743. <screen>
  744. program: error while loading shared libraries: libb10-something.so.1:
  745. cannot open shared object file: No such file or directory
  746. </screen>
  747. </para>
  748. </note>
  749. </section>
  750. <!-- TODO: tests -->
  751. </section>
  752. <!--
  753. <section id="install.troubleshooting">
  754. <title>Troubleshooting</title>
  755. <para>
  756. </para>
  757. </section>
  758. -->
  759. </chapter>
  760. <chapter id="bind10">
  761. <title>Starting BIND 10 with <command>bind10</command></title>
  762. <para>
  763. BIND 10 is started with the <command>bind10</command> command.
  764. It runs the <command>b10-init</command> daemon which
  765. starts up the required processes, and
  766. will also restart some processes that exit unexpectedly.
  767. <command>bind10</command> is the only command needed to start
  768. the BIND 10 system.
  769. </para>
  770. <para>
  771. After starting the <command>b10-msgq</command> communications channel,
  772. <command>b10-init</command> connects to it,
  773. runs the configuration manager, and reads its own configuration.
  774. Then it starts the other modules.
  775. </para>
  776. <para>
  777. The <command>b10-sockcreator</command>, <command>b10-msgq</command> and
  778. <command>b10-cfgmgr</command>
  779. services make up the core. The <command>b10-msgq</command> daemon
  780. provides the communication channel between every part of the system.
  781. The <command>b10-cfgmgr</command> daemon is always needed by every
  782. module, if only to send information about themselves somewhere,
  783. but more importantly to ask about their own settings, and
  784. about other modules. The <command>b10-sockcreator</command> daemon
  785. helps allocate Internet addresses and ports as needed for BIND 10
  786. network services.
  787. </para>
  788. <para>
  789. In its default configuration, the <command>b10-init</command>
  790. master process will also start up
  791. <command>b10-cmdctl</command> for administration tools to
  792. communicate with the system, and
  793. <command>b10-stats</command> for statistics collection.
  794. The DNS and DHCP servers are not started by default.
  795. The configuration of components to start is covered in
  796. <xref linkend="bind10.components"/>.
  797. </para>
  798. <section id="start">
  799. <title>Starting BIND 10</title>
  800. <para>
  801. To start the BIND 10 service, simply run <command>bind10</command>
  802. as root.
  803. It will run in the foreground and your shell prompt will not
  804. be available. It will output various log messages as it starts up
  805. and is used.
  806. Run it with the <option>--verbose</option> switch to
  807. get additional debugging or diagnostic output.
  808. </para>
  809. <!-- TODO: user switch -->
  810. <!-- TODO: example: nohup /usr/local/sbin/bind10 1>bind10.log 2>&1 -->
  811. <note>
  812. <para>
  813. If the setproctitle Python module is detected at start up,
  814. the process names for the Python-based daemons will be renamed
  815. to better identify them instead of just <quote>python</quote>.
  816. This is not needed on some operating systems.
  817. </para>
  818. </note>
  819. </section>
  820. </chapter>
  821. <chapter id="msgq">
  822. <title>Command channel</title>
  823. <para>
  824. The BIND 10 components use the <command>b10-msgq</command>
  825. message routing daemon to communicate with other BIND 10 components.
  826. The <command>b10-msgq</command> implements what is called the
  827. <quote>Command Channel</quote>.
  828. Processes intercommunicate by sending messages on the command
  829. channel.
  830. Example messages include shutdown, get configurations, and set
  831. configurations.
  832. This Command Channel is not used for DNS message passing.
  833. It is used only to control and monitor the BIND 10 system.
  834. </para>
  835. <para>
  836. Administrators do not communicate directly with the
  837. <command>b10-msgq</command> daemon.
  838. By default, BIND 10 uses a UNIX domain socket file named
  839. <filename>/usr/local/var/bind10/msg_socket</filename>
  840. for this interprocess communication.
  841. </para>
  842. </chapter>
  843. <chapter id="cfgmgr">
  844. <title>Configuration manager</title>
  845. <para>
  846. The configuration manager, <command>b10-cfgmgr</command>,
  847. handles all BIND 10 system configuration. It provides
  848. persistent storage for configuration, and notifies running
  849. modules of configuration changes.
  850. </para>
  851. <para>
  852. The <command>b10-auth</command> and <command>b10-xfrin</command>
  853. daemons and other components receive their configurations
  854. from the configuration manager over the <command>b10-msgq</command>
  855. command channel.
  856. </para>
  857. <para>The administrator doesn't connect to it directly, but
  858. uses a user interface to communicate with the configuration
  859. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  860. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  861. </para>
  862. <!-- TODO -->
  863. <note>
  864. <para>
  865. The current release only provides
  866. <command>bindctl</command> as a user interface to
  867. <command>b10-cmdctl</command>.
  868. Upcoming releases will provide another interactive command-line
  869. interface and a web-based interface.
  870. </para>
  871. </note>
  872. <para>
  873. The <command>b10-cfgmgr</command> daemon can send all
  874. specifications and all current settings to the
  875. <command>bindctl</command> client (via
  876. <command>b10-cmdctl</command>).
  877. <command>b10-cfgmgr</command> relays configurations received
  878. from <command>b10-cmdctl</command> to the appropriate modules.
  879. </para>
  880. <!-- TODO:
  881. Configuration settings for itself are defined as ConfigManager.
  882. TODO: show examples
  883. -->
  884. <!-- TODO:
  885. config changes are actually commands to cfgmgr
  886. -->
  887. <!-- TODO: what about run time config to change this? -->
  888. <!-- jelte: > config set cfgmgr/config_database <file> -->
  889. <!-- TODO: what about command line switch to change this? -->
  890. <para>
  891. The stored configuration file is at
  892. <filename>/usr/local/var/bind10/b10-config.db</filename>.
  893. (The directory is what was defined at build configure time for
  894. <option>--localstatedir</option>.
  895. The default is <filename>/usr/local/var/</filename>.)
  896. The format is loosely based on JSON and is directly parseable
  897. python, but this may change in a future version.
  898. This configuration data file is not manually edited by the
  899. administrator.
  900. </para>
  901. <!--
  902. Well the specfiles have a more fixed format (they must contain specific
  903. stuff), but those are also directly parseable python structures (and
  904. 'coincidentally', our data::element string representation is the same)
  905. loosely based on json, tweaked to be directly parseable in python, but a
  906. subset of that.
  907. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  908. nope, spec files are written by module developers, and db should be done
  909. through bindctl and friends
  910. -->
  911. <para>
  912. The configuration manager does not have any command line arguments.
  913. Normally it is not started manually, but is automatically
  914. started using the <command>b10-init</command> master process
  915. (as covered in <xref linkend="bind10"/>).
  916. </para>
  917. <!-- TODO: upcoming plans:
  918. configuration for configuration manager itself. And perhaps we might
  919. change the messaging protocol, but an admin should never see any of that
  920. -->
  921. <!-- TODO: show examples, test this -->
  922. <!--
  923. , so an admin can simply run bindctl,
  924. do config show, and it shows all modules; config show >module> shows all
  925. options for that module
  926. -->
  927. </chapter>
  928. <chapter id="cmdctl">
  929. <title>Remote control daemon</title>
  930. <para>
  931. <command>b10-cmdctl</command> is the gateway between
  932. administrators and the BIND 10 system.
  933. It is a HTTPS server that uses standard HTTP Digest
  934. Authentication for username and password validation.
  935. It provides a REST-ful interface for accessing and controlling
  936. BIND 10.
  937. </para>
  938. <!-- TODO: copy examples from wiki, try with wget -->
  939. <para>
  940. When <command>b10-cmdctl</command> starts, it firsts
  941. asks <command>b10-cfgmgr</command> about what modules are
  942. running and what their configuration is (over the
  943. <command>b10-msgq</command> channel). Then it will start listening
  944. on HTTPS for clients &mdash; the user interface &mdash; such
  945. as <command>bindctl</command>.
  946. </para>
  947. <para>
  948. <command>b10-cmdctl</command> directly sends commands
  949. (received from the user interface) to the specified component.
  950. Configuration changes are actually commands to
  951. <command>b10-cfgmgr</command> so are sent there.
  952. </para>
  953. <!--
  954. TODO:
  955. "For bindctl to list a module's available configurations and
  956. available commands, it communicates over the cmdctl REST interface.
  957. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  958. asks the module for its specification and also cfgmgr looks in its
  959. own configuration database for current values."
  960. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  961. GET, but rather requests it once and then listens in for updates,
  962. but you might wanna check with likun
  963. -->
  964. <!-- TODO: replace /usr/local -->
  965. <!-- TODO: permissions -->
  966. <para>The HTTPS server requires a private key,
  967. such as a RSA PRIVATE KEY.
  968. The default location is at
  969. <filename>/usr/local/etc/bind10/cmdctl-keyfile.pem</filename>.
  970. (A sample key is at
  971. <filename>/usr/local/share/bind10/cmdctl-keyfile.pem</filename>.)
  972. It also uses a certificate located at
  973. <filename>/usr/local/etc/bind10/cmdctl-certfile.pem</filename>.
  974. (A sample certificate is at
  975. <filename>/usr/local/share/bind10/cmdctl-certfile.pem</filename>.)
  976. This may be a self-signed certificate or purchased from a
  977. certification authority.
  978. </para>
  979. <note><para>
  980. The HTTPS server doesn't support a certificate request from a
  981. client (at this time).
  982. <!-- TODO: maybe allow request from server side -->
  983. The <command>b10-cmdctl</command> daemon does not provide a
  984. public service. If any client wants to control BIND 10, then
  985. a certificate needs to be first received from the BIND 10
  986. administrator.
  987. The BIND 10 installation provides a sample PEM bundle that matches
  988. the sample key and certificate.
  989. </para></note>
  990. <!-- TODO: cross-ref -->
  991. <!-- TODO
  992. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  993. but that is a single file, maybe this should go back to that format?
  994. -->
  995. <!--
  996. <para>
  997. (08:20:56) shane: It is in theory possible to run without cmdctl.
  998. (08:21:02) shane: I think we discussed this.
  999. </para>
  1000. -->
  1001. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  1002. <para>
  1003. The <command>b10-cmdctl</command> daemon also requires
  1004. the user account file located at
  1005. <filename>/usr/local/etc/bind10/cmdctl-accounts.csv</filename>.
  1006. This comma-delimited file lists the accounts with a user name,
  1007. hashed password, and salt.
  1008. </para>
  1009. <para>
  1010. The administrator may create a user account with the
  1011. <command>b10-cmdctl-usermgr</command> tool.
  1012. </para>
  1013. <!-- TODO: show example -->
  1014. <!-- TODO: does cmdctl need to be restarted to change cert or key
  1015. or accounts database -->
  1016. <para>
  1017. By default the HTTPS server listens on the localhost port 8080.
  1018. The port can be set by using the <option>--port</option> command line option.
  1019. The address to listen on can be set using the <option>--address</option> command
  1020. line argument.
  1021. Each HTTPS connection is stateless and times out in 1200 seconds
  1022. by default. This can be
  1023. redefined by using the <option>--idle-timeout</option> command line argument.
  1024. </para>
  1025. <section id="cmdctl.spec">
  1026. <title>Configuration specification for b10-cmdctl</title>
  1027. <para>
  1028. The configuration items for <command>b10-cmdctl</command> are:
  1029. <varname>accounts_file</varname> which defines the path to the
  1030. user accounts database (the default is
  1031. <filename>/usr/local/etc/bind10/cmdctl-accounts.csv</filename>);
  1032. <varname>cert_file</varname> which defines the path to the
  1033. PEM certificate file (the default is
  1034. <filename>/usr/local/etc/bind10/cmdctl-certfile.pem</filename>);
  1035. and
  1036. <varname>key_file</varname> which defines the path to the
  1037. PEM private key file (the default is
  1038. <filename>/usr/local/etc/bind10/cmdctl-keyfile.pem</filename>).
  1039. </para>
  1040. </section>
  1041. <!--
  1042. TODO
  1043. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  1044. -->
  1045. </chapter>
  1046. <chapter id="bindctl">
  1047. <title>Control and configure user interface</title>
  1048. <note><para>
  1049. For the current release, <command>bindctl</command>
  1050. is the only user interface. It is expected that upcoming
  1051. releases will provide another interactive command-line
  1052. interface and a web-based interface for controlling and
  1053. configuring BIND 10.
  1054. </para></note>
  1055. <note><para>
  1056. <command>bindctl</command> has an internal command history, as
  1057. well as tab-completion for most of the commands and arguments.
  1058. However, these are only enabled if the python readline module
  1059. is available on the system. If not, neither of these
  1060. features will be supported.
  1061. </para></note>
  1062. <para>
  1063. The <command>bindctl</command> tool provides an interactive
  1064. prompt for configuring, controlling, and querying the BIND 10
  1065. components.
  1066. It communicates directly with a REST-ful interface over HTTPS
  1067. provided by <command>b10-cmdctl</command>. It doesn't
  1068. communicate to any other components directly.
  1069. </para>
  1070. <section id="bindctl_commandline_options">
  1071. <title>bindctl command-line options</title>
  1072. <variablelist>
  1073. <varlistentry>
  1074. <term>-a <replaceable>&lt;address&gt;</replaceable>, --address=<replaceable>&lt;address&gt;</replaceable></term>
  1075. <listitem>
  1076. <simpara>
  1077. IP address that BIND 10's <command>b10-cmdctl</command>
  1078. module is listening on. By default, this is 127.0.0.1.
  1079. </simpara>
  1080. </listitem>
  1081. </varlistentry>
  1082. <varlistentry>
  1083. <term>-c <replaceable>&lt;certificate file&gt;</replaceable>, --certificate-chain=<replaceable>&lt;certificate file&gt;</replaceable></term>
  1084. <listitem>
  1085. <simpara>
  1086. PEM-formatted server certificate file. When this option is
  1087. given, <command>bindctl</command> will verify the server
  1088. certificate using the given file as the root of the
  1089. certificate chain. If not specified, <command>bindctl
  1090. </command> does not validate the certificate.
  1091. </simpara>
  1092. </listitem>
  1093. </varlistentry>
  1094. <varlistentry>
  1095. <term>--csv-file-dir=<replaceable>&lt;csv file&gt;</replaceable></term>
  1096. <listitem>
  1097. <simpara>
  1098. <command>bindctl</command> stores the username and
  1099. password for logging in in a file called
  1100. <filename>default_user.csv</filename>;
  1101. this option specifies the directory where this file is
  1102. stored and read from. When not specified,
  1103. <filename>~/.bind10/</filename> is used.
  1104. <note>Currently, this file contains an unencrypted password.</note>
  1105. </simpara>
  1106. </listitem>
  1107. </varlistentry>
  1108. <varlistentry>
  1109. <term>-h, --help</term>
  1110. <listitem>
  1111. <simpara>
  1112. Shows a short overview of the command-line options of
  1113. <command>bindctl</command>, and exits.
  1114. </simpara>
  1115. </listitem>
  1116. </varlistentry>
  1117. <varlistentry>
  1118. <term>--version</term>
  1119. <listitem>
  1120. <simpara>
  1121. Shows the version of <command>bindctl</command>, and exits.
  1122. </simpara>
  1123. </listitem>
  1124. </varlistentry>
  1125. <varlistentry>
  1126. <term>-p <replaceable>&lt;port number&gt;</replaceable>, --port=<replaceable>&lt;port number&gt;</replaceable></term>
  1127. <listitem>
  1128. <simpara>
  1129. Port number that BIND 10's <command>b10-cmdctl</command>
  1130. module is listening on. By default, this is port 8080.
  1131. </simpara>
  1132. </listitem>
  1133. </varlistentry>
  1134. </variablelist>
  1135. </section>
  1136. <section id="bindctl_general_syntax">
  1137. <title>General syntax of bindctl commands</title>
  1138. The <command>bindctl</command> tool is an interactive
  1139. command-line tool, with dynamic commands depending on the
  1140. BIND 10 modules that are running. There are a number of
  1141. fixed commands that have no module and that are always
  1142. available.
  1143. The general syntax of a command is
  1144. <screen><userinput>&lt;module&gt; &lt;command&gt; <replaceable>[argument(s)]</replaceable></userinput></screen>
  1145. For example, the Init module has a 'shutdown' command to shut down
  1146. BIND 10, with an optional argument 'help':
  1147. <screen>&gt; <userinput>Init shutdown help</userinput>
  1148. Command shutdown (Shut down BIND 10)
  1149. help (Get help for command)
  1150. This command has no parameters
  1151. </screen>
  1152. There are no mandatory arguments, only the optional 'help'.
  1153. </section>
  1154. <section id="bindctl_help">
  1155. <title>Bindctl help</title>
  1156. <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.
  1157. <screen>&gt; <userinput>help</userinput>
  1158. usage: &lt;module name&gt; &lt;command name&gt; [param1 = value1 [, param2 = value2]]
  1159. Type Tab character to get the hint of module/command/parameters.
  1160. Type "help(? h)" for help on bindctl.
  1161. Type "&lt;module_name&gt; help" for help on the specific module.
  1162. Type "&lt;module_name&gt; &lt;command_name&gt; help" for help on the specific command.
  1163. Available module names:
  1164. <emphasis>(list of modules)</emphasis>
  1165. </screen>
  1166. When 'help' is used as a command to a module, it shows the supported commands for the module; for example:
  1167. <screen>&gt; <userinput>Init help</userinput>
  1168. Module Init Master process
  1169. Available commands:
  1170. help Get help for module.
  1171. shutdown Shut down BIND 10
  1172. ping Ping the Init process
  1173. show_processes
  1174. List the running BIND 10 processes
  1175. </screen>
  1176. And when added to a module command, it shows the description and parameters of that specific command; for example:
  1177. <screen>&gt; <userinput>Auth loadzone help</userinput>
  1178. Command loadzone ((Re)load a specified zone)
  1179. help (Get help for command)
  1180. Parameters:
  1181. class (string, optional)
  1182. origin (string, mandatory)
  1183. </screen>
  1184. </section>
  1185. <section id="bindctl_command_arguments">
  1186. <title>Command arguments</title>
  1187. <simpara>
  1188. Commands can have arguments, which can be either optional or
  1189. mandatory. They can be specified by name
  1190. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument name&gt;=&lt;argument value&gt;</replaceable></command>), or positionally,
  1191. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument value 1&gt;</replaceable> <replaceable>&lt;argument value 2&gt;</replaceable></command>).
  1192. </simpara>
  1193. <simpara>
  1194. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>help</replaceable></command>
  1195. shows the arguments a command supports and which of those are
  1196. mandatory, and in which order the arguments are expected if
  1197. positional arguments are used.
  1198. </simpara>
  1199. <simpara>
  1200. For example, the <command>loadzone</command> command of the Auth
  1201. module, as shown in the last example of the previous section, has
  1202. two arguments, one of which is optional. The positional arguments in
  1203. this case are class first and origin second; for example:
  1204. <screen>&gt; <userinput>Auth loadzone IN example.com.</userinput></screen>
  1205. But since the class is optional (defaulting to IN), leaving it out
  1206. works as well:
  1207. <screen>&gt; <userinput>Auth loadzone example.com.</userinput></screen>
  1208. </simpara>
  1209. <simpara>
  1210. The arguments can also be provided with their names, in which
  1211. case the order does not matter:
  1212. <screen>&gt; <userinput>Auth loadzone origin="example.com." class="IN"</userinput></screen>
  1213. </simpara>
  1214. </section>
  1215. <section id="bindctl_module_commands">
  1216. <title>Module commands</title>
  1217. Each module has its own set of commands (if any), which will only be
  1218. available if the module is running. For instance, the
  1219. Auth module has a <command>loadzone</command> command.
  1220. The commands a module provides are documented in
  1221. this guide in the section of that module or in the module's
  1222. corresponding manual page.
  1223. </section>
  1224. <section>
  1225. <title>Configuration commands</title>
  1226. Configuration commands are used to view and change the configuration
  1227. of BIND 10 and its modules. Module configuration is only shown if
  1228. that module is running, but similar to commands, there are a number
  1229. of top-level configuration items that are always available (for
  1230. instance <varname>tsig_keys</varname> and
  1231. <varname>data_sources</varname>).
  1232. Configuration changes (set, unset, add and remove) are done locally
  1233. first, and have no immediate effect. The changes can be viewed with
  1234. <command>config diff</command>, and either reverted
  1235. (<command>config revert</command>), or committed
  1236. (<command>config commit</command>).
  1237. In the latter case, all local changes are submitted
  1238. to the configuration manager, which verifies them, and if they are
  1239. accepted, applied and saved in persistent storage.
  1240. When identifying items in configuration commands, the format is
  1241. <screen><userinput>Module/example/item</userinput></screen>
  1242. Sub-elements of names, lists and sets (see <xref linkend=
  1243. "bindctl_configuration_data_types"/>) are separated with the '/'
  1244. character, and list indices are identified with [<replaceable>&lt;index&gt;</replaceable>]; for example:
  1245. <screen><userinput>Module/example/list[2]/foo</userinput></screen>
  1246. <section id="bindctl_configuration_command_list">
  1247. <title>List of configuration commands</title>
  1248. The following configuration commands are available:
  1249. <variablelist>
  1250. <varlistentry>
  1251. <term>show [all] [item name]</term>
  1252. <listitem>
  1253. <simpara>
  1254. Shows the current configuration of the given item. If 'all'
  1255. is given, it will recurse through the entire set, and show
  1256. every nested value.
  1257. </simpara>
  1258. </listitem>
  1259. </varlistentry>
  1260. <varlistentry>
  1261. <term>show_json [item name]</term>
  1262. <listitem>
  1263. <simpara>
  1264. Shows the full configuration of the given item in JSON format.
  1265. </simpara>
  1266. </listitem>
  1267. </varlistentry>
  1268. <varlistentry>
  1269. <term>add &lt;item name&gt; [value]</term>
  1270. <listitem>
  1271. <simpara>
  1272. Add an entry to configuration list or a named set (see <xref
  1273. linkend="bindctl_configuration_data_types"/>).
  1274. When adding to a list, the command has one optional
  1275. argument, a value to add to the list. The value must
  1276. be in correct JSON and complete. When adding to a
  1277. named set, it has one mandatory parameter (the name to
  1278. add), and an optional parameter value, similar to when
  1279. adding to a list. In either case, when no value is
  1280. given, an entry will be constructed with default
  1281. values.
  1282. </simpara>
  1283. </listitem>
  1284. </varlistentry>
  1285. <varlistentry>
  1286. <term>remove</term>
  1287. <listitem>
  1288. <simpara>
  1289. Remove an item from a configuration list or a named set.
  1290. When removing an item for a list, either the index needs to
  1291. be specified, or the complete value of the element to remove
  1292. must be specified (in JSON format).
  1293. </simpara>
  1294. </listitem>
  1295. </varlistentry>
  1296. <varlistentry>
  1297. <term>set &lt;item name&gt; &lt;value&gt;</term>
  1298. <listitem>
  1299. <simpara>
  1300. Directly set the value of the given item to the given value.
  1301. </simpara>
  1302. </listitem>
  1303. </varlistentry>
  1304. <varlistentry>
  1305. <term>unset &lt;item name&gt;</term>
  1306. <listitem>
  1307. <simpara>
  1308. Remove any user-specified value for the given item.
  1309. </simpara>
  1310. </listitem>
  1311. </varlistentry>
  1312. <varlistentry>
  1313. <term>diff</term>
  1314. <listitem>
  1315. <simpara>
  1316. Show all current local changes that have not been
  1317. committed yet.
  1318. </simpara>
  1319. </listitem>
  1320. </varlistentry>
  1321. <varlistentry>
  1322. <term>revert</term>
  1323. <listitem>
  1324. <simpara>
  1325. Revert all local changes without committing them.
  1326. </simpara>
  1327. </listitem>
  1328. </varlistentry>
  1329. <varlistentry>
  1330. <term>commit</term>
  1331. <listitem>
  1332. <simpara>
  1333. Send all local changes to the configuration manager, which
  1334. will validate them, and apply them if validation succeeds.
  1335. </simpara>
  1336. </listitem>
  1337. </varlistentry>
  1338. <varlistentry>
  1339. <term>go</term>
  1340. <listitem>
  1341. <simpara>
  1342. Go to a specific configuration part, similar to the 'cd'
  1343. command in a shell.
  1344. <note>There are a number of problems with the current
  1345. implementation of go within <command>bindctl</command>,
  1346. and we recommend not using it for general cases.</note>
  1347. </simpara>
  1348. </listitem>
  1349. </varlistentry>
  1350. </variablelist>
  1351. </section>
  1352. <section id="bindctl_configuration_data_types">
  1353. <title>Configuration data types</title>
  1354. Configuration data can be of different types, which can be modified
  1355. in ways that depend on the types. There are a few syntax
  1356. restrictions on these types, but only basic ones. Modules may impose
  1357. additional restrictions on the values of elements.
  1358. <variablelist>
  1359. <varlistentry>
  1360. <term>integer</term>
  1361. <listitem>
  1362. <simpara>
  1363. A basic integer; can be set directly with
  1364. <command>config set</command>, to any integer
  1365. value. The value must not be quoted, or else, it
  1366. will be parsed as a string.
  1367. </simpara>
  1368. </listitem>
  1369. </varlistentry>
  1370. <varlistentry>
  1371. <term>real</term>
  1372. <listitem>
  1373. <simpara>
  1374. A basic floating point number; can be set
  1375. directly with <command>config set</command>, to
  1376. any floating point value. The value must not be
  1377. quoted, or else, it will be parsed as a string.
  1378. </simpara>
  1379. </listitem>
  1380. </varlistentry>
  1381. <varlistentry>
  1382. <term>boolean</term>
  1383. <listitem>
  1384. <simpara>
  1385. A basic boolean value; can be set directly with
  1386. <command>config set</command>, to either
  1387. <command>true</command> or
  1388. <command>false</command>. The value must not be
  1389. quoted, or else, it will be parsed as a
  1390. string. Integer values are not allowed.
  1391. </simpara>
  1392. </listitem>
  1393. </varlistentry>
  1394. <varlistentry>
  1395. <term>string</term>
  1396. <listitem>
  1397. <simpara>
  1398. A basic string value; can be set directly with
  1399. <command>config set</command> to any
  1400. string. Double quotation marks are optional.
  1401. </simpara>
  1402. </listitem>
  1403. </varlistentry>
  1404. <varlistentry>
  1405. <term>null</term>
  1406. <listitem>
  1407. <simpara>
  1408. This is a special type representing 'no value at all'; usable in compound structures that have optional elements that are not set.
  1409. </simpara>
  1410. </listitem>
  1411. </varlistentry>
  1412. <varlistentry>
  1413. <term>maps</term>
  1414. <listitem>
  1415. <simpara>
  1416. Maps are (pre-defined) compound collections of other
  1417. elements of any other type. They are not usually
  1418. modified directly, but their elements are. Every
  1419. top-level element for a module is a map containing
  1420. the configuration values for that map, which can
  1421. themselves be maps again. For instance, the Auth
  1422. module configuration is a map containing the
  1423. elements '<varname>listen_on</varname>' (list) and '<varname>tcp_recv_timeout</varname>'
  1424. (integer). When changing one of its values, they can
  1425. be modified directly with <command>config set
  1426. Auth/tcp_recv_timeout 3000</command>.
  1427. </simpara>
  1428. <simpara>
  1429. Some map entries are optional. If they are, and
  1430. currently have a value, the value can be unset by
  1431. using either <command>config unset
  1432. <replaceable>&lt;item name&gt;</replaceable>
  1433. </command> or <command>config set
  1434. <replaceable>&lt;item name&gt;</replaceable>
  1435. null</command>.
  1436. </simpara>
  1437. <simpara>
  1438. Maps <emphasis>can</emphasis> be modified as a whole,
  1439. but using the full JSON representation of
  1440. the entire map to set.
  1441. Since this involves a lot of text, this is usually
  1442. not recommended.
  1443. </simpara>
  1444. <simpara>
  1445. Another example is the Logging virtual module, which
  1446. is, like any module, a map, but it only contains one
  1447. element: a list of loggers. Normally, an
  1448. administrator would only modify that list (or its
  1449. elements) directly, but it is possible to set the
  1450. entire map in one command; for example:
  1451. <command> config set Logging { "loggers": [] } </command>
  1452. </simpara>
  1453. </listitem>
  1454. </varlistentry>
  1455. <varlistentry>
  1456. <term>list</term>
  1457. <listitem>
  1458. <simpara>
  1459. A list is a compound list of other elements of the
  1460. same type. Elements can be added with <command>config
  1461. add <replaceable>&lt;list name&gt; [value]</replaceable></command>, and removed with
  1462. <command>config remove <replaceable>&lt;list name&gt; [value]</replaceable></command> or
  1463. <command>config remove <replaceable>&lt;list name&gt;</replaceable><replaceable>&lt;index&gt;</replaceable></command>.
  1464. The index is of the form <emphasis>square bracket, number,
  1465. square bracket</emphasis> (e.g.
  1466. <command>[0]</command>), and it immediately follows
  1467. the list name (there is no separator or space
  1468. between them). List indices start with 0 for the
  1469. first element.
  1470. </simpara>
  1471. <simpara>
  1472. For addition, if the value is omitted, an entry with
  1473. default values will be added. For removal, either
  1474. the index or the full value (in JSON format) needs
  1475. to be specified.
  1476. </simpara>
  1477. <simpara>
  1478. Lists can also be used with
  1479. <command>config set</command>,
  1480. but like maps, only by specifying the
  1481. entire list value in JSON format.
  1482. </simpara>
  1483. <simpara>
  1484. For example, this command shows the port number used for the second element of the list <varname>listen_on</varname> in the Auth module:
  1485. <command> config show Auth/listen_on[1]/port</command>
  1486. </simpara>
  1487. </listitem>
  1488. </varlistentry>
  1489. <varlistentry>
  1490. <term>named set</term>
  1491. <listitem>
  1492. <simpara>
  1493. Named sets are similar to lists, in that they are
  1494. sets of elements of the same type, but they are not
  1495. indexed by numbers, but by strings.
  1496. </simpara>
  1497. <simpara>
  1498. Values can be added with
  1499. <command>config add <replaceable>&lt;item name&gt; &lt;string&gt; [value]</replaceable></command>
  1500. where 'string' is the name of the element. If 'value'
  1501. is ommitted, default values will be used. Elements
  1502. can be removed with <command>config remove
  1503. <replaceable>&lt;item
  1504. name&gt; &lt;string&gt;</replaceable></command>
  1505. </simpara>
  1506. <simpara>
  1507. Elements in a named set can be addressed similarly
  1508. to maps.
  1509. </simpara>
  1510. <simpara>
  1511. For example, the <command>Init/components</command>
  1512. elements is a named set;
  1513. adding, showing, and then removing an element
  1514. can be done with the following three commands (note
  1515. the '/'-character versus the space before
  1516. 'example_module'):
  1517. </simpara>
  1518. <simpara>
  1519. <command>config add Init/components example_module</command>
  1520. </simpara>
  1521. <simpara>
  1522. <command>config show Init/components/example_module</command>
  1523. </simpara>
  1524. <simpara>
  1525. <command>config remove Init/components example_module</command>
  1526. </simpara>
  1527. </listitem>
  1528. </varlistentry>
  1529. <varlistentry>
  1530. <term>any</term>
  1531. <listitem>
  1532. <simpara>
  1533. The 'any' type is a special type that can have any
  1534. form. Apart from that, it must consist of elements as
  1535. described in this chapter, there is no restriction
  1536. on which element types are used. This type is used
  1537. in places where different data formats could be
  1538. used. Element modification commands depend on the
  1539. actual type of the value. For instance, if the value
  1540. of an 'any' element is a list, <command>config add
  1541. </command> and <command>config remove</command> work
  1542. as for other lists.
  1543. </simpara>
  1544. </listitem>
  1545. </varlistentry>
  1546. </variablelist>
  1547. </section>
  1548. </section>
  1549. <section>
  1550. <title>The execute command</title>
  1551. The <command>execute</command> command executes a set of commands,
  1552. either from a file
  1553. or from a pre-defined set. Currently, the only predefined set is
  1554. <command>init_authoritative_server</command>, which adds
  1555. <command>b10-auth</command>, <command>b10-xfrin</command>, and
  1556. <command>b10-xfrout</command> to the set of components to be
  1557. started by BIND 10. This
  1558. pre-defined set does not commit the changes, so these modules do not
  1559. show up for commands or configuration until the user enters
  1560. <command>config commit</command> after
  1561. <command>execute init_authoritative_server</command>. For example:
  1562. <screen>&gt; <userinput>execute init_authoritative_server</userinput></screen>
  1563. <screen>&gt; <userinput>execute file /tmp/example_commands</userinput></screen>
  1564. The optional argument <command>show</command> displays the exact set of
  1565. commands that would be executed; for example:
  1566. <screen>&gt; <userinput>execute init_authoritative_server show</userinput>
  1567. !echo adding Authoritative server component
  1568. config add /Init/components b10-auth
  1569. config set /Init/components/b10-auth/kind needed
  1570. config set /Init/components/b10-auth/special auth
  1571. !echo adding Xfrin component
  1572. config add /Init/components b10-xfrin
  1573. config set /Init/components/b10-xfrin/address Xfrin
  1574. config set /Init/components/b10-xfrin/kind dispensable
  1575. !echo adding Xfrout component
  1576. config add /Init/components b10-xfrout
  1577. config set /Init/components/b10-xfrout/address Xfrout
  1578. config set /Init/components/b10-xfrout/kind dispensable
  1579. !echo adding Zone Manager component
  1580. config add /Init/components b10-zonemgr
  1581. config set /Init/components/b10-zonemgr/address Zonemgr
  1582. config set /Init/components/b10-zonemgr/kind dispensable
  1583. !echo Components added. Please enter "config commit" to
  1584. !echo finalize initial setup and run the components.
  1585. </screen>
  1586. The optional <command>show</command> argument may also be used when
  1587. executing a script from a file; for example:
  1588. <screen>&gt; <userinput>execute file /tmp/example_commands show</userinput></screen>
  1589. <section id="bindctl_execute_directives">
  1590. <title>Execute directives</title>
  1591. Within sets of commands to be run with the <command>execute</command>
  1592. command, a number of directives are supported:
  1593. <variablelist>
  1594. <varlistentry>
  1595. <term>!echo <replaceable>&lt;string&gt;</replaceable></term>
  1596. <listitem>
  1597. <simpara>
  1598. Prints the given string to <command>bindctl</command>'s
  1599. output.
  1600. </simpara>
  1601. </listitem>
  1602. </varlistentry>
  1603. <varlistentry>
  1604. <term>!verbose on</term>
  1605. <listitem>
  1606. <simpara>
  1607. Enables verbose mode; all following commands that are to
  1608. be executed are also printed.
  1609. </simpara>
  1610. </listitem>
  1611. </varlistentry>
  1612. <varlistentry>
  1613. <term>!verbose off</term>
  1614. <listitem>
  1615. <simpara>
  1616. Disables verbose mode; following commands that are to
  1617. be executed are no longer printed.
  1618. </simpara>
  1619. </listitem>
  1620. </varlistentry>
  1621. </variablelist>
  1622. </section>
  1623. <section id="bindctl_execute_notes">
  1624. <title>Notes on execute scripts</title>
  1625. Within scripts, you can add or remove modules with the normal
  1626. configuration commands for <command>Init/components</command>.
  1627. However, as module
  1628. configuration and commands do not show up until the module is
  1629. running, it is currently not possible to add a module and set
  1630. its configuration in one script. This will be addressed in the
  1631. future, but for now the only option is to add and configure
  1632. modules in separate commands and execute scripts.
  1633. </section>
  1634. </section>
  1635. </chapter>
  1636. <chapter id="common">
  1637. <title>Common configuration elements</title>
  1638. <para>
  1639. Some things are configured in the same or similar manner across
  1640. many modules. So we show them here in one place.
  1641. </para>
  1642. <section id='common-tsig'>
  1643. <title>TSIG keys</title>
  1644. <para>
  1645. TSIG is a way to sign requests and responses in DNS. It is defined in
  1646. RFC 2845 and uses symmetric cryptography to sign the DNS messages. If
  1647. you want to make any use of TSIG (to authenticate transfers or DDNS,
  1648. for example), you need to set up shared secrets between the endpoints.
  1649. </para>
  1650. <para>
  1651. BIND 10 uses a global key ring for the secrets. It doesn't currently
  1652. mean they would be stored differently, they are just in one place of
  1653. the configuration.
  1654. </para>
  1655. <section id='tsig-key-syntax'>
  1656. <title>Key anatomy and syntax</title>
  1657. <para>
  1658. Each key has three attributes. One is a name by which it is referred
  1659. both in DNS packets and the rest of the configuration. Another is the
  1660. algorithm used to compute the signature. And the last part is a
  1661. base64 encoded secret, which might be any blob of data.
  1662. </para>
  1663. <para>
  1664. The parts are written into a string, concatenated together by colons.
  1665. So if you wanted to have a key called "example.key", used as a
  1666. HMAC-MD5 key with secret "secret", you'd write it as:
  1667. <screen>"example.key.:c2VjcmV0:hmac-md5"</screen>
  1668. </para>
  1669. <para>
  1670. The HMAC-MD5 algorithm is the default, so you can omit it. You could
  1671. write the same key as:
  1672. <screen>"example.key.:c2VjcmV0"</screen>
  1673. </para>
  1674. <para>
  1675. You can also use these algorithms (which may not be omitted from the
  1676. key definition if used):
  1677. <itemizedlist>
  1678. <listitem>hmac-sha1</listitem>
  1679. <listitem>hmac-sha224</listitem>
  1680. <listitem>hmac-sha256</listitem>
  1681. <listitem>hmac-sha384</listitem>
  1682. <listitem>hmac-sha512</listitem>
  1683. </itemizedlist>
  1684. </para>
  1685. <para>
  1686. The name of the key must be a valid DNS name.
  1687. </para>
  1688. </section>
  1689. <section id='tsig-key-ring'>
  1690. <title>Key ring</title>
  1691. <para>
  1692. The key ring lives in the configuration in "tsig_keys/keys". Most of
  1693. the system uses the keys from there &mdash; ACLs, authoritative server to
  1694. sign responses to signed queries, and <command>b10-xfrin</command>
  1695. and <command>b10-xfrout</command> to sign transfers.
  1696. </para>
  1697. <para>
  1698. The key ring is just a list of strings, each describing one key. So,
  1699. to add a new key, you can do this:
  1700. <screen>&gt; <userinput>config add tsig_keys/keys "example.key.:c2VjcmV0"</userinput>
  1701. &gt; <userinput>config show tsig_keys/keys</userinput>
  1702. tsig_keys/keys[0] "example.key.:c2VjcmV0" string (modified)
  1703. &gt; <userinput>config commit</userinput></screen>
  1704. </para>
  1705. <para>
  1706. You can keep as many keys as you want in the key ring, but each must
  1707. have a different name.
  1708. </para>
  1709. </section>
  1710. </section>
  1711. <section id='common-acl'>
  1712. <title>ACLs</title>
  1713. <para>
  1714. An ACL, or Access Control List, is a way to describe if a request
  1715. is allowed or disallowed. The principle is, there's a list of rules.
  1716. Each rule is a name-value mapping (a dictionary, in the JSON
  1717. terminology). Each rule must contain exactly one mapping called
  1718. "action", which describes what should happen if the rule applies.
  1719. There may be more mappings, called matches, which describe the
  1720. conditions under which the rule applies.
  1721. </para>
  1722. <para>
  1723. When there's a query, the first rule is examined. If it matches, the
  1724. action in it is taken. If not, next rule is examined. If there are no
  1725. more rules to examine, a default action is taken.
  1726. </para>
  1727. <para>
  1728. There are three possible "action" values. The "ACCEPT" value means
  1729. the query is handled. If it is "REJECT", the query is not answered,
  1730. but a polite error message is sent back (if that makes sense in the
  1731. context). The "DROP" action acts like a black hole. The query is
  1732. not answered and no error message is sent.
  1733. </para>
  1734. <para>
  1735. If there are multiple matching conditions inside the rule, all of
  1736. them must be satisfied for the rule to apply. This can be used,
  1737. for example, to require the query to be signed by a TSIG key and
  1738. originate from given address.
  1739. </para>
  1740. <para>
  1741. This is encoded in form of JSON. Semi-formal description could look
  1742. something like this. It is described in more details below.
  1743. <!-- FIXME: Is <screen> really the correct one?-->
  1744. <screen>ACL := [ RULE, RULE, ... ]
  1745. RULE := { "action": "ACCEPT"|"REJECT"|"DROP", MATCH, MATCH, ... }
  1746. RULE_RAW := { MATCH, MATCH, ... }
  1747. MATCH := FROM_MATCH|KEY_MATCH|NOT_MATCH|OR_MATCH|AND_MATCH|...
  1748. FROM_MATCH := "from": [RANGE, RANGE, RANGE, ...] | RANGE
  1749. RANGE := "&lt;ip range&gt;"
  1750. KEY_MATCH := "key": [KEY, KEY, KEY, ...] | KEY
  1751. KEY := "&lt;key name&gt;"
  1752. NOT_MATCH := "NOT": RULE_RAW
  1753. OR_MATCH := "ANY": [ RULE_RAW, RULE_RAW, ... ]
  1754. AND_MATCH := "ALL": [ RULE_RAW, RULE_RAW, ... ]
  1755. </screen>
  1756. </para>
  1757. <section>
  1758. <title>Matching properties</title>
  1759. <para>
  1760. The first thing you can check against is the source address
  1761. of request. The name is <varname>from</varname> and the value
  1762. is a string containing either a single IPv4 or IPv6 address,
  1763. or a range in the usual slash notation (eg. "192.0.2.0/24").
  1764. </para>
  1765. <para>
  1766. The other is TSIG key by which the message was signed. The ACL
  1767. contains only the name (under the name "key"), the key itself
  1768. must be stored in the global key ring (see <xref
  1769. linkend="tsig-key-ring"/>).
  1770. This property is applicable only to the DNS context.
  1771. </para>
  1772. <para>
  1773. More properties to match are planned &mdash; the destination
  1774. address, ports, matches against the packet content.
  1775. </para>
  1776. </section>
  1777. <section>
  1778. <title>More complicated matches</title>
  1779. <para>
  1780. From time to time, you need to express something more complex
  1781. than just a single address or key.
  1782. </para>
  1783. <para>
  1784. You can specify a list of values instead of single value. Then
  1785. the property needs to match at least one of the values listed
  1786. &mdash; so you can say <quote>"from": ["192.0.2.0/24",
  1787. "2001:db8::/32"]</quote> to match any address in the ranges
  1788. set aside for documentation. The keys or any future properties
  1789. will work in a similar way.
  1790. </para>
  1791. <para>
  1792. If that is not enough, you can compose the matching conditions
  1793. to logical expressions. They are called "ANY", "ALL" and "NOT".
  1794. The "ANY" and "ALL" ones contain lists of subexpressions &mdash;
  1795. each subexpression is a similar dictionary, just not containing
  1796. the "action" element. The "NOT" contains single subexpression.
  1797. Their function should be obvious &mdash; "NOT" matches if and
  1798. only if the subexpression does not match. The "ALL" matches exactly
  1799. when each of the subexpressions matches and "ANY" when at least
  1800. one matches.
  1801. </para>
  1802. </section>
  1803. <section>
  1804. <title>Examples</title>
  1805. <para>
  1806. All the examples here is just the JSON representing the ACL,
  1807. nicely formatted and split across lines. They are out of any
  1808. surrounding context. This is similar to what you'd get from
  1809. <command>config show_json</command> called on the entry containing
  1810. the ACL.
  1811. </para>
  1812. <para>
  1813. In the first example, the ACL accepts queries from two known hosts.
  1814. Each host has an IP addresses (both IPv4 and IPv6) and a TSIG
  1815. key. Other queries are politely rejected. The last entry in the list
  1816. has no conditions &mdash; making it match any query.
  1817. <screen>[
  1818. {
  1819. "from": ["192.0.2.1", "2001:db8::1"],
  1820. "key": "first.key",
  1821. "action": "ACCEPT"
  1822. },
  1823. {
  1824. "from": ["192.0.2.2", "2001:db8::2"],
  1825. "key": "second.key",
  1826. "action": "ACCEPT"
  1827. },
  1828. {
  1829. "action": "REJECT"
  1830. }
  1831. ]</screen>
  1832. </para>
  1833. <para>
  1834. Now we show two ways to accept only the queries from private ranges.
  1835. This is the same as rejecting anything that is outside.
  1836. <screen>[
  1837. {
  1838. "from": [
  1839. "10.0.0.0/8",
  1840. "172.16.0.0/12",
  1841. "192.168.0.0/16",
  1842. "fc00::/7"
  1843. ],
  1844. "action": "ACCEPT"
  1845. },
  1846. {
  1847. "action": "REJECT"
  1848. }
  1849. ]</screen>
  1850. <screen>[
  1851. {
  1852. "NOT": {
  1853. "ANY": [
  1854. {"from": "10.0.0.0/8"},
  1855. {"from": "172.16.0.0/12"},
  1856. {"from": "192.168.0.0/16"},
  1857. {"from": "fc00::/7"}
  1858. ]
  1859. },
  1860. "action": "REJECT"
  1861. },
  1862. {
  1863. "action": "ACCEPT"
  1864. }
  1865. ]</screen>
  1866. </para>
  1867. </section>
  1868. <section>
  1869. <title>Interaction with <command>bindctl</command></title>
  1870. <para>
  1871. Currently, <command>bindctl</command> has hard time coping with
  1872. the variable nature of the ACL syntax. This technical limitation
  1873. makes it impossible to edit parts of the entries. You need to
  1874. set the whole entry at once, providing the whole JSON value.
  1875. </para>
  1876. <para>
  1877. This limitation is planned to be solved soon at least partially.
  1878. </para>
  1879. <para>
  1880. You'd do something like this to create the second example.
  1881. Note that the whole JSON must be on a single line.
  1882. <screen>&gt; <userinput>config add somewhere/acl</userinput>
  1883. &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>
  1884. &gt; <userinput>config add somewhere/acl</userinput>
  1885. &gt; <userinput>config set somewhere/acl[1] { "action": "REJECT" }</userinput>
  1886. &gt; <userinput>config commit</userinput></screen>
  1887. </para>
  1888. </section>
  1889. </section>
  1890. </chapter>
  1891. <chapter id="bind10.config">
  1892. <title>bind10 Control and Configuration</title>
  1893. <para>
  1894. This chapter explains how to control and configure the
  1895. <command>b10-init</command> parent.
  1896. The startup of this resident process that runs the BIND 10
  1897. daemons is covered in <xref linkend="bind10"/>.
  1898. </para>
  1899. <section id="bind10.shutdown">
  1900. <title>Stopping bind10</title>
  1901. <para>
  1902. The BIND 10 suite may be shut down by stopping the
  1903. parent <command>b10-init</command> process. This may be done
  1904. by running the <userinput>Init shutdown</userinput> command
  1905. at the <command>bindctl</command> prompt.
  1906. </para>
  1907. </section>
  1908. <section id="bind10.components">
  1909. <title>Configuration to start processes</title>
  1910. <para>
  1911. The processes to be used can be configured for
  1912. <command>b10-init</command> to start, with the exception
  1913. of the required <command>b10-sockcreator</command>,
  1914. <command>b10-msgq</command> and <command>b10-cfgmgr</command>
  1915. components.
  1916. The configuration is in the <varname>Init/components</varname>
  1917. section. Each element represents one component, which is
  1918. an abstraction of a process.
  1919. </para>
  1920. <para>
  1921. To add a process to the set, let's say the resolver (which
  1922. is not started by default), you would do this:
  1923. <screen>&gt; <userinput>config add Init/components b10-resolver</userinput>
  1924. &gt; <userinput>config set Init/components/b10-resolver/special resolver</userinput>
  1925. &gt; <userinput>config set Init/components/b10-resolver/kind needed</userinput>
  1926. &gt; <userinput>config set Init/components/b10-resolver/priority 10</userinput>
  1927. &gt; <userinput>config commit</userinput></screen></para>
  1928. <para>
  1929. Now, what it means. We add an entry called
  1930. <quote>b10-resolver</quote>. It is both a name used to
  1931. reference this component in the configuration and the name
  1932. of the process to start. Then we set some parameters on
  1933. how to start it.
  1934. </para>
  1935. <para>
  1936. The <varname>special</varname> setting is for components
  1937. that need some kind of special care during startup or
  1938. shutdown. Unless specified, the component is started in a
  1939. usual way. This is the list of components that need to be
  1940. started in a special way, with the value of special used
  1941. for them:
  1942. <!-- TODO: this still doesn't explain why they are special -->
  1943. <table>
  1944. <title>Special startup components</title>
  1945. <tgroup cols='3' align='left'>
  1946. <colspec colname='component'/>
  1947. <colspec colname='special'/>
  1948. <colspec colname='description'/>
  1949. <thead><row><entry>Component</entry><entry>Special</entry><entry>Description</entry></row></thead>
  1950. <tbody>
  1951. <row><entry>b10-auth</entry><entry>auth</entry><entry>Authoritative DNS server</entry></row>
  1952. <row><entry>b10-resolver</entry><entry>resolver</entry><entry>DNS resolver</entry></row>
  1953. <row><entry>b10-cmdctl</entry><entry>cmdctl</entry><entry>Command control (remote control interface)</entry></row>
  1954. <!-- TODO Either add xfrin and xfrout as well or clean up the workarounds in b10-init before the release -->
  1955. </tbody>
  1956. </tgroup>
  1957. </table>
  1958. </para>
  1959. <para>
  1960. The <varname>kind</varname> specifies how a failure of the
  1961. component should be handled. If it is set to
  1962. <quote>dispensable</quote> (the default unless you set
  1963. something else), it will get started again if it fails. If
  1964. it is set to <quote>needed</quote> and it fails at startup,
  1965. the whole <command>b10-init</command> shuts down and exits
  1966. with an error exit code. But if it fails some time later, it
  1967. is just started again. If you set it to <quote>core</quote>,
  1968. you indicate that the system is not usable without the
  1969. component and if such component fails, the system shuts
  1970. down no matter when the failure happened. This is the
  1971. behavior of the core components (the ones you can't turn
  1972. off), but you can declare any other components as core as
  1973. well if you wish (but you can turn these off, they just
  1974. can't fail).
  1975. </para>
  1976. <para>
  1977. The <varname>priority</varname> defines order in which the
  1978. components should start. The ones with higher numbers are
  1979. started sooner than the ones with lower ones. If you don't
  1980. set it, 0 (zero) is used as the priority. Usually, leaving
  1981. it at the default is enough.
  1982. </para>
  1983. <para>
  1984. There are other parameters we didn't use in our example.
  1985. One of them is <varname>address</varname>. It is the address
  1986. used by the component on the <command>b10-msgq</command>
  1987. message bus. The special components already know their
  1988. address, but the usual ones don't. The address is by
  1989. convention the thing after <emphasis>b10-</emphasis>, with
  1990. the first letter capitalized (eg. <command>b10-stats</command>
  1991. would have <quote>Stats</quote> as its address).
  1992. <!-- TODO: this should be simplified so we don't even have to document it -->
  1993. </para>
  1994. <!-- TODO: what does "The special components already know their
  1995. address, but the usual ones don't." mean? -->
  1996. <!-- TODO: document params when is enabled -->
  1997. <para>
  1998. The last one is <varname>process</varname>. It is the name
  1999. of the process to be started. It defaults to the name of
  2000. the component if not set, but you can use this to override
  2001. it. (The special components also already know their
  2002. executable name.)
  2003. </para>
  2004. <!-- TODO Add parameters when they work, not implemented yet-->
  2005. <note>
  2006. <para>
  2007. The configuration is quite powerful, but that includes
  2008. a lot of space for mistakes. You could turn off the
  2009. <command>b10-cmdctl</command>, but then you couldn't
  2010. change it back the usual way, as it would require it to
  2011. be running (you would have to find and edit the configuration
  2012. directly). Also, some modules might have dependencies:
  2013. <command>b10-stats-httpd</command> needs
  2014. <command>b10-stats</command>, <command>b10-xfrout</command>
  2015. needs <command>b10-auth</command> to be running, etc.
  2016. <!-- TODO: should we define dependencies? -->
  2017. </para>
  2018. <para>
  2019. In short, you should think twice before disabling something here.
  2020. </para>
  2021. </note>
  2022. <para>
  2023. It is possible to start some components multiple times (currently
  2024. <command>b10-auth</command> and <command>b10-resolver</command>).
  2025. You might want to do that to gain more performance (each one uses only
  2026. single core). Just put multiple entries under different names, like
  2027. this, with the same config:
  2028. <screen>&gt; <userinput>config add Init/components b10-resolver-2</userinput>
  2029. &gt; <userinput>config set Init/components/b10-resolver-2/special resolver</userinput>
  2030. &gt; <userinput>config set Init/components/b10-resolver-2/kind needed</userinput>
  2031. &gt; <userinput>config commit</userinput></screen>
  2032. </para>
  2033. <para>
  2034. However, this is work in progress and the support is not yet complete.
  2035. For example, each resolver will have its own cache, each authoritative
  2036. server will keep its own copy of in-memory data and there could be
  2037. problems with locking the sqlite database, if used. The configuration
  2038. might be changed to something more convenient in future.
  2039. Other components don't expect such a situation, so it would
  2040. probably not do what you want. Such support is yet to be
  2041. implemented.
  2042. </para>
  2043. <para>
  2044. The running processes started by <command>b10-init</command>
  2045. may be listed by running <userinput>Init show_processes</userinput>
  2046. using <command>bindctl</command>.
  2047. </para>
  2048. </section>
  2049. </chapter>
  2050. <chapter id="authserver">
  2051. <title>Authoritative Server</title>
  2052. <para>
  2053. The <command>b10-auth</command> is the authoritative DNS server.
  2054. It supports EDNS0, DNSSEC, IPv6, and SQLite3 and in-memory zone
  2055. data backends.
  2056. Normally it is started by the <command>b10-init</command> master
  2057. process.
  2058. </para>
  2059. <section>
  2060. <title>Server Configurations</title>
  2061. <!-- TODO: offers command line options but not used
  2062. since we used bind10 -->
  2063. <para>
  2064. <command>b10-auth</command> is configured via the
  2065. <command>b10-cfgmgr</command> configuration manager.
  2066. The module name is <quote>Auth</quote>.
  2067. The configuration data items are:
  2068. <variablelist>
  2069. <varlistentry>
  2070. <term>database_file</term>
  2071. <listitem>
  2072. <simpara>This is an optional string to define the path to find
  2073. the SQLite3 database file.
  2074. <!-- TODO: -->
  2075. Note: This may be a temporary setting because the DNS server
  2076. can use various data source backends.
  2077. </simpara>
  2078. </listitem>
  2079. </varlistentry>
  2080. <!-- NOTE: docs pulled in verbatim from the b10-auth.xml manual page.
  2081. TODO: automate this if want this or rewrite
  2082. -->
  2083. <varlistentry>
  2084. <term>datasources</term>
  2085. <listitem>
  2086. <simpara>
  2087. <varname>datasources</varname> configures data sources.
  2088. The list items include:
  2089. <varname>type</varname> to define the required data source type
  2090. (such as <quote>memory</quote>);
  2091. <varname>class</varname> to optionally select the class
  2092. (it defaults to <quote>IN</quote>);
  2093. and
  2094. <varname>zones</varname> to define
  2095. the <varname>file</varname> path name,
  2096. the <varname>filetype</varname> (<quote>sqlite3</quote> to load
  2097. from a SQLite3 database file or <quote>text</quote> to
  2098. load from a master text file),
  2099. and the <varname>origin</varname> (default domain).
  2100. By default, this is empty.
  2101. <note><simpara>
  2102. Currently this is only used for the memory data source.
  2103. Only the IN class is supported at this time.
  2104. By default, the memory data source is disabled.
  2105. Also, currently the zone file must be canonical such as
  2106. generated by <command>named-compilezone -D</command>, or
  2107. must be an SQLite3 database.
  2108. </simpara></note>
  2109. </simpara>
  2110. </listitem>
  2111. </varlistentry>
  2112. <varlistentry>
  2113. <term>listen_on</term>
  2114. <listitem>
  2115. <simpara>
  2116. <varname>listen_on</varname> is a list of addresses and ports for
  2117. <command>b10-auth</command> to listen on.
  2118. The list items are the <varname>address</varname> string
  2119. and <varname>port</varname> number.
  2120. By default, <command>b10-auth</command> listens on port 53
  2121. on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
  2122. <note>
  2123. <simpara>
  2124. The default configuration is currently not appropriate for a multi-homed host.
  2125. In case you have multiple public IP addresses, it is possible the
  2126. query UDP packet comes through one interface and the answer goes out
  2127. through another. The answer will probably be dropped by the client, as it
  2128. has a different source address than the one it sent the query to. The
  2129. client would fallback on TCP after several attempts, which works
  2130. well in this situation, but is clearly not ideal.
  2131. </simpara>
  2132. <simpara>
  2133. There are plans to solve the problem such that the server handles
  2134. it by itself. But until it is actually implemented, it is recommended to
  2135. alter the configuration &mdash; remove the wildcard addresses and list all
  2136. addresses explicitly. Then the server will answer on the same
  2137. interface the request came on, preserving the correct address.
  2138. </simpara>
  2139. </note>
  2140. </simpara>
  2141. </listitem>
  2142. </varlistentry>
  2143. <varlistentry>
  2144. <term>tcp_recv_timeout</term>
  2145. <listitem>
  2146. <simpara>
  2147. <varname>tcp_recv_timeout</varname> is the timeout used on
  2148. incoming TCP connections, in milliseconds. If the query
  2149. is not sent within this time, the connection is closed.
  2150. Setting this to 0 will disable TCP timeouts completely.
  2151. </simpara>
  2152. </listitem>
  2153. </varlistentry>
  2154. </variablelist>
  2155. </para>
  2156. <para>
  2157. The configuration commands are:
  2158. <variablelist>
  2159. <varlistentry>
  2160. <term>loadzone</term>
  2161. <listitem>
  2162. <simpara>
  2163. <command>loadzone</command> tells <command>b10-auth</command>
  2164. to load or reload a zone file. The arguments include:
  2165. <varname>class</varname> which optionally defines the class
  2166. (it defaults to <quote>IN</quote>);
  2167. <varname>origin</varname> is the domain name of the zone;
  2168. and
  2169. <varname>datasrc</varname> optionally defines the type of datasource
  2170. (it defaults to <quote>memory</quote>).
  2171. <note><simpara>
  2172. Currently this only supports the
  2173. IN class and the memory data source.
  2174. </simpara></note>
  2175. </simpara>
  2176. </listitem>
  2177. </varlistentry>
  2178. <varlistentry>
  2179. <term>getstats</term>
  2180. <listitem>
  2181. <simpara>
  2182. <command>getstats</command> requests <command>b10-auth</command>
  2183. to send its statistics data to
  2184. <citerefentry><refentrytitle>b10-stats</refentrytitle>
  2185. <manvolnum>8</manvolnum></citerefentry>
  2186. as a response of the command.
  2187. </simpara>
  2188. </listitem>
  2189. </varlistentry>
  2190. <varlistentry>
  2191. <term>shutdown</term>
  2192. <listitem>
  2193. <simpara>Stop the authoritative DNS server.
  2194. This has an optional <varname>pid</varname> argument to
  2195. select the process ID to stop.
  2196. (Note that the BIND 10 init process may restart this service
  2197. if configured.)
  2198. </simpara>
  2199. </listitem>
  2200. </varlistentry>
  2201. </variablelist>
  2202. </para>
  2203. <!-- TODO: examples of setting or running above? -->
  2204. </section>
  2205. <section id='datasrc'>
  2206. <title>Data Source Backends</title>
  2207. <para>
  2208. Bind 10 has the concept of data sources. A data source is a place
  2209. where authoritative zone data reside and where they can be served
  2210. from. This can be a master file, a database or something completely
  2211. different.
  2212. </para>
  2213. <para>
  2214. Once a query arrives, <command>b10-auth</command> goes through a
  2215. configured list of data sources and finds the one containing a best
  2216. matching zone. From the equally good ones, the first one is taken.
  2217. This data source is then used to answer the query.
  2218. </para>
  2219. <note><para>
  2220. In the current release, <command>b10-auth</command>
  2221. can serve data from a SQLite3 data source backend and from master
  2222. files.
  2223. Upcoming versions will be able to use multiple different
  2224. data sources, such as MySQL and Berkeley DB.
  2225. </para></note>
  2226. <para>
  2227. The configuration is located in data_sources/classes. Each item there
  2228. represents one RR class and a list used to answer queries for that
  2229. class. The default contains two classes. The CH class contains a
  2230. built-in data source &mdash; one that serves things like
  2231. <quote>AUTHORS.BIND.</quote>. The IN class contains single SQLite3
  2232. data source with database file located at
  2233. <filename>/usr/local/var/bind10/zone.sqlite3</filename>.
  2234. </para>
  2235. <para>
  2236. Each data source has several options. The first one is
  2237. <varname>type</varname>, which specifies the type of data source to
  2238. use. Valid types include the ones listed below, but BIND 10 uses
  2239. dynamically loaded modules for them, so there may be more in your
  2240. case. This option is mandatory.
  2241. </para>
  2242. <para>
  2243. Another option is <varname>params</varname>. This option is type
  2244. specific; it holds different data depending on the type
  2245. above. Also, depending on the type, it could be possible to omit it.
  2246. </para>
  2247. <para>
  2248. There are two options related to the so-called cache. If you enable
  2249. cache, zone data from the data source are loaded into memory.
  2250. Then, when answering a query, <command>b10-auth</command> looks
  2251. into the memory only instead of the data source, which speeds
  2252. answering up. The first option is <varname>cache-enable</varname>,
  2253. a boolean value turning the cache on and off (off is the default).
  2254. The second one, <varname>cache-zones</varname>, is a list of zone
  2255. origins to load into in-memory.
  2256. <!-- NOT YET: http://bind10.isc.org/ticket/2240
  2257. Once the cache is enabled,
  2258. the zones in the data source not listed in
  2259. <varname>cache-zones</varname> will not be loaded and will
  2260. not be available at all.
  2261. -->
  2262. </para>
  2263. <section id='datasource-types'>
  2264. <title>Data source types</title>
  2265. <para>
  2266. As mentioned, the type used by default is <quote>sqlite3</quote>.
  2267. It has single configuration option inside <varname>params</varname>
  2268. &mdash; <varname>database_file</varname>, which contains the path
  2269. to the SQLite3 file containing the data.
  2270. </para>
  2271. <para>
  2272. Another type is called <quote>MasterFiles</quote>. This one is
  2273. slightly special. The data are stored in RFC1034 master files.
  2274. Because answering directly from them would be impractical,
  2275. this type mandates the cache to be enabled. Also, the list of
  2276. zones (<varname>cache-zones</varname>) should be omitted. The
  2277. <varname>params</varname> is a dictionary mapping from zone
  2278. origins to the files they reside in.
  2279. </para>
  2280. </section>
  2281. <section id='datasrc-examples'>
  2282. <title>Examples</title>
  2283. <para>
  2284. As this is one of the more complex configurations of BIND 10,
  2285. we show some examples. They all assume they start with default
  2286. configuration.
  2287. </para>
  2288. <para>
  2289. First, let's disable the built-in data source
  2290. (<quote>VERSION.BIND</quote> and friends). As it is the only
  2291. data source in the CH class, we can remove the whole class.
  2292. <screen>&gt; <userinput>config remove data_sources/classes CH</userinput>
  2293. &gt; <userinput>config commit</userinput></screen>
  2294. </para>
  2295. <para>
  2296. Another one, let's say our default data source contains zones
  2297. <quote>example.org.</quote> and <quote>example.net.</quote>.
  2298. We want them to be served from memory to make the answering
  2299. faster.
  2300. <screen>&gt; <userinput>config set data_sources/classes/IN[0]/cache-enable true</userinput>
  2301. &gt; <userinput>config add data_sources/classes/IN[0]/cache-zones example.org.</userinput>
  2302. &gt; <userinput>config add data_sources/classes/IN[0]/cache-zones example.net.</userinput>
  2303. &gt; <userinput>config commit</userinput></screen>
  2304. Now every time the zone in the data source is changed by the
  2305. operator, the authoritative server needs to be told to reload it, by
  2306. <screen>&gt; <userinput>Auth loadzone example.org</userinput></screen>
  2307. You don't need to do this when the zone is modified by
  2308. <command>b10-xfrin</command>; it does so automatically.
  2309. </para>
  2310. <para>
  2311. Now, the last example is when there are master files we want to
  2312. serve in addition to whatever is inside the SQLite3 database.
  2313. <screen>&gt; <userinput>config add data_sources/classes/IN</userinput>
  2314. &gt; <userinput>config set data_sources/classes/IN[1]/type MasterFiles</userinput>
  2315. &gt; <userinput>config set data_sources/classes/IN[1]/cache-enable true</userinput>
  2316. &gt; <userinput>config set data_sources/classes/IN[1]/params { "example.org": "/path/to/example.org", "example.com": "/path/to/example.com" }</userinput>
  2317. &gt; <userinput>config commit</userinput></screen>
  2318. Unfortunately, due to current technical limitations, the
  2319. params must be set as one JSON blob. To reload a zone, use the
  2320. same <command>Auth loadzone</command> command as above.
  2321. </para>
  2322. <para>
  2323. Initially, a map value has to be set, but this value may be an
  2324. empty map. After that, key/value pairs can be added with
  2325. <command>config add</command> and keys can be removed with
  2326. <command>config remove</command>. The initial value may be an
  2327. empty map, but it has to be set before zones are added or
  2328. removed.
  2329. <screen>
  2330. &gt; <userinput>config set data_sources/classes/IN[1]/params {}</userinput>
  2331. &gt; <userinput>config add data_sources/classes/IN[1]/params another.example.org /path/to/another.example.org</userinput>
  2332. &gt; <userinput>config add data_sources/classes/IN[1]/params another.example.com /path/to/another.example.com</userinput>
  2333. &gt; <userinput>config remove data_sources/classes/IN[1]/params another.example.org</userinput>
  2334. &gt; <userinput>config commit</userinput></screen>
  2335. </para>
  2336. </section>
  2337. <note>
  2338. <para>
  2339. There's also <varname>Auth/database_file</varname> configuration
  2340. variable, pointing to a SQLite3 database file. This is no longer
  2341. used by <command>b10-auth</command>, but it is left in place for
  2342. now, since other modules use it. Once <command>b10-zonemgr</command>,
  2343. <command>b10-xfrout</command> and <command>b10-ddns</command>
  2344. are ported to the new configuration, this will disappear. But for
  2345. now, make sure that if you use any of these modules, the new
  2346. and old configuration correspond. The defaults are consistent, so
  2347. unless you tweaked either the new or the old configuration, you're
  2348. good.
  2349. </para>
  2350. </note>
  2351. <section id='datasrc-static'>
  2352. <title>Adding a static data source</title>
  2353. <para>
  2354. BIND 10 includes a zone file named
  2355. <filename>static.zone</filename> in the CH (Chaos) class for
  2356. providing information about the server via the AUTHORS.BIND
  2357. and VERSION.BIND TXT records. By default, this BIND zone is
  2358. configured and its records are served.
  2359. </para>
  2360. <para>
  2361. If you have removed this zone from the configuration (e.g., by
  2362. using the commands in the previous section to disable the
  2363. "built-in data source"), here is how you can add it back to
  2364. serve the zones in the <filename>static.zone</filename> file.
  2365. </para>
  2366. <para>First, add the CH class if it doesn't exist:
  2367. <screen>&gt; <userinput>config add data_sources/classes CH</userinput>
  2368. &gt; <userinput>config commit</userinput></screen>
  2369. Then, add a data source of type <emphasis>MasterFiles</emphasis>
  2370. in the CH class to serve the zones in
  2371. <filename>static.zone</filename>:
  2372. <screen>&gt; <userinput>config add data_sources/classes/CH</userinput>
  2373. &gt; <userinput>config set data_sources/classes/CH[0]/type MasterFiles</userinput>
  2374. &gt; <userinput>config set data_sources/classes/CH[0]/cache-enable true</userinput>
  2375. &gt; <userinput>config set data_sources/classes/CH[0]/params {"BIND": "/usr/local/bind10/share/bind10/static.zone"}</userinput>
  2376. &gt; <userinput>config commit</userinput></screen>
  2377. Then, lookup the static data from
  2378. <filename>static.zone</filename> to test it (assuming your
  2379. authoritative server is running on <command>localhost</command>):
  2380. <screen>&gt; <userinput>dig @localhost -c CH -t TXT version.bind</userinput>
  2381. &gt; <userinput>dig @localhost -c CH -t TXT authors.bind</userinput></screen>
  2382. </para>
  2383. </section>
  2384. </section>
  2385. <section>
  2386. <title>Loading Master Zones Files</title>
  2387. <para>
  2388. RFC 1035 style DNS master zone files may imported
  2389. into a BIND 10 SQLite3 data source by using the
  2390. <command>b10-loadzone</command> utility.
  2391. </para>
  2392. <para>
  2393. <command>b10-loadzone</command> supports the following
  2394. special directives (control entries):
  2395. <variablelist>
  2396. <varlistentry>
  2397. <term>$INCLUDE</term>
  2398. <listitem>
  2399. <simpara>Loads an additional zone file. This may be recursive.
  2400. </simpara>
  2401. </listitem>
  2402. </varlistentry>
  2403. <varlistentry>
  2404. <term>$ORIGIN</term>
  2405. <listitem>
  2406. <simpara>Defines the relative domain name.
  2407. </simpara>
  2408. </listitem>
  2409. </varlistentry>
  2410. <varlistentry>
  2411. <term>$TTL</term>
  2412. <listitem>
  2413. <simpara>Defines the time-to-live value used for following
  2414. records that don't include a TTL.
  2415. </simpara>
  2416. </listitem>
  2417. </varlistentry>
  2418. </variablelist>
  2419. </para>
  2420. <note>
  2421. <para>
  2422. In the current release, only the SQLite3 back
  2423. end is used by <command>b10-loadzone</command>.
  2424. Multiple zones are stored in a single SQLite3 zone database.
  2425. </para>
  2426. </note>
  2427. <para>
  2428. If you reload a zone already existing in the database,
  2429. all records from that prior zone disappear and a whole new set
  2430. appears.
  2431. </para>
  2432. <!--TODO: permissions for xfrin or loadzone to create the file -->
  2433. </section>
  2434. <!--
  2435. TODO
  2436. <section>
  2437. <title>Troubleshooting</title>
  2438. <para>
  2439. </para>
  2440. </section>
  2441. -->
  2442. </chapter>
  2443. <chapter id="xfrin">
  2444. <title>Incoming Zone Transfers</title>
  2445. <para>
  2446. Incoming zones are transferred using the <command>b10-xfrin</command>
  2447. process which is started by <command>b10-init</command>.
  2448. When received, the zone is stored in the corresponding BIND 10
  2449. data source, and its records can be served by
  2450. <command>b10-auth</command>.
  2451. In combination with <command>b10-zonemgr</command> (for
  2452. automated SOA checks), this allows the BIND 10 server to
  2453. provide <emphasis>secondary</emphasis> service.
  2454. </para>
  2455. <para>
  2456. The <command>b10-xfrin</command> process supports both AXFR and
  2457. IXFR.
  2458. </para>
  2459. <section>
  2460. <title>Configuration for Incoming Zone Transfers</title>
  2461. <para>
  2462. In order to enable incoming zone transfers for a secondary
  2463. zone, you will first need to make the zone "exist" in some
  2464. data source.
  2465. One easy way to do this is to create an empty zone using the
  2466. <command>b10-loadzone</command> utility.
  2467. For example, this makes an empty zone (or empties any existing
  2468. content of the zone) "example.com" in the default data source
  2469. for <command>b10-loadzone</command> (which is SQLite3-based
  2470. data source):
  2471. <screen>$ <userinput>b10-loadzone <replaceable>-e</replaceable> <replaceable>example.com</replaceable></userinput></screen>
  2472. </para>
  2473. <para>
  2474. Next, you need to specify a list of secondary zones to
  2475. enable incoming zone transfers for these zones in most
  2476. practical cases (you can still trigger a zone transfer
  2477. manually, without a prior configuration (see below)).
  2478. </para>
  2479. <para>
  2480. For example, to enable zone transfers for a zone named "example.com"
  2481. (whose master address is assumed to be 2001:db8::53 here),
  2482. run the following at the <command>bindctl</command> prompt:
  2483. <screen>&gt; <userinput>config add Xfrin/zones</userinput>
  2484. &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
  2485. &gt; <userinput>config set Xfrin/zones[0]/master_addr "<option>2001:db8::53</option>"</userinput>
  2486. &gt; <userinput>config commit</userinput></screen>
  2487. (We assume there has been no zone configuration before).
  2488. </para>
  2489. <note>
  2490. <simpara>
  2491. There is a plan to revise overall zone management
  2492. configuration (which are primary and secondary zones, which
  2493. data source they are stored, etc) so it can be configured
  2494. more consistently and in a unified way among various BIND 10 modules.
  2495. When it's done, part or all of the initial configuration
  2496. setup described in this section may be deprecated.
  2497. </simpara>
  2498. </note>
  2499. </section>
  2500. <section>
  2501. <title>TSIG</title>
  2502. If you want to use TSIG for incoming transfers, a system wide TSIG
  2503. key ring must be configured (see <xref linkend="tsig-key-ring"/>).
  2504. To specify a key to use, set tsig_key value to the name of the key
  2505. to use from the key ring.
  2506. &gt; <userinput>config set Xfrin/zones[0]/tsig_key "<option>example.key</option>"</userinput>
  2507. </section>
  2508. <section id="request_ixfr">
  2509. <title>Control the use of IXFR</title>
  2510. <para>
  2511. By default, <command>b10-xfrin</command> uses IXFR for
  2512. transferring zones specified in
  2513. the <varname>Xfrin/zones</varname> list of the configuration,
  2514. unless it doesn't know the current SOA serial of the zone
  2515. (including the case where the zone has never transferred or
  2516. locally loaded), in which case it automatically uses AXFR.
  2517. If the attempt of IXFR fails, <command>b10-xfrin</command>
  2518. automatically retries the transfer using AXFR.
  2519. In general, this works for any master server implementations
  2520. including those that don't support IXFR and in any local state
  2521. of the zone. So there should normally be no need to configure
  2522. on whether to use IXFR.
  2523. </para>
  2524. <para>
  2525. In some cases, however, it may be desirable to specify how and
  2526. whether to use IXFR and AXFR.
  2527. The <varname>request_ixfr</varname> configuration item under
  2528. <varname>Xfrin/zones</varname> can be used to control such
  2529. policies.
  2530. It can take the following values.
  2531. </para>
  2532. <variablelist>
  2533. <varlistentry>
  2534. <term>yes</term>
  2535. <listitem>
  2536. <simpara>
  2537. This is the default behavior as described above.
  2538. </simpara>
  2539. </listitem>
  2540. </varlistentry>
  2541. <varlistentry>
  2542. <term>no</term>
  2543. <listitem>
  2544. <simpara>
  2545. Only use AXFR. Note that this value normally shouldn't
  2546. be needed thanks to the automatic fallback from IXFR to IXFR.
  2547. A possible case where this value needs to be used is
  2548. that the master server has a bug and crashes if it
  2549. receives an IXFR request.
  2550. </simpara>
  2551. </listitem>
  2552. </varlistentry>
  2553. <varlistentry>
  2554. <term>only</term>
  2555. <listitem>
  2556. <simpara>
  2557. Only use IXFR except when the current SOA serial is not
  2558. known.
  2559. This value has a severe drawback, that is, if the master
  2560. server does not support IXFR zone transfers never
  2561. succeed (except for the very first one, which will use AXFR),
  2562. and the zone will eventually expire.
  2563. Therefore it should not be used in general.
  2564. Still, in some special cases the use of this value may
  2565. make sense. For example, if the operator is sure that
  2566. the master server supports IXFR and the zone is very
  2567. large, they may want to avoid falling back to AXFR as
  2568. it can be more expensive.
  2569. </simpara>
  2570. </listitem>
  2571. </varlistentry>
  2572. </variablelist>
  2573. <note>
  2574. <simpara>
  2575. There used to be a boolean configuration item named
  2576. <varname>use_ixfr</varname>.
  2577. It was deprecated for the finer control described above.
  2578. The <varname>request_ixfr</varname> item should be used instead.
  2579. </simpara>
  2580. </note>
  2581. </section>
  2582. <!-- TODO:
  2583. how to tell bind10 you are a secondary?
  2584. when will it first attempt to check for new zone? (using REFRESH?)
  2585. what if zonemgr is not running?
  2586. what if a NOTIFY is sent?
  2587. -->
  2588. <section id="zonemgr">
  2589. <title>Secondary Manager</title>
  2590. <para>
  2591. The <command>b10-zonemgr</command> process is started by
  2592. <command>b10-init</command>.
  2593. It keeps track of SOA refresh, retry, and expire timers
  2594. and other details for BIND 10 to perform as a slave.
  2595. When the <command>b10-auth</command> authoritative DNS server
  2596. receives a NOTIFY message, <command>b10-zonemgr</command>
  2597. may tell <command>b10-xfrin</command> to do a refresh
  2598. to start an inbound zone transfer.
  2599. The secondary manager resets its counters when a new zone is
  2600. transferred in.
  2601. </para>
  2602. <note><simpara>
  2603. Access control (such as allowing notifies) is not yet provided.
  2604. The primary/secondary service is not yet complete.
  2605. </simpara></note>
  2606. <para>
  2607. The following example shows using <command>bindctl</command>
  2608. to configure the server to be a secondary for the example zone:
  2609. <screen>&gt; <userinput>config add Zonemgr/secondary_zones</userinput>
  2610. &gt; <userinput>config set Zonemgr/secondary_zones[0]/name "<option>example.com</option>"</userinput>
  2611. &gt; <userinput>config commit</userinput></screen>
  2612. </para>
  2613. <para>
  2614. If the zone does not exist in the data source already
  2615. (i.e. no SOA record for it), <command>b10-zonemgr</command>
  2616. will automatically tell <command>b10-xfrin</command>
  2617. to transfer the zone in.
  2618. </para>
  2619. </section>
  2620. <section>
  2621. <title>Trigger an Incoming Zone Transfer Manually</title>
  2622. <para>
  2623. To manually trigger a zone transfer to retrieve a remote zone,
  2624. you may use the <command>bindctl</command> utility.
  2625. For example, at the <command>bindctl</command> prompt run:
  2626. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  2627. </para>
  2628. <para>
  2629. The <command>retransfer</command> command always uses AXFR.
  2630. To use IXFR for a zone that has already been transferred once,
  2631. use the <command>refresh</command> command.
  2632. It honors the <varname>Xfrin/zones/request_ixfr</varname>
  2633. configuration item (see <xref linkend="request_ixfr"/>.), and
  2634. if it's configured to use IXFR, it will be used.
  2635. </para>
  2636. <para>
  2637. Both the <command>retransfer</command>
  2638. and <command>refresh</command> commands can be used for
  2639. an initial transfer before setting up secondary
  2640. configurations.
  2641. In this case AXFR will be used for the obvious reason.
  2642. </para>
  2643. </section>
  2644. <section>
  2645. <title>Incoming Transfers with In-memory Datasource</title>
  2646. <para>
  2647. In the case of an incoming zone transfer, the received zone is
  2648. first stored in the corresponding BIND 10 datasource. In
  2649. case the secondary zone is served by an in-memory datasource
  2650. with an SQLite3 backend, <command>b10-auth</command> is
  2651. automatically sent a <varname>loadzone</varname> command to
  2652. reload the corresponding zone into memory from the backend.
  2653. </para>
  2654. <!-- TODO: currently it delays the queries; see
  2655. http://bind10.isc.org/wiki/ScalableZoneLoadDesign#a7.2UpdatingaZone
  2656. -->
  2657. <para>
  2658. The administrator doesn't have to do anything for
  2659. <command>b10-auth</command> to serve the new version of the
  2660. zone, except for the configuration such as the one described in
  2661. <xref linkend="datasrc" />.
  2662. </para>
  2663. </section>
  2664. <!-- TODO: what if doesn't exist at that master IP? -->
  2665. </chapter>
  2666. <chapter id="xfrout">
  2667. <title>Outbound Zone Transfers</title>
  2668. <para>
  2669. The <command>b10-xfrout</command> process is started by
  2670. <command>b10-init</command>.
  2671. When the <command>b10-auth</command> authoritative DNS server
  2672. receives an AXFR or IXFR request, <command>b10-auth</command>
  2673. internally forwards the request to <command>b10-xfrout</command>,
  2674. which handles the rest of this request processing.
  2675. This is used to provide primary DNS service to share zones
  2676. to secondary name servers.
  2677. The <command>b10-xfrout</command> is also used to send
  2678. NOTIFY messages to secondary servers.
  2679. </para>
  2680. <para>
  2681. A global or per zone <option>transfer_acl</option> configuration
  2682. can be used to control accessibility of the outbound zone
  2683. transfer service.
  2684. By default, <command>b10-xfrout</command> allows any clients to
  2685. perform zone transfers for any zones.
  2686. </para>
  2687. <screen>&gt; <userinput>config show Xfrout/transfer_acl</userinput>
  2688. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</screen>
  2689. <para>
  2690. If you want to require TSIG in access control, a system wide TSIG
  2691. key ring must be configured (see <xref linkend="tsig-key-ring"/>).
  2692. In this example, we allow client matching both the IP address
  2693. and key.
  2694. </para>
  2695. <screen>&gt; <userinput>config set tsig_keys/keys ["key.example:&lt;base64-key&gt;"]</userinput>
  2696. &gt; <userinput>config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]</userinput>
  2697. &gt; <userinput>config commit</userinput></screen>
  2698. <para>Both <command>b10-xfrout</command> and <command>b10-auth</command>
  2699. will use the system wide key ring to check
  2700. TSIGs in the incoming messages and to sign responses.</para>
  2701. <para>
  2702. For further details on ACL configuration, see
  2703. <xref linkend="common-acl" />.
  2704. </para>
  2705. <note><simpara>
  2706. The way to specify zone specific configuration (ACLs, etc) is
  2707. likely to be changed.
  2708. </simpara></note>
  2709. <!--
  2710. TODO:
  2711. xfrout section:
  2712. auth servers checks for AXFR query
  2713. sends the XFR query to the xfrout module
  2714. uses /tmp/auth_xfrout_conn which is a socket
  2715. what is XfroutClient xfr_client??
  2716. /tmp/auth_xfrout_conn is not removed
  2717. -->
  2718. </chapter>
  2719. <chapter id="ddns">
  2720. <title>Dynamic DNS Update</title>
  2721. <para>
  2722. BIND 10 supports the server side of the Dynamic DNS Update
  2723. (DDNS) protocol as defined in RFC 2136.
  2724. This service is provided by the <command>b10-ddns</command>
  2725. component, which is started by the <command>b10-init</command>
  2726. process if configured so.
  2727. </para>
  2728. <para>
  2729. When the <command>b10-auth</command> authoritative DNS server
  2730. receives an UPDATE request, it internally forwards the request
  2731. to <command>b10-ddns</command>, which handles the rest of
  2732. this request processing.
  2733. When the processing is completed, <command>b10-ddns</command>
  2734. will send a response to the client as specified in RFC 2136
  2735. (NOERROR for successful update, REFUSED if rejected due to
  2736. ACL check, etc).
  2737. If the zone has been changed as a result, it will internally
  2738. notify <command>b10-xfrout</command> so that other secondary
  2739. servers will be notified via the DNS NOTIFY protocol.
  2740. In addition, if <command>b10-auth</command> serves the updated
  2741. zone (as described in
  2742. <xref linkend="datasrc" />),
  2743. <command>b10-ddns</command> will also
  2744. notify <command>b10-auth</command> so that <command>b10-auth</command>
  2745. will re-cache the updated zone content if necessary.
  2746. </para>
  2747. <para>
  2748. The <command>b10-ddns</command> component supports requests over
  2749. both UDP and TCP, and both IPv6 and IPv4; for TCP requests,
  2750. however, it terminates the TCP connection immediately after
  2751. each single request has been processed. Clients cannot reuse the
  2752. same TCP connection for multiple requests. (This is a current
  2753. implementation limitation of <command>b10-ddns</command>.
  2754. While RFC 2136 doesn't specify anything about such reuse of TCP
  2755. connection, there is no reason for disallowing it as RFC 1035
  2756. generally allows multiple requests sent over a single TCP
  2757. connection. BIND 9 supports such reuse.)
  2758. </para>
  2759. <para>
  2760. As of this writing <command>b10-ddns</command> does not support
  2761. update forwarding for secondary zones.
  2762. If it receives an update request for a secondary zone, it will
  2763. immediately return a <quote>not implemented</quote> response.
  2764. <note><simpara>
  2765. For feature completeness, update forwarding should be
  2766. eventually supported. But currently it's considered a lower
  2767. priority task and there is no specific plan of implementing
  2768. this feature.
  2769. <!-- See Trac #2063 -->
  2770. </simpara></note>
  2771. </para>
  2772. <section>
  2773. <title>Enabling Dynamic Update</title>
  2774. <para>
  2775. First off, it must be made sure that a few components on which
  2776. <command>b10-ddns</command> depends are configured to run,
  2777. which are <command>b10-auth</command>
  2778. and <command>b10-zonemgr</command>.
  2779. In addition, <command>b10-xfrout</command> should also be
  2780. configured to run; otherwise the notification after an update
  2781. (see above) will fail with a timeout, suspending the DDNS
  2782. service while <command>b10-ddns</command> waits for the
  2783. response (see the description of the <ulink
  2784. url="bind10-messages.html#DDNS_UPDATE_NOTIFY_FAIL">DDNS_UPDATE_NOTIFY_FAIL</ulink>
  2785. log message for further details).
  2786. If BIND 10 is already configured to provide authoritative DNS
  2787. service they should normally be configured to run already.
  2788. </para>
  2789. <para>
  2790. Second, for the obvious reason dynamic update requires that the
  2791. underlying data source storing the zone data be writable.
  2792. In the current implementation this means the zone must be stored
  2793. in an SQLite3-based data source.
  2794. <!-- TODO -->
  2795. Also, in this current version, the <command>b10-ddns</command>
  2796. component configures itself with the data source referring to the
  2797. <varname>database_file</varname> configuration parameter of
  2798. <command>b10-auth</command>.
  2799. So this information must be configured correctly before starting
  2800. <command>b10-ddns</command>.
  2801. <note><simpara>
  2802. The way to configure data sources is now being revised.
  2803. Configuration on the data source for DDNS will be very
  2804. likely to be changed in a backward incompatible manner in
  2805. a near future version.
  2806. </simpara></note>
  2807. </para>
  2808. <para>
  2809. In general, if something goes wrong regarding the dependency
  2810. described above, <command>b10-ddns</command> will log the
  2811. related event at the warning or error level.
  2812. It's advisable to check the log message when you first enable
  2813. DDNS or if it doesn't work as you expect to see if there's any
  2814. warning or error log message.
  2815. </para>
  2816. <para>
  2817. Next, to enable the DDNS service, <command>b10-ddns</command>
  2818. needs to be explicitly configured to run.
  2819. It can be done by using the <command>bindctl</command>
  2820. utility. For example:
  2821. <screen>
  2822. &gt; <userinput>config add Init/components b10-ddns</userinput>
  2823. &gt; <userinput>config set Init/components/b10-ddns/address DDNS</userinput>
  2824. &gt; <userinput>config set Init/components/b10-ddns/kind dispensable</userinput>
  2825. &gt; <userinput>config commit</userinput>
  2826. </screen>
  2827. <note><simpara>
  2828. In theory <varname>kind</varname> could be omitted because
  2829. "dispensable" is its default.
  2830. But there's some peculiar behavior (which should be a
  2831. bug and should be fixed eventually; see Trac ticket #2064)
  2832. with <command>bindctl</command> and you'll still need to
  2833. specify that explicitly. Likewise, <varname>address</varname>
  2834. may look unnecessary because <command>b10-ddns</command>
  2835. would start and work without specifying it. But for it
  2836. to shutdown gracefully this parameter should also be
  2837. specified.
  2838. </simpara></note>
  2839. </para>
  2840. </section>
  2841. <section>
  2842. <title>Access Control</title>
  2843. <para>
  2844. By default, <command>b10-ddns</command> rejects any update
  2845. requests from any clients by returning a REFUSED response.
  2846. To allow updates to take effect, an access control rule
  2847. (called update ACL) with a policy allowing updates must explicitly be
  2848. configured.
  2849. Update ACL must be configured per zone basis in the
  2850. <varname>zones</varname> configuration parameter of
  2851. <command>b10-ddns</command>.
  2852. This is a list of per-zone configurations regarding DDNS.
  2853. Each list element consists of the following parameters:
  2854. <variablelist>
  2855. <varlistentry>
  2856. <term>origin</term>
  2857. <listitem>
  2858. <simpara>The zone's origin name</simpara>
  2859. </listitem>
  2860. </varlistentry>
  2861. <varlistentry>
  2862. <term>class</term>
  2863. <listitem>
  2864. <simpara>The RR class of the zone
  2865. (normally <quote>IN</quote>, and in that case
  2866. can be omitted in configuration)</simpara>
  2867. </listitem>
  2868. </varlistentry>
  2869. <varlistentry>
  2870. <term>update_acl</term>
  2871. <listitem>
  2872. <simpara>List of access control rules (ACL) for the zone</simpara>
  2873. </listitem>
  2874. </varlistentry>
  2875. </variablelist>
  2876. The syntax of the ACL is the same as ACLs for other
  2877. components.
  2878. Specific examples are given below.
  2879. </para>
  2880. <para>
  2881. In general, an update ACL rule that allows an update request
  2882. should be configured with a TSIG key.
  2883. This is an example update ACL that allows updates to the zone
  2884. named <quote>example.org</quote> (of default RR class <quote>IN</quote>)
  2885. from clients that send requests signed with a TSIG whose
  2886. key name is "key.example.org" (and refuses all others):
  2887. <screen>
  2888. &gt; <userinput>config add DDNS/zones</userinput>
  2889. &gt; <userinput>config set DDNS/zones[0]/origin example.org</userinput>
  2890. &gt; <userinput>config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "key.example.org"}</userinput>
  2891. &gt; <userinput>config commit</userinput>
  2892. </screen>
  2893. The TSIG key must be configured system wide
  2894. (see <xref linkend="common-tsig"/>).
  2895. </para>
  2896. <para>
  2897. The full description of ACLs can be found in <xref
  2898. linkend="common-acl" />.
  2899. </para>
  2900. <note><simpara>
  2901. The <command>b10-ddns</command> component accepts an ACL
  2902. rule that just allows updates from a specific IP address
  2903. (i.e., without requiring TSIG), but this is highly
  2904. discouraged (remember that requests can be made over UDP and
  2905. spoofing the source address of a UDP packet is often pretty
  2906. easy).
  2907. Unless you know what you are doing and that you can accept
  2908. its consequence, any update ACL rule that allows updates
  2909. should have a TSIG key in its constraints.
  2910. </simpara></note>
  2911. <para>
  2912. Currently update ACL can only control updates per zone basis;
  2913. it's not possible to specify access control with higher
  2914. granularity such as for particular domain names or specific
  2915. types of RRs.
  2916. <!-- See Trac ticket #2065 -->
  2917. </para>
  2918. <note><simpara>
  2919. Contrary to what RFC 2136 (literally) specifies,
  2920. <command>b10-ddns</command> checks the update ACL before
  2921. checking the prerequisites of the update request.
  2922. This is a deliberate implementation decision.
  2923. This counter intuitive specification has been repeatedly
  2924. discussed among implementers and in the IETF, and it is now
  2925. widely agreed that it does not make sense to strictly follow
  2926. that part of RFC.
  2927. One known specific bad result of following the RFC is that it
  2928. could leak information about which name or record exists or does not
  2929. exist in the zone as a result of prerequisite checks even if a
  2930. zone is somehow configured to reject normal queries from
  2931. arbitrary clients.
  2932. There have been other troubles that could have been avoided if
  2933. the ACL could be checked before the prerequisite check.
  2934. </simpara></note>
  2935. </section>
  2936. <section>
  2937. <title>Miscellaneous Operational Issues</title>
  2938. <para>
  2939. Unlike BIND 9, BIND 10 currently does not support automatic
  2940. re-signing of DNSSEC-signed zone when it's updated via DDNS.
  2941. It could be possible to re-sign the updated zone afterwards
  2942. or make sure the update request also updates related DNSSEC
  2943. records, but that will be pretty error-prone operation.
  2944. In general, it's not advisable to allow DDNS for a signed zone
  2945. at this moment.
  2946. </para>
  2947. <para>
  2948. Also unlike BIND 9, it's currently not possible
  2949. to <quote>freeze</quote> a zone temporarily in order to
  2950. suspend DDNS while you manually update the zone.
  2951. If you need to make manual updates to a dynamic zone,
  2952. you'll need to temporarily reject any updates to the zone via
  2953. the update ACLs.
  2954. </para>
  2955. <para>
  2956. Dynamic updates are only applicable to primary zones.
  2957. In order to avoid updating secondary zones via DDNS requests,
  2958. <command>b10-ddns</command> refers to the
  2959. <quote>secondary_zones</quote> configuration of
  2960. <command>b10-zonemgr</command>. Zones listed in
  2961. <quote>secondary_zones</quote> will never be updated via DDNS
  2962. regardless of the update ACL configuration;
  2963. <command>b10-ddns</command> will return a NOTAUTH (server
  2964. not authoritative for the zone) response.
  2965. If you have a "conceptual" secondary zone whose content is a
  2966. copy of some external source but is not updated via the
  2967. standard zone transfers and therefore not listed in
  2968. <quote>secondary_zones</quote>, be careful not to allow DDNS
  2969. for the zone; it would be quite likely to lead to inconsistent
  2970. state between different servers.
  2971. Normally this should not be a problem because the default
  2972. update ACL rejects any update requests, but you may want to
  2973. take an extra care about the configuration if you have such
  2974. type of secondary zones.
  2975. </para>
  2976. <para>
  2977. The difference of two versions of a zone, before and after a
  2978. DDNS transaction, is automatically recorded in the underlying
  2979. data source, and can be retrieved in the form of outbound
  2980. IXFR.
  2981. This is done automatically; it does not require specific
  2982. configuration to make this possible.
  2983. </para>
  2984. </section>
  2985. </chapter>
  2986. <chapter id="resolverserver">
  2987. <title>Recursive Name Server</title>
  2988. <note><simpara>
  2989. The <command>b10-resolver</command> is an experimental proof
  2990. of concept.
  2991. </simpara></note>
  2992. <para>
  2993. The <command>b10-resolver</command> daemon provides an
  2994. iterative caching and forwarding DNS server.
  2995. The process is started by <command>b10-init</command>.
  2996. <!-- TODO
  2997. It provides a resolver so DNS clients can ask it to do recursion
  2998. and it will return answers.
  2999. -->
  3000. </para>
  3001. <para>
  3002. The main <command>b10-init</command> process can be configured
  3003. to select to run either the authoritative or resolver or both.
  3004. By default, it doesn't start either one. You may change this using
  3005. <command>bindctl</command>, for example:
  3006. <screen>
  3007. &gt; <userinput>config add Init/components b10-resolver</userinput>
  3008. &gt; <userinput>config set Init/components/b10-resolver/special resolver</userinput>
  3009. &gt; <userinput>config set Init/components/b10-resolver/kind needed</userinput>
  3010. &gt; <userinput>config set Init/components/b10-resolver/priority 10</userinput>
  3011. &gt; <userinput>config commit</userinput>
  3012. </screen>
  3013. </para>
  3014. <para>
  3015. The master <command>b10-init</command> process will stop and start
  3016. the desired services.
  3017. </para>
  3018. <para>
  3019. By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
  3020. The following example shows how it can be configured to
  3021. listen on an additional address (and port):
  3022. <screen>
  3023. &gt; <userinput>config add Resolver/listen_on</userinput>
  3024. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
  3025. &gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
  3026. &gt; <userinput>config commit</userinput>
  3027. </screen>
  3028. </para>
  3029. <simpara>(Replace the <quote><replaceable>2</replaceable></quote>
  3030. as needed; run <quote><userinput>config show
  3031. Resolver/listen_on</userinput></quote> if needed.)</simpara>
  3032. <!-- TODO: this example should not include the port, ticket #1185 -->
  3033. <section>
  3034. <title>Access Control</title>
  3035. <para>
  3036. By default, the <command>b10-resolver</command> daemon only accepts
  3037. DNS queries from the localhost (127.0.0.1 and ::1).
  3038. The <option>Resolver/query_acl</option> configuration may
  3039. be used to reject, drop, or allow specific IPs or networks.
  3040. See <xref linkend="common-acl" />.
  3041. </para>
  3042. <para>
  3043. The following session is an example of extending the ACL to also
  3044. allow queries from 192.0.2.0/24:
  3045. <screen>
  3046. > <userinput>config show Resolver/query_acl</userinput>
  3047. Resolver/query_acl[0] {"action": "ACCEPT", "from": "127.0.0.1"} any (default)
  3048. Resolver/query_acl[1] {"action": "ACCEPT", "from": "::1"} any (default)
  3049. > <userinput>config add Resolver/query_acl</userinput>
  3050. > <userinput>config set Resolver/query_acl[2] {"action": "ACCEPT", "from": "192.0.2.0/24"}</userinput>
  3051. > <userinput>config add Resolver/query_acl</userinput>
  3052. > <userinput>config show Resolver/query_acl</userinput>
  3053. Resolver/query_acl[0] {"action": "ACCEPT", "from": "127.0.0.1"} any (modified)
  3054. Resolver/query_acl[1] {"action": "ACCEPT", "from": "::1"} any (modified)
  3055. Resolver/query_acl[2] {"action": "ACCEPT", "from": "192.0.2.0/24"} any (modified)
  3056. Resolver/query_acl[3] {"action": "REJECT"} any (modified)
  3057. > <userinput>config commit</userinput></screen>
  3058. Note that we didn't set the value of the last final rule
  3059. (query_acl[3]) -- in the case of resolver, rejecting all queries is
  3060. the default value of a new rule. In fact, this rule can even be
  3061. omitted completely, as the default, when a query falls off the list,
  3062. is rejection.
  3063. </para>
  3064. </section>
  3065. <section>
  3066. <title>Forwarding</title>
  3067. <para>
  3068. To enable forwarding, the upstream address and port must be
  3069. configured to forward queries to, such as:
  3070. <screen>
  3071. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  3072. &gt; <userinput>config commit</userinput>
  3073. </screen>
  3074. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  3075. full resolver.)
  3076. </para>
  3077. <para>
  3078. Normal iterative name service can be re-enabled by clearing the
  3079. forwarding address(es); for example:
  3080. <screen>
  3081. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  3082. &gt; <userinput>config commit</userinput>
  3083. </screen>
  3084. </para>
  3085. </section>
  3086. <!-- TODO: later try this
  3087. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  3088. > config set Resolver/forward_addresses[0]/port 53
  3089. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  3090. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  3091. -->
  3092. </chapter>
  3093. <chapter id="dhcp">
  3094. <title>DHCP</title>
  3095. <para>The Dynamic Host Configuration Protocol for IPv4 (DHCP or
  3096. DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  3097. are protocols that allow one node (server) to provision
  3098. configuration parameters to many hosts and devices (clients). To
  3099. ease deployment in larger networks, additional nodes (relays) may
  3100. be deployed that facilitate communication between servers and
  3101. clients. Even though principles of both DHCPv4 and DHCPv6 are
  3102. somewhat similar, these are two radically different
  3103. protocols. BIND 10 offers two server implementations, one for DHCPv4
  3104. and one for DHCPv6. The DHCP part of the BIND 10 project is codenamed
  3105. Kea. The DHCPv4 component is colloquially referred to as Kea4 and its
  3106. DHCPv6 counterpart is called Kea6.</para>
  3107. <para> In addition to providing lease management services, both Kea4 and
  3108. Kea6 can provide dynamic DNS (DDNS) updates driven by the lease changes they
  3109. make. These updates are carried out with the assistance of the
  3110. DHCP-DDNS server, colloquially referred to as D2. When configured
  3111. to do so, Kea servers will notify D2 of lease changes. D2 will match
  3112. them to the appropriate DNS servers and instruct those severs to add or
  3113. delete the requisite DNS entries.
  3114. </para>
  3115. <para>This chapter covers those parts of BIND 10 that are common to
  3116. both servers. DHCPv4-specific details are covered in <xref linkend="dhcp4"/>,
  3117. while those details specific to DHCPv6 are described in <xref linkend="dhcp6"/>.
  3118. The DHCP-DDNS server details are covered in <xref linkend="dhcp-ddns-server"/>
  3119. </para>
  3120. <note>
  3121. <simpara>
  3122. In this release of BIND 10, the DHCPv4 and DHCPv6 servers
  3123. must be considered experimental.
  3124. </simpara>
  3125. </note>
  3126. <section id="dhcp-install-configure">
  3127. <title>DHCP Database Installation and Configuration</title>
  3128. <para>
  3129. BIND 10 DHCP stores its leases in a lease database. The software has been written in
  3130. a way that makes it possible to choose which database product should be used to
  3131. store the lease information. At present, Kea supports 3 database backends: MySQL,
  3132. PostgreSQL and memfile. To limit external dependencies, both MySQL and PostgreSQL
  3133. support are disabled by default and only memfile (which is implemented in pure C++)
  3134. is available. Support for a given database backend must be explicitly included when
  3135. BIND 10 is built. This section covers the building of BIND 10 with MySQL and/or PostgreSQL
  3136. and the creation of the lease database.
  3137. </para>
  3138. <section>
  3139. <title>Building with MySQL support</title>
  3140. <para>
  3141. Install MySQL according to the instructions for your system. The client development
  3142. libraries must be installed.
  3143. </para>
  3144. <para>
  3145. Build and install BIND 10 as described in <xref linkend="installation"/>, with
  3146. the following modification: to enable the MySQL database code, at the
  3147. "configure" step (see <xref linkend="configure"/>), specify the location of the
  3148. MySQL configuration program "mysql_config" with the "--with-dhcp-mysql" switch,
  3149. i.e.
  3150. <screen><userinput>./configure [other-options] --with-dhcp-mysql</userinput></screen>
  3151. ...if MySQL was installed in the default location, or:
  3152. <screen><userinput>./configure [other-options] --with-dhcp-mysql=<replaceable>path-to-mysql_config</replaceable></userinput></screen>
  3153. ...if not.
  3154. </para>
  3155. </section>
  3156. <section id="dhcp-mysql-database-create">
  3157. <title>Create MySQL Database and Kea User</title>
  3158. <para>
  3159. The next task is to create both the lease database and the user under which the servers will
  3160. access it. A number of steps are required:
  3161. </para>
  3162. <para>
  3163. 1. Log into MySQL as "root":
  3164. <screen>$ <userinput>mysql -u root -p</userinput>
  3165. Enter password:<userinput/>
  3166. :<userinput/>
  3167. mysql></screen>
  3168. </para>
  3169. <para>
  3170. 2. Create the database:
  3171. <screen>mysql> <userinput>CREATE DATABASE <replaceable>database-name</replaceable>;</userinput></screen>
  3172. ... <replaceable>database-name</replaceable> is the name you have chosen for the database.
  3173. </para>
  3174. <para>
  3175. 3. Create the database tables:
  3176. <screen>mysql> <userinput>CONNECT <replaceable>database-name</replaceable>;</userinput>
  3177. mysql> <userinput>SOURCE <replaceable>path-to-bind10</replaceable>/share/bind10/dhcpdb_create.mysql</userinput></screen>
  3178. </para>
  3179. <para>
  3180. 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:
  3181. <screen>mysql> <userinput>CREATE USER '<replaceable>user-name</replaceable>'@'localhost' IDENTIFIED BY '<replaceable>password</replaceable>';</userinput>
  3182. mysql> <userinput>GRANT ALL ON <replaceable>database-name</replaceable>.* TO '<replaceable>user-name</replaceable>'@'localhost';</userinput></screen>
  3183. </para>
  3184. <para>
  3185. 5. Exit MySQL:
  3186. <screen>mysql> <userinput>quit</userinput>
  3187. Bye<userinput/>
  3188. $</screen>
  3189. </para>
  3190. </section>
  3191. <section>
  3192. <title>Building with PostgreSQL support</title>
  3193. <para>
  3194. Install PostgreSQL according to the instructions for your system. The client development
  3195. libraries must be installed. Client development libraries are often packaged as &quot;libpq&quot;.
  3196. </para>
  3197. <para>
  3198. Build and install BIND 10 as described in <xref linkend="installation"/>, with
  3199. the following modification: to enable the PostgreSQL database code, at the
  3200. "configure" step (see <xref linkend="configure"/>), specify the location of the
  3201. PostgreSQL configuration program "pg_config" with the "--with-dhcp-pgsql" switch,
  3202. i.e.
  3203. <screen><userinput>./configure [other-options] --with-dhcp-pgsql</userinput></screen>
  3204. ...if Postgresql was installed in the default location, or:
  3205. <screen><userinput>./configure [other-options] --with-dhcp-pgsql=<replaceable>path-to-pg_config</replaceable></userinput></screen>
  3206. ...if not.
  3207. </para>
  3208. </section>
  3209. <section id="dhcp-pgsql-database-create">
  3210. <title>Create PostgreSQL Database and Kea User</title>
  3211. <para>
  3212. The next task is to create both the lease database and the user under which the servers will
  3213. access it. A number of steps are required:
  3214. </para>
  3215. <para>
  3216. 1. Log into PostgreSQL as "root":
  3217. <screen>$ <userinput>sudo -u postgres psql postgres</userinput>
  3218. Enter password:<userinput/>
  3219. :<userinput/>
  3220. postgres=#</screen>
  3221. </para>
  3222. <para>
  3223. 2. Create the database:
  3224. <screen>postgres=# <userinput>CREATE DATABASE <replaceable>database-name</replaceable>;</userinput></screen>
  3225. ... <replaceable>database-name</replaceable> is the name you have chosen for the database.
  3226. </para>
  3227. <para>
  3228. 3. Create the user under which Kea will access the database (and give it a password), then grant it access to the database:
  3229. <screen>postgres=# <userinput>CREATE USER <replaceable>user-name</replaceable> WITH PASSWORD <replaceable>password</replaceable>;</userinput>
  3230. postgres=#> <userinput>GRANT ALL PRIVILEGES ON DATABASE <replaceable>database-name</replaceable> TO <replaceable>user-name</replaceable>;</userinput></screen>
  3231. </para>
  3232. <para>
  3233. 4. Exit PostgreSQL:
  3234. <screen>postgres=# <userinput>\q</userinput>
  3235. Bye<userinput/>
  3236. $</screen>
  3237. </para>
  3238. <para>
  3239. 5. Create the database tables using the new user's credentials.
  3240. After entering the following command, you will be prompted for the new
  3241. user's password. When the command completes you will be returned to
  3242. the shell prompt. You should see output similiar to following:
  3243. <screen>$ <userinput>psql -d <replaceable>database-name</replaceable> -U <replaceable>user-name</replaceable> -f <replaceable>path-to-bind10</replaceable>/share/bind10/dhcpdb_create.pgsql;</userinput>
  3244. Password for user <replaceable>user-name</replaceable>:
  3245. CREATE TABLE
  3246. CREATE INDEX
  3247. CREATE INDEX
  3248. CREATE TABLE
  3249. CREATE INDEX
  3250. CREATE TABLE
  3251. START TRANSACTION
  3252. INSERT 0 1
  3253. INSERT 0 1
  3254. INSERT 0 1
  3255. COMMIT
  3256. CREATE TABLE
  3257. START TRANSACTION
  3258. INSERT 0 1
  3259. COMMIT
  3260. $
  3261. </screen>
  3262. </para>
  3263. <para>
  3264. If instead you encounter an error such as shown below:
  3265. </para>
  3266. <screen>
  3267. psql: FATAL: no pg_hba.conf entry for host "[local]", user "<replaceable>user-name</replaceable>", database "<replaceable>database-name</replaceable>", SSL off
  3268. </screen>
  3269. <para>
  3270. This indicates that the Postgresql configuration needs to be modified.
  3271. Kea uses password authentication when connecting to the database and must
  3272. have the appropriate entries added to Posgresql's pg_hba.conf file. This
  3273. file is normally located in the primary data directory for your Postgresql
  3274. server. The precise path may vary but the default location for Postgres 9.3
  3275. on Centos 6.5 is:
  3276. <filename>/var/lib/pgsql/9.3/data/pg_hba.conf</filename>.
  3277. Adding lines similiar to following should be sufficient:
  3278. </para>
  3279. <screen>
  3280. local <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> password
  3281. host <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> 127.0.0.1/32 password
  3282. host <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> ::1/128 password
  3283. </screen>
  3284. <para>
  3285. Please consult your PostgreSQL user manual before making these changes as they
  3286. may expose your other databases that you run on the same system.
  3287. </para>
  3288. </section>
  3289. </section>
  3290. </chapter>
  3291. <chapter id="dhcp4">
  3292. <title>The DHCPv4 Server</title>
  3293. <section id="dhcp4-start-stop">
  3294. <title>Starting and Stopping the DHCPv4 Server</title>
  3295. <para>
  3296. <command>b10-dhcp4</command> is the BIND 10 DHCPv4 server and, like other
  3297. parts of BIND 10, is configured through the <command>bindctl</command>
  3298. program.
  3299. </para>
  3300. <para>
  3301. After starting BIND 10 and entering bindctl, the first step
  3302. in configuring the server is to add it to the list of running BIND 10 services.
  3303. <screen>
  3304. &gt; <userinput>config add Init/components b10-dhcp4</userinput>
  3305. &gt; <userinput>config set Init/components/b10-dhcp4/kind dispensable</userinput>
  3306. &gt; <userinput>config commit</userinput>
  3307. </screen>
  3308. </para>
  3309. <para>
  3310. To remove <command>b10-dhcp4</command> from the set of running services,
  3311. the <command>b10-dhcp4</command> is removed from list of Init components:
  3312. <screen>
  3313. &gt; <userinput>config remove Init/components b10-dhcp4</userinput>
  3314. &gt; <userinput>config commit</userinput>
  3315. </screen>
  3316. </para>
  3317. <para>
  3318. Note that the server was only removed from the list, so BIND10 will not
  3319. restart it, but the server itself is still running. Hence it is usually
  3320. desired to stop it:
  3321. <screen>
  3322. &gt; <userinput>Dhcp4 shutdown</userinput>
  3323. </screen>
  3324. </para>
  3325. <para>
  3326. On start-up, the server will detect available network interfaces
  3327. and will attempt to open UDP sockets on all interfaces that
  3328. are up, running, are not loopback, and have IPv4 address
  3329. assigned.
  3330. The server will then listen to incoming traffic. Currently
  3331. supported client messages are DISCOVER and REQUEST. The server
  3332. will respond to them with OFFER and ACK, respectively.
  3333. Since the DHCPv4 server opens privileged ports, it requires root
  3334. access. Make sure you run this daemon as root.
  3335. </para>
  3336. </section>
  3337. <section id="dhcp4-configuration">
  3338. <title>Configuring the DHCPv4 Server</title>
  3339. <para>
  3340. Once the server is started, it can be configured. To view the
  3341. current configuration, use the following command in <command>bindctl</command>:
  3342. <screen>
  3343. &gt; <userinput>config show Dhcp4</userinput></screen>
  3344. When starting the DHCPv4 daemon for the first time, the default configuration
  3345. will be available. It will look similar to this:
  3346. <screen>
  3347. &gt; <userinput>config show Dhcp4</userinput>
  3348. Dhcp4/hooks-libraries [] list (default)
  3349. Dhcp4/interfaces/ list
  3350. Dhcp4/renew-timer 1800 integer
  3351. Dhcp4/rebind-timer 2000 integer (default)
  3352. Dhcp4/valid-lifetime 4000 integer (default)
  3353. Dhcp4/next-server "" string (default)
  3354. Dhcp4/echo-client-id true boolean (default)
  3355. Dhcp4/option-def [] list (default)
  3356. Dhcp4/option-data [] list (default)
  3357. Dhcp4/lease-database/type "" string (default)
  3358. Dhcp4/lease-database/name "" string (default)
  3359. Dhcp4/lease-database/user "" string (default)
  3360. Dhcp4/lease-database/host "" string (default)
  3361. Dhcp4/lease-database/password "" string (default)
  3362. Dhcp4/subnet4/ list
  3363. Dhcp4/dhcp-ddns/enable-updates true boolean
  3364. Dhcp4/dhcp-ddns/server-ip "127.0.0.1" string
  3365. Dhcp4/dhcp-ddns/server-port 53001 integer
  3366. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  3367. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  3368. Dhcp4/dhcp-ddns/override-no-update false boolean
  3369. Dhcp4/dhcp-ddns/override-client-update false boolean
  3370. Dhcp4/dhcp-ddns/replace-client-name false boolean
  3371. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  3372. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  3373. </screen>
  3374. </para>
  3375. <para>
  3376. To change one of the parameters, simply follow
  3377. the usual <command>bindctl</command> procedure. For example, to make the
  3378. leases longer, change their valid-lifetime parameter:
  3379. <screen>
  3380. &gt; <userinput>config set Dhcp4/valid-lifetime 7200</userinput>
  3381. &gt; <userinput>config commit</userinput></screen>
  3382. Please note that most Dhcp4 parameters are of global scope
  3383. and apply to all defined subnets, unless they are overridden on a
  3384. per-subnet basis.
  3385. </para>
  3386. <section>
  3387. <title>Default storage for leases</title>
  3388. <para>
  3389. The server is able to store lease data in different repositories. Larger deployments
  3390. may elect to store leases in a database.
  3391. <xref linkend="database-configuration4"/> describes one way to do it.
  3392. By default, the server will use a CSV file rather than a database to store
  3393. lease information. One of the advantages of using a file is that it eliminates
  3394. dependency on third party database software.
  3395. </para>
  3396. <para>
  3397. The configuration of the file backend (Memfile)
  3398. is controlled through the Dhcp4/lease-database parameters. When default
  3399. parameters are used, the Memfile backend will write leases to a disk in the
  3400. [bind10-install-dir]/var/bind10/kea-leases4.csv.
  3401. </para>
  3402. <para>
  3403. It is possible to alter the default location of the lease file. The following
  3404. configuration:
  3405. <screen>
  3406. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  3407. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  3408. &gt; <userinput>config set Dhcp4/lease-database/name "/tmp/kea-leases4.csv"</userinput>
  3409. &gt; <userinput>config commit</userinput>
  3410. </screen>
  3411. will change the default location of the lease file to /tmp/kea-leases4.csv.
  3412. </para>
  3413. <para>
  3414. The "persist" parameter controls whether the leases are written to disk.
  3415. It is strongly recommended that this parameter is set to "true" at all times
  3416. during the normal operation of the server
  3417. </para>
  3418. </section>
  3419. <section id="database-configuration4">
  3420. <title>Database Configuration</title>
  3421. <para>
  3422. All leases issued by the server are stored in the lease database. Currently
  3423. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  3424. <footnote>
  3425. <para>
  3426. The server comes with an in-memory database ("memfile") configured as the default
  3427. database. This is used for internal testing and is not supported. In addition,
  3428. it does not store lease information on disk: lease information will be lost if the
  3429. server is restarted.
  3430. </para>
  3431. </footnote>, and so the server must be configured to
  3432. access the correct database with the appropriate credentials.
  3433. </para>
  3434. <note>
  3435. <para>
  3436. Database access information must be configured for the DHCPv4 server, even if
  3437. it has already been configured for the DHCPv6 server. The servers store their
  3438. information independently, so each server can use a separate
  3439. database or both servers can use the same database.
  3440. </para>
  3441. </note>
  3442. <para>
  3443. Database configuration is controlled through the Dhcp4/lease-database parameters.
  3444. The type of the database must be set to "mysql", "postgresql" or "memfile":
  3445. <screen>
  3446. &gt; <userinput>config set Dhcp4/lease-database/type "mysql"</userinput>
  3447. </screen>
  3448. Next, the name of the database is to hold the leases must be set: this is the
  3449. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  3450. or <xref linkend="dhcp-pgsql-database-create"/>).
  3451. <screen>
  3452. &gt; <userinput>config set Dhcp4/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  3453. </screen>
  3454. If the database is located on a different system to the DHCPv4 server, the
  3455. database host name must also be specified (although note that this configuration
  3456. may have a severe impact on server performance):
  3457. <screen>
  3458. &gt; <userinput>config set Dhcp4/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  3459. </screen>
  3460. The usual state of affairs will be to have the database on the same machine as the
  3461. DHCPv4 server. In this case, set the value to the empty string (this is the default):
  3462. <screen>
  3463. &gt; <userinput>config set Dhcp4/lease-database/host ""</userinput>
  3464. </screen>
  3465. </para>
  3466. <para>
  3467. Finally, the credentials of the account under which the server will access the database
  3468. should be set:
  3469. <screen>
  3470. &gt; <userinput>config set Dhcp4/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  3471. &gt; <userinput>config set Dhcp4/lease-database/password "<replaceable>password</replaceable>"</userinput>
  3472. </screen>
  3473. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  3474. </para>
  3475. <note>
  3476. <para>The password is echoed when entered and is stored in clear text in the BIND 10 configuration
  3477. database. Improved password security will be added in a future version of BIND 10 DHCP</para>
  3478. </note>
  3479. </section>
  3480. <section id="dhcp4-interface-selection">
  3481. <title>Interface selection</title>
  3482. <para>
  3483. When DHCPv4 server starts up, by default it will listen to the DHCP
  3484. traffic and respond to it on all interfaces detected during startup.
  3485. However, in many cases it is desired to configure the server to listen and
  3486. respond on selected interfaces only. The sample commands in this section
  3487. show how to make interface selection using bindctl.
  3488. </para>
  3489. <para>
  3490. The default configuration can be presented with the following command:
  3491. <screen>
  3492. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  3493. <userinput>Dhcp4/interfaces[0] "*" string</userinput></screen>
  3494. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  3495. </para>
  3496. <para>
  3497. In order to override the default configuration, the existing entry can be replaced
  3498. with the actual interface name:
  3499. <screen>
  3500. &gt; <userinput>config set Dhcp4/interfaces[0] eth1</userinput>
  3501. &gt; <userinput>config commit</userinput></screen>
  3502. Other interface names can be added on one-by-one basis:
  3503. <screen>
  3504. &gt; <userinput>config add Dhcp4/interfaces eth2</userinput>
  3505. &gt; <userinput>config commit</userinput></screen>
  3506. Configuration will now contain two interfaces which can be presented as follows:
  3507. <screen>
  3508. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  3509. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  3510. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput></screen>
  3511. When configuration gets committed, the server will start to listen on
  3512. eth1 and eth2 interfaces only.
  3513. </para>
  3514. <para>
  3515. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  3516. interface names:
  3517. <screen>
  3518. &gt; <userinput>config add Dhcp4/interfaces *</userinput>
  3519. &gt; <userinput>config commit</userinput></screen>
  3520. This will result in the following configuration:
  3521. <screen>
  3522. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  3523. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  3524. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput>
  3525. <userinput>Dhcp4/interfaces[2] "*" string</userinput></screen>
  3526. The presence of the wildcard name implies that server will listen on all interfaces.
  3527. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  3528. <screen>
  3529. &gt; <userinput>config remove Dhcp4/interfaces[2]</userinput>
  3530. &gt; <userinput>config commit</userinput></screen>
  3531. </para>
  3532. </section>
  3533. <section id="ipv4-subnet-id">
  3534. <title>IPv4 Subnet Identifier</title>
  3535. <para>
  3536. Subnet identifier is a unique number associated with a particular subnet.
  3537. In principle, it is used to associate clients' leases with respective subnets.
  3538. When subnet identifier is not specified for a subnet being configured, it will
  3539. be automatically assigned by the configuration mechanism. The identifiers
  3540. are assigned from 1 and are monotonically increased for each subsequent
  3541. subnet: 1, 2, 3 ....
  3542. </para>
  3543. <para>
  3544. If there are multiple subnets configured with auto-generated identifiers and
  3545. one of them is removed, the subnet identifiers may be renumbered. For example:
  3546. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  3547. identifier that the 3rd subnet had before removal. As a result, the leases
  3548. stored in the lease database for subnet 3 are now associated with the
  3549. subnet 4, which may have unexpected consequences. In the future it is planned
  3550. to implement the mechanism to preserve auto-generated subnet ids upon removal
  3551. of one of the subnets. Currently, the only remedy for this issue is to
  3552. manually specify the unique subnet identifier for each subnet.
  3553. </para>
  3554. <para>
  3555. The following configuration:
  3556. <screen>
  3557. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3558. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  3559. &gt; <userinput>config set Dhcp4/subnet4[0]/id 1024</userinput>
  3560. &gt; <userinput>config commit</userinput>
  3561. </screen>
  3562. will assign the arbitrary subnet identifier to the newly configured subnet.
  3563. This identifier will not change for this subnet until "id" parameter is
  3564. removed or set to 0. The value of 0 forces auto-generation of subnet
  3565. identifier.
  3566. </para>
  3567. </section>
  3568. <section id="dhcp4-address-config">
  3569. <title>Configuration of IPv4 Address Pools</title>
  3570. <para>
  3571. The essential role of DHCPv4 server is address assignment. The server
  3572. has to be configured with at least one subnet and one pool of dynamic
  3573. addresses to be managed. For example, assume that the server
  3574. is connected to a network segment that uses the 192.0.2.0/24
  3575. prefix. The Administrator of that network has decided that addresses from range
  3576. 192.0.2.10 to 192.0.2.20 are going to be managed by the Dhcp4
  3577. server. Such a configuration can be achieved in the following way:
  3578. <screen>
  3579. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3580. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  3581. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  3582. &gt; <userinput>config commit</userinput></screen>
  3583. Note that subnet is defined as a simple string, but the pool parameter
  3584. is actually a list of pools: for this reason, the pool definition is
  3585. enclosed in square brackets, even though only one range of addresses
  3586. is specified.</para>
  3587. <para>It is possible to define more than one pool in a
  3588. subnet: continuing the previous example, further assume that
  3589. 192.0.2.64/26 should be also be managed by the server. It could be written as
  3590. 192.0.2.64 to 192.0.2.127. Alternatively, it can be expressed more simply as
  3591. 192.0.2.64/26. Both formats are supported by Dhcp4 and can be mixed in the pool list.
  3592. For example, one could define the following pools:
  3593. <screen>
  3594. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10-192.0.2.20", "192.0.2.64/26" ]</userinput>
  3595. &gt; <userinput>config commit</userinput></screen>
  3596. The number of pools is not limited, but for performance reasons it is recommended to
  3597. use as few as possible. Space and tabulations in pool definitions are ignored, so
  3598. spaces before and after hyphen are optional. They can be used to improve readability.
  3599. </para>
  3600. <para>
  3601. The server may be configured to serve more than one subnet. To add a second subnet,
  3602. use a command similar to the following:
  3603. <screen>
  3604. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3605. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.3.0/24"</userinput>
  3606. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.3.0/24" ]</userinput>
  3607. &gt; <userinput>config commit</userinput></screen>
  3608. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  3609. previous example. The <command>config add Dhcp4/subnet4</command> command adds
  3610. another (second) subnet. It can be referred to as
  3611. <command>Dhcp4/subnet4[1]</command>. In this example, we allow server to
  3612. dynamically assign all addresses available in the whole subnet.
  3613. </para>
  3614. <para>
  3615. When configuring a DHCPv4 server using prefix/length notation, please pay
  3616. attention to the boundary values. When specifying that the server should use
  3617. a given pool, it will be able to allocate also first (typically network
  3618. address) and the last (typically broadcast address) address from that pool.
  3619. In the aforementioned example of pool 192.0.3.0/24, both 192.0.3.0 and
  3620. 192.0.3.255 addresses may be assigned as well. This may be invalid in some
  3621. network configurations. If you want to avoid this, please use the "min-max" notation.
  3622. </para>
  3623. </section>
  3624. <section id="dhcp4-std-options">
  3625. <title>Standard DHCPv4 options</title>
  3626. <para>
  3627. One of the major features of DHCPv4 server is to provide configuration
  3628. options to clients. Although there are several options that require
  3629. special behavior, most options are sent by the server only if the client
  3630. explicitly requested them. The following example shows how to
  3631. configure DNS servers, which is one of the most frequently used
  3632. options. Options specified in this way are considered global and apply
  3633. to all configured subnets.
  3634. <screen>
  3635. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3636. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  3637. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  3638. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3639. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3640. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.3.1, 192.0.3.2"</userinput>
  3641. &gt; <userinput>config commit</userinput>
  3642. </screen>
  3643. </para>
  3644. <para>
  3645. The first line creates new entry in option-data table. It
  3646. contains information on all global options that the server is
  3647. supposed to configure in all subnets. The second line specifies
  3648. option name. For a complete list of currently supported names,
  3649. see <xref linkend="dhcp4-std-options-list"/> below.
  3650. The third line specifies option code, which must match one of the
  3651. values from that list. Line 4 specifies option space, which must always
  3652. be set to "dhcp4" as these are standard DHCPv4 options. For
  3653. other option spaces, including custom option spaces, see <xref
  3654. linkend="dhcp4-option-spaces"/>. The fifth line specifies the format in
  3655. which the data will be entered: use of CSV (comma
  3656. separated values) is recommended. The sixth line gives the actual value to
  3657. be sent to clients. Data is specified as a normal text, with
  3658. values separated by commas if more than one value is
  3659. allowed.
  3660. </para>
  3661. <para>
  3662. Options can also be configured as hexadecimal values. If csv-format is
  3663. set to false, option data must be specified as a hex string. The
  3664. following commands configure the domain-name-servers option for all
  3665. subnets with the following addresses: 192.0.3.1 and 192.0.3.2.
  3666. Note that csv-format is set to false.
  3667. <screen>
  3668. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3669. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  3670. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  3671. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3672. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format false</userinput>
  3673. &gt; <userinput>config set Dhcp4/option-data[0]/data "C0 00 03 01 C0 00 03 02"</userinput>
  3674. &gt; <userinput>config commit</userinput>
  3675. </screen>
  3676. </para>
  3677. <para>
  3678. It is possible to override options on a per-subnet basis. If
  3679. clients connected to most of your subnets are expected to get the
  3680. same values of a given option, you should use global options: you
  3681. can then override specific values for a small number of subnets.
  3682. On the other hand, if you use different values in each subnet,
  3683. it does not make sense to specify global option values
  3684. (Dhcp4/option-data), rather you should set only subnet-specific values
  3685. (Dhcp4/subnet[X]/option-data[Y]).
  3686. </para>
  3687. <para>
  3688. The following commands override the global
  3689. DNS servers option for a particular subnet, setting a single DNS
  3690. server with address 192.0.2.3.
  3691. <screen>
  3692. &gt; <userinput>config add Dhcp4/subnet4[0]/option-data</userinput>
  3693. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/name "domain-name-servers"</userinput>
  3694. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/code 6</userinput>
  3695. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/space "dhcp4"</userinput>
  3696. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/csv-format true</userinput>
  3697. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/data "192.0.2.3"</userinput>
  3698. &gt; <userinput>config commit</userinput></screen>
  3699. </para>
  3700. <note>
  3701. <para>In a future version of Kea, it will not be necessary to specify
  3702. the option code, space and csv-format fields as they will be set
  3703. automatically.</para>
  3704. </note>
  3705. <para>
  3706. The currently supported standard DHCPv4 options are
  3707. listed in <xref linkend="dhcp4-std-options-list"/>
  3708. and <xref linkend="dhcp4-std-options-list-part2"/>.
  3709. The "Name" and "Code"
  3710. are the values that should be used as a name in the option-data
  3711. structures. "Type" designates the format of the data: the meanings of
  3712. the various types is given in <xref linkend="dhcp-types"/>.
  3713. </para>
  3714. <para>
  3715. Some options are designated as arrays, which means that more than one
  3716. value is allowed in such an option. For example the option time-servers
  3717. allows the specification of more than one IPv4 address, so allowing
  3718. clients to obtain the the addresses of multiple NTP servers.
  3719. </para>
  3720. <!-- @todo: describe record types -->
  3721. <para>
  3722. The <xref linkend="dhcp4-custom-options"/> describes the configuration
  3723. syntax to create custom option definitions (formats). It is generally not
  3724. allowed to create custom definitions for standard options, even if the
  3725. definition being created matches the actual option format defined in the
  3726. RFCs. There is an exception from this rule for standard options for which
  3727. Kea does not provide a definition yet. In order to use such options,
  3728. a server administrator must create a definition as described in
  3729. <xref linkend="dhcp4-custom-options"/> in the 'dhcp4' option space. This
  3730. definition should match the option format described in the relevant
  3731. RFC but configuration mechanism would allow any option format as it has
  3732. no means to validate it at the moment.
  3733. </para>
  3734. <para>
  3735. <table frame="all" id="dhcp4-std-options-list">
  3736. <title>List of standard DHCPv4 options</title>
  3737. <tgroup cols='4'>
  3738. <colspec colname='name'/>
  3739. <colspec colname='code'/>
  3740. <colspec colname='type'/>
  3741. <colspec colname='array'/>
  3742. <thead>
  3743. <row>
  3744. <entry>Name</entry>
  3745. <entry>Code</entry>
  3746. <entry>Type</entry>
  3747. <entry>Array?</entry>
  3748. </row>
  3749. </thead>
  3750. <tbody>
  3751. <row><entry>subnet-mask</entry><entry>1</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3752. <row><entry>time-offset</entry><entry>2</entry><entry>int32</entry><entry>false</entry></row>
  3753. <row><entry>routers</entry><entry>3</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3754. <row><entry>time-servers</entry><entry>4</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3755. <row><entry>name-servers</entry><entry>5</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3756. <row><entry>domain-name-servers</entry><entry>6</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3757. <row><entry>log-servers</entry><entry>7</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3758. <row><entry>cookie-servers</entry><entry>8</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3759. <row><entry>lpr-servers</entry><entry>9</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3760. <row><entry>impress-servers</entry><entry>10</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3761. <row><entry>resource-location-servers</entry><entry>11</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3762. <row><entry>host-name</entry><entry>12</entry><entry>string</entry><entry>false</entry></row>
  3763. <row><entry>boot-size</entry><entry>13</entry><entry>uint16</entry><entry>false</entry></row>
  3764. <row><entry>merit-dump</entry><entry>14</entry><entry>string</entry><entry>false</entry></row>
  3765. <row><entry>domain-name</entry><entry>15</entry><entry>fqdn</entry><entry>false</entry></row>
  3766. <row><entry>swap-server</entry><entry>16</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3767. <row><entry>root-path</entry><entry>17</entry><entry>string</entry><entry>false</entry></row>
  3768. <row><entry>extensions-path</entry><entry>18</entry><entry>string</entry><entry>false</entry></row>
  3769. <row><entry>ip-forwarding</entry><entry>19</entry><entry>boolean</entry><entry>false</entry></row>
  3770. <row><entry>non-local-source-routing</entry><entry>20</entry><entry>boolean</entry><entry>false</entry></row>
  3771. <row><entry>policy-filter</entry><entry>21</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3772. <row><entry>max-dgram-reassembly</entry><entry>22</entry><entry>uint16</entry><entry>false</entry></row>
  3773. <row><entry>default-ip-ttl</entry><entry>23</entry><entry>uint8</entry><entry>false</entry></row>
  3774. <row><entry>path-mtu-aging-timeout</entry><entry>24</entry><entry>uint32</entry><entry>false</entry></row>
  3775. <row><entry>path-mtu-plateau-table</entry><entry>25</entry><entry>uint16</entry><entry>true</entry></row>
  3776. <row><entry>interface-mtu</entry><entry>26</entry><entry>uint16</entry><entry>false</entry></row>
  3777. <row><entry>all-subnets-local</entry><entry>27</entry><entry>boolean</entry><entry>false</entry></row>
  3778. <row><entry>broadcast-address</entry><entry>28</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3779. <row><entry>perform-mask-discovery</entry><entry>29</entry><entry>boolean</entry><entry>false</entry></row>
  3780. <row><entry>mask-supplier</entry><entry>30</entry><entry>boolean</entry><entry>false</entry></row>
  3781. <row><entry>router-discovery</entry><entry>31</entry><entry>boolean</entry><entry>false</entry></row>
  3782. <row><entry>router-solicitation-address</entry><entry>32</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3783. <row><entry>static-routes</entry><entry>33</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3784. <row><entry>trailer-encapsulation</entry><entry>34</entry><entry>boolean</entry><entry>false</entry></row>
  3785. <row><entry>arp-cache-timeout</entry><entry>35</entry><entry>uint32</entry><entry>false</entry></row>
  3786. <row><entry>ieee802-3-encapsulation</entry><entry>36</entry><entry>boolean</entry><entry>false</entry></row>
  3787. <row><entry>default-tcp-ttl</entry><entry>37</entry><entry>uint8</entry><entry>false</entry></row>
  3788. <row><entry>tcp-keepalive-internal</entry><entry>38</entry><entry>uint32</entry><entry>false</entry></row>
  3789. <row><entry>tcp-keepalive-garbage</entry><entry>39</entry><entry>boolean</entry><entry>false</entry></row>
  3790. </tbody>
  3791. </tgroup>
  3792. </table>
  3793. </para>
  3794. <para>
  3795. <table frame="all" id="dhcp4-std-options-list-part2">
  3796. <title>List of standard DHCPv4 options (continued)</title>
  3797. <tgroup cols='4'>
  3798. <colspec colname='name'/>
  3799. <colspec colname='code'/>
  3800. <colspec colname='type'/>
  3801. <colspec colname='array'/>
  3802. <thead>
  3803. <row>
  3804. <entry>Name</entry>
  3805. <entry>Code</entry>
  3806. <entry>Type</entry>
  3807. <entry>Array?</entry>
  3808. </row>
  3809. </thead>
  3810. <tbody>
  3811. <row><entry>nis-domain</entry><entry>40</entry><entry>string</entry><entry>false</entry></row>
  3812. <row><entry>nis-servers</entry><entry>41</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3813. <row><entry>ntp-servers</entry><entry>42</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3814. <row><entry>vendor-encapsulated-options</entry><entry>43</entry><entry>empty</entry><entry>false</entry></row>
  3815. <row><entry>netbios-name-servers</entry><entry>44</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3816. <row><entry>netbios-dd-server</entry><entry>45</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3817. <row><entry>netbios-node-type</entry><entry>46</entry><entry>uint8</entry><entry>false</entry></row>
  3818. <row><entry>netbios-scope</entry><entry>47</entry><entry>string</entry><entry>false</entry></row>
  3819. <row><entry>font-servers</entry><entry>48</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3820. <row><entry>x-display-manager</entry><entry>49</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3821. <row><entry>dhcp-requested-address</entry><entry>50</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3822. <!-- Lease time should not be configured by a user.
  3823. <row><entry>dhcp-lease-time</entry><entry>51</entry><entry>uint32</entry><entry>false</entry></row>
  3824. -->
  3825. <row><entry>dhcp-option-overload</entry><entry>52</entry><entry>uint8</entry><entry>false</entry></row>
  3826. <!-- Message Type, Server Identifier and Parameter Request List should not be configured by a user.
  3827. <row><entry>dhcp-message-type</entry><entry>53</entry><entry>uint8</entry><entry>false</entry></row>
  3828. <row><entry>dhcp-server-identifier</entry><entry>54</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3829. <row><entry>dhcp-parameter-request-list</entry><entry>55</entry><entry>uint8</entry><entry>true</entry></row>
  3830. -->
  3831. <row><entry>dhcp-message</entry><entry>56</entry><entry>string</entry><entry>false</entry></row>
  3832. <row><entry>dhcp-max-message-size</entry><entry>57</entry><entry>uint16</entry><entry>false</entry></row>
  3833. <!-- Renewal and rebinding time should not be configured by a user.
  3834. <row><entry>dhcp-renewal-time</entry><entry>58</entry><entry>uint32</entry><entry>false</entry></row>
  3835. <row><entry>dhcp-rebinding-time</entry><entry>59</entry><entry>uint32</entry><entry>false</entry></row>
  3836. -->
  3837. <row><entry>vendor-class-identifier</entry><entry>60</entry><entry>binary</entry><entry>false</entry></row>
  3838. <!-- Client identifier should not be configured by a user.
  3839. <row><entry>dhcp-client-identifier</entry><entry>61</entry><entry>binary</entry><entry>false</entry></row>
  3840. -->
  3841. <row><entry>nwip-domain-name</entry><entry>62</entry><entry>string</entry><entry>false</entry></row>
  3842. <row><entry>nwip-suboptions</entry><entry>63</entry><entry>binary</entry><entry>false</entry></row>
  3843. <row><entry>tftp-server-name</entry><entry>66</entry><entry>string</entry><entry>false</entry></row>
  3844. <row><entry>boot-file-name</entry><entry>67</entry><entry>string</entry><entry>false</entry></row>
  3845. <row><entry>user-class</entry><entry>77</entry><entry>binary</entry><entry>false</entry></row>
  3846. <row><entry>fqdn</entry><entry>81</entry><entry>record</entry><entry>false</entry></row>
  3847. <row><entry>dhcp-agent-options</entry><entry>82</entry><entry>empty</entry><entry>false</entry></row>
  3848. <row><entry>authenticate</entry><entry>90</entry><entry>binary</entry><entry>false</entry></row>
  3849. <row><entry>client-last-transaction-time</entry><entry>91</entry><entry>uint32</entry><entry>false</entry></row>
  3850. <row><entry>associated-ip</entry><entry>92</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3851. <row><entry>subnet-selection</entry><entry>118</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3852. <row><entry>domain-search</entry><entry>119</entry><entry>binary</entry><entry>false</entry></row>
  3853. <row><entry>vivco-suboptions</entry><entry>124</entry><entry>binary</entry><entry>false</entry></row>
  3854. <row><entry>vivso-suboptions</entry><entry>125</entry><entry>binary</entry><entry>false</entry></row>
  3855. </tbody>
  3856. </tgroup>
  3857. </table>
  3858. </para>
  3859. <para>
  3860. <table frame="all" id="dhcp-types">
  3861. <title>List of standard DHCP option types</title>
  3862. <tgroup cols='2'>
  3863. <colspec colname='name'/>
  3864. <colspec colname='meaning'/>
  3865. <thead>
  3866. <row><entry>Name</entry><entry>Meaning</entry></row>
  3867. </thead>
  3868. <tbody>
  3869. <row><entry>binary</entry><entry>An arbitrary string of bytes, specified as a set of hexadecimal digits.</entry></row>
  3870. <row><entry>boolean</entry><entry>Boolean value with allowed values true or false</entry></row>
  3871. <row><entry>empty</entry><entry>No value, data is carried in suboptions</entry></row>
  3872. <row><entry>fqdn</entry><entry>Fully qualified domain name (e.g. www.example.com)</entry></row>
  3873. <row><entry>ipv4-address</entry><entry>IPv4 address in the usual dotted-decimal notation (e.g. 192.0.2.1)</entry></row>
  3874. <row><entry>ipv6-address</entry><entry>IPv6 address in the usual colon notation (e.g. 2001:db8::1)</entry></row>
  3875. <row><entry>record</entry><entry>Structured data that may comprise any types (except "record" and "empty")</entry></row>
  3876. <row><entry>string</entry><entry>Any text</entry></row>
  3877. <row><entry>uint8</entry><entry>8 bit unsigned integer with allowed values 0 to 255</entry></row>
  3878. <row><entry>uint16</entry><entry>16 bit unsinged integer with allowed values 0 to 65535</entry></row>
  3879. <row><entry>uint32</entry><entry>32 bit unsigned integer with allowed values 0 to 4294967295</entry></row>
  3880. </tbody>
  3881. </tgroup>
  3882. </table>
  3883. </para>
  3884. </section>
  3885. <section id="dhcp4-custom-options">
  3886. <title>Custom DHCPv4 options</title>
  3887. <para>It is also possible to define options other than the standard ones.
  3888. Assume that we want to define a new DHCPv4 option called "foo" which will have
  3889. code 222 and will convey a single unsigned 32 bit integer value. We can define
  3890. such an option by using the following commands:
  3891. <screen>
  3892. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3893. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  3894. &gt; <userinput>config set Dhcp4/option-def[0]/code 222</userinput>
  3895. &gt; <userinput>config set Dhcp4/option-def[0]/type "uint32"</userinput>
  3896. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  3897. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  3898. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  3899. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  3900. &gt; <userinput>config commit</userinput></screen>
  3901. The "false" value of the "array" parameter determines that the option
  3902. does NOT comprise an array of "uint32" values but rather a single value.
  3903. Two other parameters have been left blank: "record-types" and "encapsulate".
  3904. The former specifies the comma separated list of option data fields if the
  3905. option comprises a record of data fields. The "record-fields" value should
  3906. be non-empty if the "type" is set to "record". Otherwise it must be left
  3907. blank. The latter parameter specifies the name of the option space being
  3908. encapsulated by the particular option. If the particular option does not
  3909. encapsulate any option space it should be left blank.
  3910. Note that the above set of comments define the format of the new option and do not
  3911. set its values.
  3912. </para>
  3913. <note>
  3914. <para>
  3915. In the current release the default values are not propagated to the
  3916. parser when the new configuration is being set. Therefore, all
  3917. parameters must be specified at all times, even if their values are
  3918. left blank.
  3919. </para>
  3920. </note>
  3921. <para>Once the new option format is defined, its value is set
  3922. in the same way as for a standard option. For example the following
  3923. commands set a global value that applies to all subnets.
  3924. <screen>
  3925. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3926. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  3927. &gt; <userinput>config set Dhcp4/option-data[0]/code 222</userinput>
  3928. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3929. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3930. &gt; <userinput>config set Dhcp4/option-data[0]/data "12345"</userinput>
  3931. &gt; <userinput>config commit</userinput></screen>
  3932. </para>
  3933. <para>New options can take more complex forms than simple use of
  3934. primitives (uint8, string, ipv4-address etc): it is possible to
  3935. define an option comprising a number of existing primitives.
  3936. </para>
  3937. <para>Assume we want to define a new option that will consist of
  3938. an IPv4 address, followed by unsigned 16 bit integer, followed by
  3939. a boolean value, followed by a text string. Such an option could
  3940. be defined in the following way:
  3941. <screen>
  3942. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3943. &gt; <userinput>config set Dhcp4/option-def[0]/name "bar"</userinput>
  3944. &gt; <userinput>config set Dhcp4/option-def[0]/code 223</userinput>
  3945. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  3946. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  3947. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  3948. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, boolean, string"</userinput>
  3949. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  3950. </screen>
  3951. The "type" is set to "record" to indicate that the option contains
  3952. multiple values of different types. These types are given as a comma-separated
  3953. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  3954. </para>
  3955. <para>
  3956. The values of the option are set as follows:
  3957. <screen>
  3958. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3959. &gt; <userinput>config set Dhcp4/option-data[0]/name "bar"</userinput>
  3960. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3961. &gt; <userinput>config set Dhcp4/option-data[0]/code 223</userinput>
  3962. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3963. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.100, 123, true, Hello World"</userinput>
  3964. &gt; <userinput>config commit</userinput></screen>
  3965. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  3966. list of values. The values in the "data" must correspond to the types set in
  3967. the "record-types" field of the option definition.
  3968. </para>
  3969. <note>
  3970. <para>
  3971. It is recommended that boolean values are specified using "true" and "false"
  3972. strings. This helps to prevent errors when typing multiple comma separated
  3973. values, as it make it easier to identify the type of the value being typed,
  3974. and compare it with the order of data fields. Nevetheless, it is possible
  3975. to use integer values: "1" and "0", instead of "true" and "false"
  3976. accordingly. If other integer value is specified, the configuration is
  3977. rejected.
  3978. </para>
  3979. </note>
  3980. </section>
  3981. <section id="dhcp4-vendor-opts">
  3982. <title>DHCPv4 vendor specific options</title>
  3983. <para>
  3984. Currently there are three option spaces defined: dhcp4 (to
  3985. be used in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there
  3986. is also vendor-encapsulated-options-space, which is empty by default, but options
  3987. can be defined in it. Those options are called vendor-specific
  3988. information options. The following examples show how to define
  3989. an option "foo" with code 1 that consists of an IPv4 address, an
  3990. unsigned 16 bit integer and a string. The "foo" option is conveyed
  3991. in a vendor specific information option.
  3992. </para>
  3993. <para>
  3994. The first step is to define the format of the option:
  3995. <screen>
  3996. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3997. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  3998. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  3999. &gt; <userinput>config set Dhcp4/option-def[0]/space "vendor-encapsulated-options-space"</userinput>
  4000. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  4001. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  4002. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, string"</userinput>
  4003. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulates ""</userinput>
  4004. &gt; <userinput>config commit</userinput>
  4005. </screen>
  4006. (Note that the option space is set to "vendor-encapsulated-options-space".)
  4007. Once the option format is defined, the next step is to define actual values
  4008. for that option:
  4009. <screen>
  4010. &gt; <userinput>config add Dhcp4/option-data</userinput>
  4011. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  4012. &gt; <userinput>config set Dhcp4/option-data[0]/space "vendor-encapsulated-options-space"</userinput>
  4013. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  4014. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  4015. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3, 123, Hello World"</userinput>
  4016. &gt; <userinput>config commit</userinput></screen>
  4017. We also set up a dummy value for vendor-opts, the option that conveys our sub-option "foo".
  4018. This is required else the option will not be included in messages sent to the client.
  4019. <screen>
  4020. &gt; <userinput>config add Dhcp4/option-data</userinput>
  4021. &gt; <userinput>config set Dhcp4/option-data[1]/name "vendor-encapsulated-options"</userinput>
  4022. &gt; <userinput>config set Dhcp4/option-data[1]/space "dhcp4"</userinput>
  4023. &gt; <userinput>config set Dhcp4/option-data[1]/code 43</userinput>
  4024. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format false</userinput>
  4025. &gt; <userinput>config set Dhcp4/option-data[1]/data ""</userinput>
  4026. &gt; <userinput>config commit</userinput></screen>
  4027. </para>
  4028. <note>
  4029. <para>
  4030. With this version of BIND 10, the "vendor-encapsulated-options" option
  4031. must be specified in the configuration although it has no configurable
  4032. parameters. If it is not specified, the server will assume that it is
  4033. not configured and will not send it to a client. In the future there
  4034. will be no need to include this option in the configuration.
  4035. </para>
  4036. </note>
  4037. </section>
  4038. <section id="dhcp4-option-spaces">
  4039. <title>Nested DHCPv4 options (custom option spaces)</title>
  4040. <para>It is sometimes useful to define completely new option
  4041. space. This is the case when user creates new option in the
  4042. standard option space ("dhcp4 or "dhcp6") and wants this option
  4043. to convey sub-options. Thanks to being in the separate space,
  4044. sub-option codes will have a separate numbering scheme and may
  4045. overlap with codes of standard options.
  4046. </para>
  4047. <para>Note that creation of a new option space when defining
  4048. sub-options for a standard option is not required, because it is
  4049. created by default if the standard option is meant to convey any
  4050. sub-options (see <xref linkend="dhcp4-vendor-opts"/>).
  4051. </para>
  4052. <para>
  4053. Assume that we want to have a DHCPv4 option called "container" with
  4054. code 222 that conveys two sub-options with codes 1 and 2.
  4055. First we need to define the new sub-options:
  4056. <screen>
  4057. &gt; <userinput>config add Dhcp4/option-def</userinput>
  4058. &gt; <userinput>config set Dhcp4/option-def[0]/name "subopt1"</userinput>
  4059. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  4060. &gt; <userinput>config set Dhcp4/option-def[0]/space "isc"</userinput>
  4061. &gt; <userinput>config set Dhcp4/option-def[0]/type "ipv4-address"</userinput>
  4062. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  4063. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  4064. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  4065. &gt; <userinput>config commit</userinput>
  4066. &gt; <userinput>config add Dhcp4/option-def</userinput>
  4067. &gt; <userinput>config set Dhcp4/option-def[1]/name "subopt2"</userinput>
  4068. &gt; <userinput>config set Dhcp4/option-def[1]/code 2</userinput>
  4069. &gt; <userinput>config set Dhcp4/option-def[1]/space "isc"</userinput>
  4070. &gt; <userinput>config set Dhcp4/option-def[1]/type "string"</userinput>
  4071. &gt; <userinput>config set Dhcp4/option-def[1]/record-types ""</userinput>
  4072. &gt; <userinput>config set Dhcp4/option-def[1]/array false</userinput>
  4073. &gt; <userinput>config set Dhcp4/option-def[1]/encapsulate ""</userinput>
  4074. &gt; <userinput>config commit</userinput>
  4075. </screen>
  4076. Note that we have defined the options to belong to a new option space
  4077. (in this case, "isc").
  4078. </para>
  4079. <para>
  4080. The next step is to define a regular DHCPv4 option with our desired
  4081. code and specify that it should include options from the new option space:
  4082. <screen>
  4083. &gt; <userinput>add Dhcp4/option-def</userinput>
  4084. &gt; <userinput>set Dhcp4/option-def[2]/name "container"</userinput>
  4085. &gt; <userinput>set Dhcp4/option-def[2]/code 222</userinput>
  4086. &gt; <userinput>set Dhcp4/option-def[2]/space "dhcp4"</userinput>
  4087. &gt; <userinput>set Dhcp4/option-def[2]/type "empty"</userinput>
  4088. &gt; <userinput>set Dhcp4/option-def[2]/array false</userinput>
  4089. &gt; <userinput>set Dhcp4/option-def[2]/record-types ""</userinput>
  4090. &gt; <userinput>set Dhcp4/option-def[2]/encapsulate "isc"</userinput>
  4091. &gt; <userinput>commit</userinput>
  4092. </screen>
  4093. The name of the option space in which the sub-options are defined
  4094. is set in the "encapsulate" field. The "type" field is set to "empty"
  4095. to indicate that this option does not carry any data other than
  4096. sub-options.
  4097. </para>
  4098. <para>
  4099. Finally, we can set values for the new options:
  4100. <screen>
  4101. &gt; <userinput>config add Dhcp4/option-data</userinput>
  4102. &gt; <userinput>config set Dhcp4/option-data[0]/name "subopt1"</userinput>
  4103. &gt; <userinput>config set Dhcp4/option-data[0]/space "isc"</userinput>
  4104. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  4105. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  4106. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3"</userinput>
  4107. &gt; <userinput>config commit</userinput>
  4108. <userinput></userinput>
  4109. &gt; <userinput>config add Dhcp4/option-data</userinput>
  4110. &gt; <userinput>config set Dhcp4/option-data[1]/name "subopt2"</userinput>
  4111. &gt; <userinput>config set Dhcp4/option-data[1]/space "isc"</userinput>
  4112. &gt; <userinput>config set Dhcp4/option-data[1]/code 2</userinput>
  4113. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format true</userinput>
  4114. &gt; <userinput>config set Dhcp4/option-data[1]/data "Hello world"</userinput>
  4115. &gt; <userinput>config commit</userinput>
  4116. <userinput></userinput>
  4117. &gt; <userinput>config add Dhcp4/option-data</userinput>
  4118. &gt; <userinput>config set Dhcp4/option-data[2]/name "container"</userinput>
  4119. &gt; <userinput>config set Dhcp4/option-data[2]/space "dhcp4"</userinput>
  4120. &gt; <userinput>config set Dhcp4/option-data[2]/code 222</userinput>
  4121. &gt; <userinput>config set Dhcp4/option-data[2]/csv-format true</userinput>
  4122. &gt; <userinput>config set Dhcp4/option-data[2]/data ""</userinput>
  4123. &gt; <userinput>config commit</userinput>
  4124. </screen>
  4125. Even though the "container" option does not carry any data except
  4126. sub-options, the "data" field must be explicitly set to an empty value.
  4127. This is required because in the current version of BIND 10 DHCP, the
  4128. default configuration values are not propagated to the configuration parsers:
  4129. if the "data" is not set the parser will assume that this
  4130. parameter is not specified and an error will be reported.
  4131. </para>
  4132. <para>Note that it is possible to create an option which carries some data
  4133. in addition to the sub-options defined in the encapsulated option space. For example,
  4134. if the "container" option from the previous example was required to carry an uint16
  4135. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  4136. the option definition. (Such an option would then have the following
  4137. data structure: DHCP header, uint16 value, sub-options.) The value specified
  4138. with the "data" parameter - which should be a valid integer enclosed in quotes,
  4139. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  4140. </para>
  4141. </section>
  4142. <section id="dhcp4-client-classifier">
  4143. <title>Client Classification in DHCPv4</title>
  4144. <note>
  4145. <para>
  4146. DHCPv4 server has been extended to support limited client classification.
  4147. Although the current capability is modest, it is expected to be expanded
  4148. in the future. It is envisaged that the majority of client classification
  4149. extensions will be using hooks extensions.
  4150. </para>
  4151. </note>
  4152. <para>In certain cases it is useful to differentiate between different
  4153. types of clients and treat them differently. The process of doing
  4154. classification is conducted in two steps. The first step is to assess
  4155. incoming packet and assign it to zero or more classes. This classification
  4156. is currently simple, but is expected to grow in capability soon. Currently
  4157. the server checks whether incoming packet has vendor class identifier
  4158. option (60). If it has, content of that option is prepended with
  4159. &quot;VENDOR_CLASS_&quot; then is interpreted as a class. For example,
  4160. modern cable modems will send this option with value &quot;docsis3.0&quot;
  4161. and as a result the packet will belong to class &quot;VENDOR_CLASS_docsis3.0&quot;.
  4162. </para>
  4163. <para>It is envisaged that the client classification will be used for changing
  4164. behavior of almost any part of the DHCP message processing, including assigning
  4165. leases from different pools, assigning different option (or different values of
  4166. the same options) etc. For now, there are only two mechanisms that are taking
  4167. advantage of client classification: specific processing for cable modems and
  4168. subnet selection.</para>
  4169. <para>
  4170. For clients that belong to the VENDOR_CLASS_docsis3.0 class, the siaddr
  4171. field is set to the value of next-server (if specified in a subnet). If
  4172. there is boot-file-name option specified, its value is also set in the
  4173. file field in the DHCPv4 packet. For eRouter1.0 class, the siaddr is
  4174. always set to 0.0.0.0. That capability is expected to be moved to
  4175. external hook library that will be dedicated to cable modems.
  4176. </para>
  4177. <para>
  4178. Kea can be instructed to limit access to given subnets based on class information.
  4179. This is particularly useful for cases where two types of devices share the
  4180. same link and are expected to be served from two different subnets. The
  4181. primary use case for such a scenario is cable networks. There are two
  4182. classes of devices: cable modem itself, which should be handled a lease
  4183. from subnet A and all other devices behind modems that should get a lease
  4184. from subnet B. That segregation is essential to prevent overly curious
  4185. users from playing with their cable modems. For details on how to set up
  4186. class restrictions on subnets, see <xref linkend="dhcp4-subnet-class"/>.
  4187. </para>
  4188. </section>
  4189. <section id="dhcp4-subnet-class">
  4190. <title>Limiting access to IPv4 subnet to certain classes</title>
  4191. <para>
  4192. In certain cases it beneficial to restrict access to certain subnets
  4193. only to clients that belong to a given subnet. For details on client
  4194. classes, see <xref linkend="dhcp4-client-classifier"/>. This is an
  4195. extension of a previous example from <xref linkend="dhcp4-address-config"/>.
  4196. Let's assume that the server is connected to a network segment that uses
  4197. the 192.0.2.0/24 prefix. The Administrator of that network has decided
  4198. that addresses from range 192.0.2.10 to 192.0.2.20 are going to be
  4199. managed by the Dhcp4 server. Only clients belonging to client class
  4200. VENDOR_CLASS_docsis3.0 are allowed to use this subnet. Such a
  4201. configuration can be achieved in the following way:
  4202. <screen>
  4203. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4204. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  4205. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  4206. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "VENDOR_CLASS_docsis3.0"</userinput>
  4207. &gt; <userinput>config commit</userinput></screen>
  4208. </para>
  4209. <para>
  4210. Care should be taken with client classification as it is easy to prevent
  4211. clients that do not meet class criteria to be denied any service altogether.
  4212. </para>
  4213. </section>
  4214. <section id="dhcp4-ddns-config">
  4215. <title>Configuring DHCPv4 for DDNS</title>
  4216. <para>
  4217. As mentioned earlier, DHCPv4 can be configured to generate requests to the
  4218. DHCP-DDNS server to update DNS entries. These requests are known as
  4219. NameChangeRequests or NCRs. Each NCR contains the following information:
  4220. <orderedlist>
  4221. <listitem><para>
  4222. Whether it is a request to add (update) or remove DNS entries
  4223. </para></listitem>
  4224. <listitem><para>
  4225. Whether the change requests forward DNS updates (A records), reverse
  4226. DNS updates (PTR records), or both.
  4227. </para></listitem>
  4228. <listitem><para>
  4229. The FQDN, lease address, and DHCID
  4230. </para></listitem>
  4231. </orderedlist>
  4232. The paramaters for controlling the generation of NCRs for submission to D2
  4233. are contained in the "dhcp-ddns" section of the DHCPv4 server
  4234. configuration. The default values for this section appears as follows:
  4235. <screen>
  4236. &gt; <userinput>config show Dhcp4/dhcp-ddns</userinput>
  4237. Dhcp4/dhcp-ddns/enable-updates true boolean
  4238. Dhcp4/dhcp-ddns/server-ip "127.0.0.1" string
  4239. Dhcp4/dhcp-ddns/server-port 53001 integer
  4240. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  4241. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  4242. Dhcp4/dhcp-ddns/override-no-update false boolean
  4243. Dhcp4/dhcp-ddns/override-client-update false boolean
  4244. Dhcp4/dhcp-ddns/replace-client-name false boolean
  4245. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  4246. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  4247. </screen>
  4248. </para>
  4249. <para>
  4250. The "enable-updates" parameter determines whether or not DHCPv4 will
  4251. generate NCRs. By default, this value is false hence DDNS updates are
  4252. disabled. To enable DDNS updates set this value to true:
  4253. </para>
  4254. <screen>
  4255. &gt; <userinput>config set Dhcp4/dhcp-ddns/enable-updates true</userinput>
  4256. &gt; <userinput>config commit</userinput>
  4257. </screen>
  4258. <section id="dhcpv4-d2-io-config">
  4259. <title>DHCP-DDNS Server Connectivty</title>
  4260. <para>
  4261. In order for NCRs to reach the D2 server, DHCPv4 must be able
  4262. to communicate with it and so the relevant parameters must be set
  4263. appropriately. The parameters, "server-ip" and "server-port", specify
  4264. the address of the D2 server. By default, D2 is assumed to running
  4265. on the same machine as DHCPv4, and the default values for these two
  4266. parameters should be sufficient. However, if D2 has been configured
  4267. to listen on a different address or port, these values must altered
  4268. accordingly. For example, if D2 has been configured to listen on
  4269. 198.162.1.10 port 900, the following commands would be required:
  4270. <screen>
  4271. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-ip "198.162.1.10"</userinput>
  4272. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-port 900</userinput>
  4273. &gt; <userinput>config commit</userinput>
  4274. </screen>
  4275. D2 can be configured to listen over IPv4 or IPv6, therefore server-ip
  4276. may be either an IPv4 or IPv6 address.
  4277. </para>
  4278. <para>
  4279. The socket protocol that DHCPv4 should use to communicate with D2 is
  4280. specified with the "ncr-protocol" parameter. Currently only UDP is
  4281. supported.
  4282. </para>
  4283. <para>
  4284. The internal format for DDNS update requests sent by DHCPv4 is specified
  4285. with the "ncr-format" parameter. Currently only JSON is supported.
  4286. </para>
  4287. </section>
  4288. <section id="dhcpv4-d2-rules-config">
  4289. <title>When does the DHCPv4 server generate DDNS requests?</title>
  4290. DHCPv4 follows the behavior prescribed for DHCP servers in RFC 4702.
  4291. It is important to keep in mind that DHCPv4 provides the initial decision
  4292. making of when and what to update and forwards that information to D2 in
  4293. the form of NCRs. Carrying out the actual DNS updates and dealing with
  4294. such things as conflict resolution are the purvue of D2 (<xref linkend="dhcp-ddns-server"/>).
  4295. <para>
  4296. This section describes when DHCPv4 will generate NCRs and the
  4297. configuration parameters that can be used to influence this decision.
  4298. It assumes that the "enable-updates" paramater is true.
  4299. </para>
  4300. <para>
  4301. In general, DHCPv4 will generate DDNS udpate requests when:
  4302. <orderedlist>
  4303. <listitem><para>
  4304. A new lease is granted in response to a DHCP REQUEST
  4305. </para></listitem>
  4306. <listitem><para>
  4307. An existing lease is renewed but the FQDN associated with it has
  4308. changed.
  4309. </para></listitem>
  4310. <listitem><para>
  4311. An existing lease is released in response to a DHCP RELEASE
  4312. </para></listitem>
  4313. </orderedlist>
  4314. In the second case, lease renewal, two DDNS requests will be issued: one
  4315. request to remove entries for the previous FQDN and a second request to
  4316. add entries for the new FQDN. In the last case, a lease release, a
  4317. single DDNS request to remove its entries will be made. The decision
  4318. making involved when granting a new lease (the first case) is more
  4319. involved and is discussed next.
  4320. </para>
  4321. <para>
  4322. When a new lease is granted, the DHCPv4 server will generate a DDNS
  4323. update request if the DHCP REQUEST contains either the FQDN option
  4324. (code 81) or the Host Name option (code 12). If both are present,
  4325. the server will use the FQDN option. By default the DHCPv4 server
  4326. will respect the FQDN N and S flags specified by the client as shown
  4327. in the following table:
  4328. </para>
  4329. <table id="fqdn-flag-table">
  4330. <title>Default FQDN Flag Behavior</title>
  4331. <tgroup cols='4' align='left'>
  4332. <colspec colname='cflags'/>
  4333. <colspec colname='meaning'/>
  4334. <colspec colname='response'/>
  4335. <colspec colname='sflags'/>
  4336. <thead>
  4337. <row>
  4338. <entry>Client Flags:N-S</entry>
  4339. <entry>Client Intent</entry>
  4340. <entry>Server Response</entry>
  4341. <entry>Server Flags:N-S-O</entry>
  4342. </row>
  4343. </thead>
  4344. <tbody>
  4345. <row>
  4346. <entry>0-0</entry>
  4347. <entry>
  4348. Client wants to do forward updates, server should do reverse updates
  4349. </entry>
  4350. <entry>Server generates reverse-only request</entry>
  4351. <entry>1-0-0</entry>
  4352. </row>
  4353. <row>
  4354. <entry>0-1</entry>
  4355. <entry>Server should do both forward and reverse updates</entry>
  4356. <entry>Server generates request to update both directions</entry>
  4357. <entry>0-1-0</entry>
  4358. </row>
  4359. <row>
  4360. <entry>1-0</entry>
  4361. <entry>Client wants no updates done</entry>
  4362. <entry>Server does not generate a request</entry>
  4363. <entry>1-0-0</entry>
  4364. </row>
  4365. </tbody>
  4366. </tgroup>
  4367. </table>
  4368. <para>
  4369. The first row in the table above represents "client delegation". Here
  4370. the DHCP client states that it intends to do the forward DNS updates and
  4371. the server should do the reverese updates. By default, DHCPv4 will honor
  4372. the client's wishes and generate a DDNS request to D2 to update only
  4373. reverse DNS data. The parameter, "override-client-update", can be used
  4374. to instruct the server to override client delegation requests. When
  4375. this parameter is true, DHCPv4 will disregard requests for client
  4376. delegation and generate a DDNS request to update both forward and
  4377. reverse DNS data. In this case, the N-S-O flags in the server's
  4378. response to the client will be 0-1-1 respectively.
  4379. </para>
  4380. <para>
  4381. (Note that the flag combination N=1, S=1 is prohibited according to
  4382. RFC 4702. If such a combination is received from the client, the packet
  4383. will be dropped by the DHCPv4 server.)
  4384. </para>
  4385. <para>
  4386. To override client delegation, issue the following commands:
  4387. </para>
  4388. <screen>
  4389. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-client-update true</userinput>
  4390. &gt; <userinput>config commit</userinput>
  4391. </screen>
  4392. <para>
  4393. The third row in the table above describes the case in which the client
  4394. requests that no DNS updates be done. The parameter, "override-no-update",
  4395. can be used to instruct the server to disregard the client's wishes. When
  4396. this parameter is true, DHCPv4 will generate DDNS udpate request to D2
  4397. even if the client requests no updates be done. The N-S-O flags in the
  4398. server's response to the client will be 0-1-1.
  4399. </para>
  4400. <para>
  4401. To override client delegation, issue the following commands:
  4402. </para>
  4403. <screen>
  4404. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-no-update true</userinput>
  4405. &gt; <userinput>config commit</userinput>
  4406. </screen>
  4407. <para>
  4408. DHCPv4 will always generate DDNS update requests if the client request
  4409. only contains the Host Name option. In addition it will include an FQDN
  4410. option in the response to the client with the FQDN N-S-O flags set to
  4411. 0-1-0 respectively. The domain name portion of the FQDN option will be
  4412. the name submitted to D2 in the DDNS update request.
  4413. </para>
  4414. </section>
  4415. <section id="dhcpv4-fqdn-name-generation">
  4416. <title>DHCPv4 name generation for DDNS update requests</title>
  4417. Each NameChangeRequest must of course include the fully qualified domain
  4418. name whose DNS entries are to be affected. DHCPv4 can be configured to
  4419. supply a portion or all of that name based upon what it receives from
  4420. the client in the DHCP REQUEST.
  4421. <para>
  4422. The rules for determining the FQDN option are as follows:
  4423. <orderedlist>
  4424. <listitem><para>
  4425. If configured to do, so ignore the REQUEST contents and generate a
  4426. FQDN using a configurable prefix and suffix.
  4427. </para></listitem>
  4428. <listitem><para>
  4429. If the REQUEST contains the client FQDN option, the candidate
  4430. name is taken from there, otherwise it is taken from the Host Name option.
  4431. The candiate name may then be modified:
  4432. <orderedlist>
  4433. <listitem><para>
  4434. If the candidate name is a fully qualified domain name, use it.
  4435. </para></listitem>
  4436. <listitem><para>
  4437. If the candidate name is a partial (i.e. unqualified) name then
  4438. add a configurable suffix to the name and use the result as the FQDN.
  4439. </para></listitem>
  4440. <listitem><para>
  4441. If the candidate name is a empty, generate a FQDN using a
  4442. configurable prefix and suffix.
  4443. </para></listitem>
  4444. </orderedlist>
  4445. </para></listitem>
  4446. </orderedlist>
  4447. To instruct DHCPv4 to always generate the FQDN for a client, set the
  4448. parameter "replace-client-name" to true as follows:
  4449. </para>
  4450. <screen>
  4451. &gt; <userinput>config set Dhcp4/dhcp-ddns/replace-client-name true</userinput>
  4452. &gt; <userinput>config commit</userinput>
  4453. </screen>
  4454. <para>
  4455. The prefix used in the generation of a FQDN is specified by the
  4456. "generated-prefix" parameter. The default value is "myhost". To alter
  4457. its value simply set it to the desired string:
  4458. </para>
  4459. <screen>
  4460. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "another.host"</userinput>
  4461. &gt; <userinput>config commit</userinput>
  4462. </screen>
  4463. <para>
  4464. The suffix used when generating a FQDN or when qualifying a partial
  4465. name is specified by the "qualifying-suffix" parameter. The default
  4466. value is "example.com". To alter its value simply set it to the desired
  4467. string:
  4468. </para>
  4469. <screen>
  4470. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "our.net"</userinput>
  4471. &gt; <userinput>config commit</userinput>
  4472. </screen>
  4473. </section>
  4474. <para>
  4475. When generating a name, DHCPv4 will construct name of the format:
  4476. </para>
  4477. <para>
  4478. [generated-prefix]-[address-text].[qualifying-suffix].
  4479. </para>
  4480. <para>
  4481. where address-text is simply the lease IP address converted to a
  4482. hyphenated string. For example, if lease address is 172.16.1.10 and
  4483. assuming default values for generated-prefix and qualifying-suffix, the
  4484. generated FQDN would be:
  4485. </para>
  4486. <para>
  4487. myhost-172-16-1-10.example.com.
  4488. </para>
  4489. </section>
  4490. </section> <!-- end of configuring DHCPv4 server section with many subsections -->
  4491. <section id="dhcp4-serverid">
  4492. <title>Server Identifier in DHCPv4</title>
  4493. <para>
  4494. The DHCPv4 protocol uses a "server identifier" for clients to be able
  4495. to discriminate between several servers present on the same link: this
  4496. value is an IPv4 address of the server. The server chooses the IPv4 address
  4497. of the interface on which the message from the client (or relay) has been
  4498. received. A single server instance will use multiple server identifiers
  4499. if it is receiving queries on multiple interfaces.
  4500. </para>
  4501. <para>
  4502. Currently there is no mechanism to override the default server identifiers
  4503. by an administrator. In the future, the configuration mechanism will be used
  4504. to specify the custom server identifier.
  4505. </para>
  4506. </section>
  4507. <section id="dhcp4-next-server">
  4508. <title>Next server (siaddr)</title>
  4509. <para>In some cases, clients want to obtain configuration from the TFTP server.
  4510. Although there is a dedicated option for it, some devices may use siaddr field
  4511. in the DHCPv4 packet for that purpose. That specific field can be configured
  4512. using next-server directive. It is possible to define it in global scope or
  4513. for a given subnet only. If both are defined, subnet value takes precedence.
  4514. The value in subnet can be set to 0.0.0.0, which means that next-server should
  4515. not be sent. It may also be set to empty string, which means the same as if
  4516. it was not defined at all - use global value.
  4517. </para>
  4518. <screen>
  4519. &gt; <userinput>config add Dhcp4/next-server</userinput>
  4520. &gt; <userinput>config set Dhcp4/next-server "192.0.2.123"</userinput>
  4521. &gt; <userinput>config commit</userinput>
  4522. <userinput></userinput>
  4523. &gt; <userinput>config add Dhcp4/subnet[0]/next-server</userinput>
  4524. &gt; <userinput>config set Dhcp4/subnet[0]/next-server "192.0.2.234"</userinput>
  4525. &gt; <userinput>config commit</userinput>
  4526. </screen>
  4527. </section>
  4528. <section id="dhcp4-echo-client-id">
  4529. <title>Echoing client-id (RFC6842)</title>
  4530. <para>Original DHCPv4 spec (RFC2131) states that the DHCPv4
  4531. server must not send back client-id options when responding to
  4532. clients. However, in some cases that confused clients that did
  4533. not have MAC address or client-id. See RFC6842 for details. That
  4534. behavior has changed with the publication of RFC6842 which
  4535. updated RFC2131. That update now states that the server must
  4536. send client-id if client sent it. That is the default behaviour
  4537. that Kea offers. However, in some cases older devices that do
  4538. not support RFC6842 may refuse to accept responses that include
  4539. client-id option. To enable backward compatibility, an optional
  4540. configuration parameter has been introduced. To configure it,
  4541. use the following commands:</para>
  4542. <screen>
  4543. &gt; <userinput>config add Dhcp4/echo-client-id</userinput>
  4544. &gt; <userinput>config set Dhcp4/echo-client-id False</userinput>
  4545. &gt; <userinput>config commit</userinput>
  4546. </screen>
  4547. </section>
  4548. <section id="dhcp4-subnet-selection">
  4549. <title>How DHCPv4 server selects subnet for a client</title>
  4550. <para>
  4551. The DHCPv4 server differentiates between the directly connected clients,
  4552. clients trying to renew leases and clients sending their messages through
  4553. relays. For the directly connected clients the server will check the
  4554. configuration of the interface on which the message has been received, and
  4555. if the server configuration doesn't match any configured subnet the
  4556. message is discarded.</para>
  4557. <para>Assuming that the server's interface is configured with the 192.0.2.3
  4558. IPv4 address, the server will only process messages received through
  4559. this interface from the directly connected client, if there is a subnet
  4560. configured, to which this IPv4 address belongs, e.g. 192.0.2.0/24.
  4561. The server will use this subnet to assign IPv4 address for the client.
  4562. </para>
  4563. <para>
  4564. The rule above does not apply when the client unicasts its message, i.e.
  4565. is trying to renew its lease. Such message is accepted through any
  4566. interface. The renewing client sets ciaddr to the currently used IPv4
  4567. address. The server uses this address to select the subnet for the client
  4568. (in particular, to extend the lease using this address).
  4569. </para>
  4570. <para>
  4571. If the message is relayed it is accepted through any interface. The giaddr
  4572. set by the relay agent is used to select the subnet for the client.
  4573. </para>
  4574. <para>
  4575. It is also possible to specify a relay IPv4 address for a given subnet. It
  4576. can be used to match incoming packets into a subnet in uncommon configurations,
  4577. e.g. shared subnets. See <xref linkend="dhcp4-relay-override"/> for details.
  4578. </para>
  4579. <note>
  4580. <para>The subnet selection mechanism described in this section is based
  4581. on the assumption that client classification is not used. The classification
  4582. mechanism alters the way in which subnet is selected for the client,
  4583. depending on the clasess that the client belongs to.</para>
  4584. </note>
  4585. </section>
  4586. <section id="dhcp4-relay-override">
  4587. <title>Using specific relay agent for a subnet</title>
  4588. <para>
  4589. The relay has to have an interface connected to the link on which
  4590. the clients are being configured. Typically the relay has an IPv4
  4591. address configured on that interface that belongs to the subnet that
  4592. the server will assign addresses from. In such typical case, the
  4593. server is able to use IPv4 address inserted by the relay (in GIADDR
  4594. field of the DHCPv4 packet) to select appropriate subnet.
  4595. </para>
  4596. <para>
  4597. However, that is not always the case. In certain uncommon, but
  4598. valid deployments, the relay address may not match the subnet. This
  4599. usually means that there is more than one subnet allocated for a given
  4600. link. Two most common examples where this is the case are long lasting
  4601. network renumbering (where both old and new address space is still being
  4602. used) and a cable network. In a cable network both cable modems and the
  4603. devices behind them are physically connected to the same link, yet
  4604. they use distinct addressing. In such case, the DHCPv4 server needs
  4605. additional information (IPv4 address of the relay) to properly select
  4606. an appropriate subnet.
  4607. </para>
  4608. <para>
  4609. The following example assumes that there is a subnet 192.0.2.0/24
  4610. that is accessible via relay that uses 10.0.0.1 as its IPv4 address.
  4611. The server will be able to select this subnet for any incoming packets
  4612. that came from a relay that has an address in 192.0.2.0/24 subnet.
  4613. It will also select that subnet for a relay with address 10.0.0.1.
  4614. <screen>
  4615. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4616. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  4617. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  4618. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.0.0.1"</userinput>
  4619. &gt; <userinput>config commit</userinput></screen>
  4620. </para>
  4621. </section>
  4622. <section id="dhcp4-srv-example-client-class-relay">
  4623. <title>Segregating IPv4 clients in a cable network</title>
  4624. <para>
  4625. In certain cases, it is useful to mix relay address information,
  4626. introduced in <xref linkend="dhcp4-relay-override"/> with client
  4627. classification, explained in <xref linkend="dhcp4-subnet-class"/>.
  4628. One specific example is cable network, where typically modems
  4629. get addresses from a different subnet than all devices connected
  4630. behind them.
  4631. </para>
  4632. <para>
  4633. Let's assume that there is one CMTS (Cable Modem Termination System)
  4634. with one CM MAC (a physical link that modems are connected to).
  4635. We want the modems to get addresses from the 10.1.1.0/24 subnet, while
  4636. everything connected behind modems should get addresses from another
  4637. subnet (192.0.2.0/24). The CMTS that acts as a relay an uses address
  4638. 10.1.1.1. The following configuration can serve that configuration:
  4639. <screen>
  4640. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4641. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "10.1.1.0/24"</userinput>
  4642. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "10.1.1.2 - 10.1.1.20" ]</userinput>
  4643. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "docsis3.0"</userinput>
  4644. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.1.1.1"</userinput>
  4645. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4646. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.2.0/24"</userinput>
  4647. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  4648. &gt; <userinput>config set Dhcp4/subnet4[1]/relay/ip-address "10.1.1.1"</userinput>
  4649. &gt; <userinput>config commit</userinput></screen>
  4650. </para>
  4651. </section>
  4652. <section id="dhcp4-std">
  4653. <title>Supported Standards</title>
  4654. <para>The following standards and draft standards are currently
  4655. supported:</para>
  4656. <itemizedlist>
  4657. <listitem>
  4658. <simpara><ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>: Supported messages are DISCOVER, OFFER,
  4659. REQUEST, RELEASE, ACK, and NAK.</simpara>
  4660. </listitem>
  4661. <listitem>
  4662. <simpara><ulink url="http://tools.ietf.org/html/rfc2132">RFC 2132</ulink>:
  4663. Supported options are: PAD (0),
  4664. END(255), Message Type(53), DHCP Server Identifier (54),
  4665. Domain Name (15), DNS Servers (6), IP Address Lease Time
  4666. (51), Subnet mask (1), and Routers (3).</simpara>
  4667. </listitem>
  4668. <listitem>
  4669. <simpara><ulink url="http://tools.ietf.org/html/rfc3046">RFC 3046</ulink>:
  4670. Relay Agent Information option is supported.</simpara>
  4671. </listitem>
  4672. <listitem>
  4673. <simpara><ulink url="http://tools.ietf.org/html/rfc3925">RFC 3925</ulink>:
  4674. Vendor-Identifying Vendor Class and Vendor-Identifying Vendor-Specific
  4675. Information option are supported.</simpara>
  4676. </listitem>
  4677. <listitem>
  4678. <simpara><ulink url="http://tools.ietf.org/html/rfc6842">RFC 6842</ulink>:
  4679. Server by default sends back client-id option. That capability may be
  4680. disabled. See <xref linkend="dhcp4-echo-client-id"/> for details.
  4681. </simpara>
  4682. </listitem>
  4683. </itemizedlist>
  4684. </section>
  4685. <section id="dhcp4-limit">
  4686. <title>DHCPv4 Server Limitations</title>
  4687. <para>These are the current limitations of the DHCPv4 server
  4688. software. Most of them are reflections of the current stage of
  4689. development and should be treated as <quote>not implemented
  4690. yet</quote>, rather than actual limitations.</para>
  4691. <itemizedlist>
  4692. <listitem> <!-- see tickets #3234, #3281 -->
  4693. <simpara>
  4694. Removal of a subnet during server reconfiguration may cause renumbering
  4695. of auto-generated subnet identifiers, as described in section
  4696. <xref linkend="ipv4-subnet-id"/>.
  4697. </simpara>
  4698. </listitem>
  4699. <listitem>
  4700. <simpara>
  4701. BOOTP (<ulink url="http://tools.ietf.org/html/rfc951">RFC 951</ulink>)
  4702. is not supported.
  4703. </simpara>
  4704. </listitem>
  4705. <listitem>
  4706. <simpara>Raw sockets operation is working on Linux
  4707. only. See <xref linkend="iface-detect"/> for details.</simpara>
  4708. </listitem>
  4709. <listitem>
  4710. <simpara>The DHCPv4 server does not verify that
  4711. assigned address is unused. According to <ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>, the
  4712. allocating server should verify that address is not used by
  4713. sending ICMP echo request.</simpara>
  4714. </listitem>
  4715. <listitem>
  4716. <simpara>Address duplication report (DECLINE) is not supported yet.</simpara>
  4717. </listitem>
  4718. <listitem>
  4719. <simpara>
  4720. The server doesn't act upon expired leases. In particular,
  4721. when a lease expires, the server doesn't request the removal
  4722. of the DNS records associated with it.
  4723. </simpara>
  4724. </listitem>
  4725. </itemizedlist>
  4726. </section>
  4727. <!--
  4728. <section id="dhcp4-srv-examples">
  4729. <title>Kea DHCPv4 server examples</title>
  4730. <para>
  4731. This section provides easy to use example. Each example can be read
  4732. separately. It is not intended to be read sequentially as there will
  4733. be many repetitions between examples. They are expected to serve as
  4734. easy to use copy-paste solutions to many common deployments.
  4735. </para>
  4736. @todo: add simple configuration for direct clients
  4737. @todo: add configuration for relayed clients
  4738. @todo: add client classification example
  4739. </section> -->
  4740. </chapter>
  4741. <chapter id="dhcp6">
  4742. <title>The DHCPv6 Server</title>
  4743. <section id="dhcp6-start-stop">
  4744. <title>Starting and Stopping the DHCPv6 Server</title>
  4745. <para>
  4746. <command>b10-dhcp6</command> is the BIND 10 DHCPv6 server and, like other
  4747. parts of BIND 10, is configured through the <command>bindctl</command>
  4748. program.
  4749. </para>
  4750. <para>
  4751. After starting BIND 10 and starting <command>bindctl</command>, the first step
  4752. in configuring the server is to add <command>b10-dhcp6</command> to the list of running BIND 10 services.
  4753. <screen>
  4754. &gt; <userinput>config add Init/components b10-dhcp6</userinput>
  4755. &gt; <userinput>config set Init/components/b10-dhcp6/kind dispensable</userinput>
  4756. &gt; <userinput>config commit</userinput>
  4757. </screen>
  4758. </para>
  4759. <para>
  4760. To remove <command>b10-dhcp6</command> from the set of running services,
  4761. the <command>b10-dhcp6</command> is removed from list of Init components:
  4762. <screen>
  4763. &gt; <userinput>config remove Init/components b10-dhcp6</userinput>
  4764. &gt; <userinput>config commit</userinput>
  4765. </screen>
  4766. </para>
  4767. <para>
  4768. Note that the server was only removed from the list, so BIND10 will not
  4769. restart it, but the server itself is still running. Hence it is usually
  4770. desired to stop it:
  4771. <screen>
  4772. &gt; <userinput>Dhcp6 shutdown</userinput>
  4773. </screen>
  4774. </para>
  4775. <para>
  4776. During start-up the server will detect available network interfaces
  4777. and will attempt to open UDP sockets on all interfaces that
  4778. are up, running, are not loopback, are multicast-capable, and
  4779. have IPv6 address assigned. It will then listen to incoming traffic.
  4780. </para>
  4781. </section>
  4782. <section id="dhcp6-configuration">
  4783. <title>DHCPv6 Server Configuration</title>
  4784. <para>
  4785. Once the server has been started, it can be configured. To view the
  4786. current configuration, use the following command in <command>bindctl</command>:
  4787. <screen>&gt; <userinput>config show Dhcp6</userinput></screen>
  4788. When starting the Dhcp6 daemon for the first time, the default configuration
  4789. will be available. It will look similar to this:
  4790. <screen>
  4791. &gt; <userinput>config show Dhcp6</userinput>
  4792. Dhcp6/hooks-libraries [] list (default)
  4793. Dhcp6/interfaces/ list (default)
  4794. Dhcp6/renew-timer 1000 integer (default)
  4795. Dhcp6/rebind-timer 2000 integer (default)
  4796. Dhcp6/preferred-lifetime 3000 integer (default)
  4797. Dhcp6/valid-lifetime 4000 integer (default)
  4798. Dhcp6/option-def [] list (default)
  4799. Dhcp6/option-data [] list (default)
  4800. Dhcp6/lease-database/type "" string (default)
  4801. Dhcp6/lease-database/name "" string (default)
  4802. Dhcp6/lease-database/user "" string (default)
  4803. Dhcp6/lease-database/host "" string (default)
  4804. Dhcp6/lease-database/password "" string (default)
  4805. Dhcp6/subnet6/ list
  4806. Dhcp6/dhcp-ddns/enable-updates true boolean
  4807. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  4808. Dhcp6/dhcp-ddns/server-port 53001 integer
  4809. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  4810. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  4811. Dhcp6/dhcp-ddns/always-include-fqdn false boolean
  4812. Dhcp6/dhcp-ddns/override-no-update false boolean
  4813. Dhcp6/dhcp-ddns/override-client-update false boolean
  4814. Dhcp6/dhcp-ddns/replace-client-name false boolean
  4815. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  4816. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  4817. </screen>
  4818. </para>
  4819. <para>
  4820. To change one of the parameters, simply follow
  4821. the usual <command>bindctl</command> procedure. For example, to make the
  4822. leases longer, change their valid-lifetime parameter:
  4823. <screen>
  4824. &gt; <userinput>config set Dhcp6/valid-lifetime 7200</userinput>
  4825. &gt; <userinput>config commit</userinput></screen>
  4826. Most Dhcp6 parameters are of global scope
  4827. and apply to all defined subnets, unless they are overridden on a
  4828. per-subnet basis.
  4829. </para>
  4830. <note>
  4831. <para>
  4832. With this version of BIND 10, there are a number of known limitations
  4833. and problems in the DHCPv6 server. See <xref linkend="dhcp6-limit"/>.
  4834. </para>
  4835. </note>
  4836. <section>
  4837. <title>Default storage for leases</title>
  4838. <para>
  4839. The server is able to store lease data in different repositories. Larger deployments
  4840. may elect to store leases in a database.
  4841. <xref linkend="database-configuration6"/> describes one way to do it.
  4842. By default, the server will use a CSV file rather than a database to store
  4843. lease information. One of the advantages of using a file is that it eliminates
  4844. dependency on third party database software.
  4845. </para>
  4846. <para>
  4847. The configuration of the file backend (Memfile)
  4848. is controlled through the Dhcp6/lease-database parameters. When default
  4849. parameters are left, the Memfile backend will write leases to a disk in the
  4850. [bind10-install-dir]/var/bind10/kea-leases6.csv.
  4851. </para>
  4852. <para>
  4853. It is possible to alter the default location of the lease file. The following
  4854. configuration:
  4855. <screen>
  4856. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  4857. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  4858. &gt; <userinput>config set Dhcp4/lease-database/leasefile "/tmp/kea-leases6.csv"</userinput>
  4859. &gt; <userinput>config commit</userinput>
  4860. </screen>
  4861. will change the default location of the lease file to /tmp/kea-leases6.csv.
  4862. </para>
  4863. <para>
  4864. The "persist" parameter controls whether the leases are written to disk.
  4865. It is strongly recommended that this parameter is set to "true" at all times
  4866. during the normal operation of the server.
  4867. </para>
  4868. </section>
  4869. <section id="database-configuration6">
  4870. <title>Database Configuration</title>
  4871. <para>
  4872. All leases issued by the server are stored in the lease database. Currently
  4873. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  4874. <footnote>
  4875. <para>
  4876. The server comes with an in-memory database ("memfile") configured as the default
  4877. database. This is used for internal testing and is not supported. In addition,
  4878. it does not store lease information on disk: lease information will be lost if the
  4879. server is restarted.
  4880. </para>
  4881. </footnote>, and so the server must be configured to
  4882. access the correct database with the appropriate credentials.
  4883. </para>
  4884. <note>
  4885. <para>
  4886. Database access information must be configured for the DHCPv6 server, even if
  4887. it has already been configured for the DHCPv4 server. The servers store their
  4888. information independently, so each server can use a separate
  4889. database or both servers can use the same database.
  4890. </para>
  4891. </note>
  4892. <para>
  4893. Database configuration is controlled through the Dhcp6/lease-database parameters.
  4894. The type of the database must be set to "mysql", "postgresql" or "memfile":
  4895. <screen>
  4896. &gt; <userinput>config set Dhcp6/lease-database/type "mysql"</userinput>
  4897. </screen>
  4898. Next, the name of the database is to hold the leases must be set: this is the
  4899. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  4900. or <xref linkend="dhcp-pgsql-database-create"/>).
  4901. <screen>
  4902. &gt; <userinput>config set Dhcp6/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  4903. </screen>
  4904. If the database is located on a different system to the DHCPv6 server, the
  4905. database host name must also be specified (although note that this configuration
  4906. may have a severe impact on server performance):
  4907. <screen>
  4908. &gt; <userinput>config set Dhcp6/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  4909. </screen>
  4910. The usual state of affairs will be to have the database on the same machine as the
  4911. DHCPv6 server. In this case, set the value to the empty string (this is the default):
  4912. <screen>
  4913. &gt; <userinput>config set Dhcp6/lease-database/host ""</userinput>
  4914. </screen>
  4915. </para>
  4916. <para>
  4917. Finally, the credentials of the account under which the server will access the database
  4918. should be set:
  4919. <screen>
  4920. &gt; <userinput>config set Dhcp6/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  4921. &gt; <userinput>config set Dhcp6/lease-database/password "<replaceable>password</replaceable>"</userinput>
  4922. </screen>
  4923. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  4924. </para>
  4925. <note>
  4926. <para>The password is echoed when entered and is stored in clear text in the BIND 10 configuration
  4927. database. Improved password security will be added in a future version of BIND 10 DHCP</para>
  4928. </note>
  4929. </section>
  4930. <section id="dhcp6-interface-selection">
  4931. <title>Interface selection</title>
  4932. <para>
  4933. When DHCPv6 server starts up, by default it will listen to the DHCP
  4934. traffic and respond to it on all interfaces detected during startup.
  4935. However, in many cases it is desired to configure the server to listen and
  4936. respond on selected interfaces only. The sample commands in this section
  4937. show how to make interface selection using bindctl.
  4938. </para>
  4939. <para>
  4940. The default configuration can be presented with the following command:
  4941. <screen>
  4942. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  4943. <userinput>Dhcp6/interfaces[0] "*" string</userinput></screen>
  4944. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  4945. </para>
  4946. <para>
  4947. In order to override the default configuration, the existing entry can be replaced
  4948. with the actual interface name:
  4949. <screen>
  4950. &gt; <userinput>config set Dhcp6/interfaces[0] eth1</userinput>
  4951. &gt; <userinput>config commit</userinput></screen>
  4952. Other interface names can be added on one-by-one basis:
  4953. <screen>
  4954. &gt; <userinput>config add Dhcp6/interfaces eth2</userinput>
  4955. &gt; <userinput>config commit</userinput></screen>
  4956. Configuration will now contain two interfaces which can be presented as follows:
  4957. <screen>
  4958. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  4959. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  4960. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput></screen>
  4961. When configuration gets committed, the server will start to listen on
  4962. eth1 and eth2 interfaces only.
  4963. </para>
  4964. <para>
  4965. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  4966. interface names:
  4967. <screen>
  4968. &gt; <userinput>config add Dhcp6/interfaces *</userinput>
  4969. &gt; <userinput>config commit</userinput></screen>
  4970. This will result in the following configuration:
  4971. <screen>
  4972. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  4973. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  4974. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput>
  4975. <userinput>Dhcp6/interfaces[2] "*" string</userinput></screen>
  4976. The presence of the wildcard name implies that server will listen on all interfaces.
  4977. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  4978. <screen>
  4979. &gt; <userinput>config remove Dhcp6/interfaces[2]</userinput>
  4980. &gt; <userinput>config commit</userinput></screen>
  4981. </para>
  4982. </section>
  4983. <section id="ipv6-subnet-id">
  4984. <title>IPv6 Subnet Identifier</title>
  4985. <para>
  4986. Subnet identifier is a unique number associated with a particular subnet.
  4987. In principle, it is used to associate clients' leases with respective subnets.
  4988. When subnet identifier is not specified for a subnet being configured, it will
  4989. be automatically assigned by the configuration mechanism. The identifiers
  4990. are assigned from 1 and are monotonically increased for each subsequent
  4991. subnet: 1, 2, 3 ....
  4992. </para>
  4993. <para>
  4994. If there are multiple subnets configured with auto-generated identifiers and
  4995. one of them is removed, the subnet identifiers may be renumbered. For example:
  4996. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  4997. identifier that the 3rd subnet had before removal. As a result, the leases
  4998. stored in the lease database for subnet 3 are now associated with the
  4999. subnet 4, which may have unexpected consequences. In the future it is planned
  5000. to implement the mechanism to preserve auto-generated subnet ids upon removal
  5001. of one of the subnets. Currently, the only remedy for this issue is to
  5002. manually specify the unique subnet identifier for each subnet.
  5003. </para>
  5004. <para>
  5005. The following configuration:
  5006. <screen>
  5007. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5008. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  5009. &gt; <userinput>config set Dhcp6/subnet6[0]/id 1024</userinput>
  5010. &gt; <userinput>config commit</userinput>
  5011. </screen>
  5012. will assign the arbitrary subnet identifier to the newly configured subnet.
  5013. This identifier will not change for this subnet until "id" parameter is
  5014. removed or set to 0. The value of 0 forces auto-generation of subnet
  5015. identifier.
  5016. </para>
  5017. </section>
  5018. <section id="dhcp6-unicast">
  5019. <title>Unicast traffic support</title>
  5020. <para>
  5021. When DHCPv6 server starts up, by default it listens to the DHCP traffic
  5022. sent to multicast address ff02::1:2 on each interface that it is
  5023. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  5024. In some cases it is useful to configure a server to handle incoming
  5025. traffic sent to the global unicast addresses as well. The most common
  5026. reason for that is to have relays send their traffic to the server
  5027. directly. To configure server to listen on specific unicast address, a
  5028. notation to specify interfaces has been extended. Interface name can be
  5029. optionally followed by a slash, followed by global unicast address that
  5030. server should listen on. That will be done in addition to normal
  5031. link-local binding + listening on ff02::1:2 address. The sample commands
  5032. listed below show how to listen on 2001:db8::1 (a global address)
  5033. configured on the eth1 interface.
  5034. </para>
  5035. <para>
  5036. <screen>
  5037. &gt; <userinput>config set Dhcp6/interfaces[0] eth1/2001:db8::1</userinput>
  5038. &gt; <userinput>config commit</userinput></screen>
  5039. When configuration gets committed, the server will start to listen on
  5040. eth1 on link-local address, mutlicast group (ff02::1:2) and 2001:db8::1.
  5041. </para>
  5042. <para>
  5043. It is possible to mix interface names, wildcards and interface name/addresses
  5044. on the Dhcp6/interface list. It is not possible to specify more than one
  5045. unicast address on a given interface.
  5046. </para>
  5047. <para>
  5048. Care should be taken to specify proper unicast addresses. The server will
  5049. attempt to bind to those addresses specified, without any additional checks.
  5050. That approach is selected on purpose, so in the software can be used to
  5051. communicate over uncommon addresses if the administrator desires so.
  5052. </para>
  5053. </section>
  5054. <section id="dhcp6-address-config">
  5055. <title>Subnet and Address Pool</title>
  5056. <para>
  5057. The essential role of a DHCPv6 server is address assignment. For this,
  5058. the server has to be configured with at least one subnet and one pool of dynamic
  5059. addresses to be managed. For example, assume that the server
  5060. is connected to a network segment that uses the 2001:db8:1::/64
  5061. prefix. The Administrator of that network has decided that addresses from range
  5062. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  5063. server. Such a configuration can be achieved in the following way:
  5064. <screen>
  5065. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5066. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  5067. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  5068. &gt; <userinput>config commit</userinput></screen>
  5069. Note that subnet is defined as a simple string, but the pool parameter
  5070. is actually a list of pools: for this reason, the pool definition is
  5071. enclosed in square brackets, even though only one range of addresses
  5072. is specified.</para>
  5073. <para>It is possible to define more than one pool in a
  5074. subnet: continuing the previous example, further assume that
  5075. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  5076. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  5077. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  5078. formats are supported by Dhcp6 and can be mixed in the pool list.
  5079. For example, one could define the following pools:
  5080. <screen>
  5081. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]</userinput>
  5082. &gt; <userinput>config commit</userinput></screen>
  5083. The number of pools is not limited, but for performance reasons it is recommended to
  5084. use as few as possible.
  5085. </para>
  5086. <para>
  5087. The server may be configured to serve more than one subnet. To add a second subnet,
  5088. use a command similar to the following:
  5089. <screen>
  5090. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5091. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  5092. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  5093. &gt; <userinput>config commit</userinput></screen>
  5094. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  5095. previous example. The <command>config add Dhcp6/subnet6</command> command adds
  5096. another (second) subnet. It can be referred to as
  5097. <command>Dhcp6/subnet6[1]</command>. In this example, we allow server to
  5098. dynamically assign all addresses available in the whole subnet. Although
  5099. very wasteful, it is certainly a valid configuration to dedicate the
  5100. whole /48 subnet for that purpose.
  5101. </para>
  5102. <para>
  5103. When configuring a DHCPv6 server using prefix/length notation, please pay
  5104. attention to the boundary values. When specifying that the server should use
  5105. a given pool, it will be able to allocate also first (typically network
  5106. address) address from that pool. For example for pool 2001:db8::/64 the
  5107. 2001:db8:: address may be assigned as well. If you want to avoid this,
  5108. please use the "min-max" notation.
  5109. </para>
  5110. </section>
  5111. <section>
  5112. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  5113. <title>Subnet and Prefix Delegation Pools</title>
  5114. <para>
  5115. Subnets may also be configured to delegate address prefixes....
  5116. A subnet may have one or more prefix delegation pools. Each pool has
  5117. a prefixed address, which is specified as a prefix and a prefix length,
  5118. as well as a delegated prefix length. A sample configuration is shown
  5119. below:
  5120. <screen>
  5121. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5122. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  5123. &gt; <userinput>config show Dhcp6/subnet6[0]</userinput>
  5124. &gt; <userinput>config add Dhcp6/subnet6[0]/pd-pools</userinput>
  5125. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix "2001:db8:1::"</userinput>
  5126. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix-len 64</userinput>
  5127. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/delegated-len 96</userinput>
  5128. &gt; <userinput>config commit</userinput></screen>
  5129. </para>
  5130. </section>
  5131. <section id="dhcp6-std-options">
  5132. <title>Standard DHCPv6 options</title>
  5133. <para>
  5134. One of the major features of DHCPv6 server is to provide configuration
  5135. options to clients. Although there are several options that require
  5136. special behavior, most options are sent by the server only if the client
  5137. explicitly requested them. The following example shows how to
  5138. configure DNS servers, which is one of the most frequently used
  5139. options. Numbers in the first column are added for easier reference and
  5140. will not appear on screen. Options specified in this way are considered
  5141. global and apply to all configured subnets.
  5142. <screen>
  5143. 1. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5144. 2. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  5145. 3. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  5146. 4. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  5147. 5. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  5148. 6. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::cafe, 2001:db8::babe"</userinput>
  5149. 7. &gt; <userinput>config commit</userinput>
  5150. </screen>
  5151. </para>
  5152. <para>
  5153. The first line creates new entry in option-data table. It
  5154. contains information on all global options that the server is
  5155. supposed to configure in all subnets. The second line specifies
  5156. option name. For a complete list of currently supported names,
  5157. see <xref linkend="dhcp6-std-options-list"/>.
  5158. The third line specifies option code, which must match one of the
  5159. values from that
  5160. list. Line 4 specifies option space, which must always
  5161. be set to "dhcp6" as these are standard DHCPv6 options. For
  5162. other name spaces, including custom option spaces, see <xref
  5163. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  5164. which the data will be entered: use of CSV (comma
  5165. separated values) is recommended. The sixth line gives the actual value to
  5166. be sent to clients. Data is specified as a normal text, with
  5167. values separated by commas if more than one value is
  5168. allowed.
  5169. </para>
  5170. <para>
  5171. Options can also be configured as hexadecimal values. If csv-format is
  5172. set to false, the option data must be specified as a string of hexadecimal
  5173. numbers. The
  5174. following commands configure the DNS-SERVERS option for all
  5175. subnets with the following addresses: 2001:db8:1::cafe and
  5176. 2001:db8:1::babe.
  5177. <screen>
  5178. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5179. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  5180. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  5181. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  5182. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format false</userinput>
  5183. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001 0DB8 0001 0000 0000 0000</userinput>
  5184. <userinput>0000 CAFE 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  5185. &gt; <userinput>config commit</userinput>
  5186. </screen>
  5187. (The value for the setting of the "data" element is split across two
  5188. lines in this document for clarity: when entering the command, the
  5189. whole string should be entered on the same line.)
  5190. </para>
  5191. <para>
  5192. It is possible to override options on a per-subnet basis. If
  5193. clients connected to most of your subnets are expected to get the
  5194. same values of a given option, you should use global options: you
  5195. can then override specific values for a small number of subnets.
  5196. On the other hand, if you use different values in each subnet,
  5197. it does not make sense to specify global option values
  5198. (Dhcp6/option-data), rather you should set only subnet-specific values
  5199. (Dhcp6/subnet[X]/option-data[Y]).
  5200. </para>
  5201. <para>
  5202. The following commands override the global
  5203. DNS servers option for a particular subnet, setting a single DNS
  5204. server with address 2001:db8:1::3.
  5205. <screen>
  5206. &gt; <userinput>config add Dhcp6/subnet6[0]/option-data</userinput>
  5207. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/name "dns-servers"</userinput>
  5208. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/code 23</userinput>
  5209. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/space "dhcp6"</userinput>
  5210. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/csv-format true</userinput>
  5211. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/data "2001:db8:1::3"</userinput>
  5212. &gt; <userinput>config commit</userinput></screen>
  5213. </para>
  5214. <note>
  5215. <para>
  5216. In future versions of BIND 10 DHCP, it will not be necessary to specify
  5217. option code, space and csv-format fields, as those fields will be set
  5218. automatically.
  5219. </para>
  5220. </note>
  5221. <para>
  5222. The currently supported standard DHCPv6 options are
  5223. listed in <xref linkend="dhcp6-std-options-list"/>.
  5224. The "Name" and "Code"
  5225. are the values that should be used as a name in the option-data
  5226. structures. "Type" designates the format of the data: the meanings of
  5227. the various types is given in <xref linkend="dhcp-types"/>.
  5228. </para>
  5229. <para>
  5230. Some options are designated as arrays, which means that more than one
  5231. value is allowed in such an option. For example the option dns-servers
  5232. allows the specification of more than one IPv6 address, so allowing
  5233. clients to obtain the the addresses of multiple DNS servers.
  5234. </para>
  5235. <!-- @todo: describe record types -->
  5236. <para>
  5237. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  5238. syntax to create custom option definitions (formats). It is generally not
  5239. allowed to create custom definitions for standard options, even if the
  5240. definition being created matches the actual option format defined in the
  5241. RFCs. There is an exception from this rule for standard options for which
  5242. Kea does not provide a definition yet. In order to use such options,
  5243. a server administrator must create a definition as described in
  5244. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  5245. definition should match the option format described in the relevant
  5246. RFC but configuration mechanism would allow any option format as it has
  5247. no means to validate it at the moment.
  5248. </para>
  5249. <para>
  5250. <table frame="all" id="dhcp6-std-options-list">
  5251. <title>List of standard DHCPv6 options</title>
  5252. <tgroup cols='4'>
  5253. <colspec colname='name'/>
  5254. <colspec colname='code'/>
  5255. <colspec colname='type'/>
  5256. <colspec colname='array'/>
  5257. <thead>
  5258. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  5259. </thead>
  5260. <tbody>
  5261. <!-- Our engine uses those options on its own, admin must not configure them on his own
  5262. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  5263. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  5264. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  5265. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  5266. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  5267. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  5268. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  5269. <!-- Our engine uses those options on its own, admin must not configure them on his own
  5270. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  5271. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  5272. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  5273. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  5274. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  5275. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  5276. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  5277. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  5278. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  5279. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  5280. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  5281. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  5282. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  5283. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5284. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5285. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  5286. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  5287. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  5288. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5289. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5290. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  5291. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  5292. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5293. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  5294. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  5295. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5296. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  5297. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  5298. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  5299. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  5300. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5301. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  5302. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  5303. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  5304. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  5305. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  5306. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  5307. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  5308. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  5309. </tbody>
  5310. </tgroup>
  5311. </table>
  5312. </para>
  5313. </section>
  5314. <section id="dhcp6-custom-options">
  5315. <title>Custom DHCPv6 options</title>
  5316. <para>It is also possible to define options other than the standard ones.
  5317. Assume that we want to define a new DHCPv6 option called "foo" which will have
  5318. code 100 and will convey a single unsigned 32 bit integer value. We can define
  5319. such an option by using the following commands:
  5320. <screen>
  5321. &gt; <userinput>config add Dhcp6/option-def</userinput>
  5322. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  5323. &gt; <userinput>config set Dhcp6/option-def[0]/code 100</userinput>
  5324. &gt; <userinput>config set Dhcp6/option-def[0]/type "uint32"</userinput>
  5325. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  5326. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  5327. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  5328. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  5329. &gt; <userinput>config commit</userinput></screen>
  5330. The "false" value of the "array" parameter determines that the option
  5331. does NOT comprise an array of "uint32" values but rather a single value.
  5332. Two other parameters have been left blank: "record-types" and "encapsulate".
  5333. The former specifies the comma separated list of option data fields if the
  5334. option comprises a record of data fields. The "record-fields" value should
  5335. be non-empty if the "type" is set to "record". Otherwise it must be left
  5336. blank. The latter parameter specifies the name of the option space being
  5337. encapsulated by the particular option. If the particular option does not
  5338. encapsulate any option space it should be left blank.
  5339. Note that the above set of comments define the format of the new option and do not
  5340. set its values.
  5341. </para>
  5342. <para>Once the new option format is defined, its value is set
  5343. in the same way as for a standard option. For example the following
  5344. commands set a global value that applies to all subnets.
  5345. <screen>
  5346. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5347. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  5348. &gt; <userinput>config set Dhcp6/option-data[0]/code 100</userinput>
  5349. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  5350. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  5351. &gt; <userinput>config set Dhcp6/option-data[0]/data "12345"</userinput>
  5352. &gt; <userinput>config commit</userinput></screen>
  5353. </para>
  5354. <para>New options can take more complex forms than simple use of
  5355. primitives (uint8, string, ipv6-address etc): it is possible to
  5356. define an option comprising a number of existing primitives.
  5357. </para>
  5358. <para>
  5359. Assume we want to define a new option that will consist of an IPv6
  5360. address, followed by an unsigned 16 bit integer, followed by a
  5361. boolean value, followed by a text string. Such an option could
  5362. be defined in the following way:
  5363. <screen>
  5364. &gt; <userinput>config add Dhcp6/option-def</userinput>
  5365. &gt; <userinput>config set Dhcp6/option-def[0]/name "bar"</userinput>
  5366. &gt; <userinput>config set Dhcp6/option-def[0]/code 101</userinput>
  5367. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  5368. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  5369. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  5370. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, boolean, string"</userinput>
  5371. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  5372. </screen>
  5373. The "type" is set to "record" to indicate that the option contains
  5374. multiple values of different types. These types are given as a comma-separated
  5375. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  5376. </para>
  5377. <para>
  5378. The values of the option are set as follows:
  5379. <screen>
  5380. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5381. &gt; <userinput>config set Dhcp6/option-data[0]/name "bar"</userinput>
  5382. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  5383. &gt; <userinput>config set Dhcp6/option-data[0]/code 101</userinput>
  5384. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  5385. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, false, Hello World"</userinput>
  5386. &gt; <userinput>config commit</userinput></screen>
  5387. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  5388. list of values. The values in the "data" must correspond to the types set in
  5389. the "record-types" field of the option definition.
  5390. </para>
  5391. <note>
  5392. <para>
  5393. It is recommended that boolean values are specified using "true" and "false"
  5394. strings. This helps to prevent errors when typing multiple comma separated
  5395. values, as it make it easier to identify the type of the value being typed,
  5396. and compare it with the order of data fields. Nevetheless, it is possible
  5397. to use integer values: "1" and "0", instead of "true" and "false"
  5398. accordingly. If other integer value is specified, the configuration is
  5399. rejected.
  5400. </para>
  5401. </note>
  5402. </section>
  5403. <section id="dhcp6-vendor-opts">
  5404. <title>DHCPv6 vendor specific options</title>
  5405. <para>
  5406. Currently there are three option spaces defined: dhcp4 (to be used
  5407. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  5408. vendor-opts-space, which is empty by default, but options can be
  5409. defined in it. Those options are called vendor-specific information
  5410. options. The following examples show how to define an option "foo"
  5411. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  5412. and a string. The "foo" option is conveyed in a vendor specific
  5413. information option. This option comprises a single uint32 value
  5414. that is set to "12345". The sub-option "foo" follows the data
  5415. field holding this value.
  5416. <screen>
  5417. &gt; <userinput>config add Dhcp6/option-def</userinput>
  5418. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  5419. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  5420. &gt; <userinput>config set Dhcp6/option-def[0]/space "vendor-opts-space"</userinput>
  5421. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  5422. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  5423. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, string"</userinput>
  5424. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulates ""</userinput>
  5425. &gt; <userinput>config commit</userinput>
  5426. </screen>
  5427. (Note that the option space is set to "vendor-opts-space".)
  5428. Once the option format is defined, the next step is to define actual values
  5429. for that option:
  5430. <screen>
  5431. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5432. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  5433. &gt; <userinput>config set Dhcp6/option-data[0]/space "vendor-opts-space"</userinput>
  5434. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  5435. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  5436. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, Hello World"</userinput>
  5437. &gt; <userinput>config commit</userinput></screen>
  5438. We should also define values for the vendor-opts, that will convey our option foo.
  5439. <screen>
  5440. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5441. &gt; <userinput>config set Dhcp6/option-data[1]/name "vendor-opts"</userinput>
  5442. &gt; <userinput>config set Dhcp6/option-data[1]/space "dhcp6"</userinput>
  5443. &gt; <userinput>config set Dhcp6/option-data[1]/code 17</userinput>
  5444. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  5445. &gt; <userinput>config set Dhcp6/option-data[1]/data "12345"</userinput>
  5446. &gt; <userinput>config commit</userinput></screen>
  5447. </para>
  5448. </section>
  5449. <section id="dhcp6-option-spaces">
  5450. <title>Nested DHCPv6 options (custom option spaces)</title>
  5451. <para>It is sometimes useful to define completely new option
  5452. spaces. This is useful if the user wants his new option to
  5453. convey sub-options that use separate numbering scheme, for
  5454. example sub-options with codes 1 and 2. Those option codes
  5455. conflict with standard DHCPv6 options, so a separate option
  5456. space must be defined.
  5457. </para>
  5458. <para>Note that it is not required to create new option space when
  5459. defining sub-options for a standard option because it is by
  5460. default created if the standard option is meant to convey
  5461. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  5462. </para>
  5463. <para>
  5464. Assume that we want to have a DHCPv6 option called "container"
  5465. with code 102 that conveys two sub-options with codes 1 and 2.
  5466. First we need to define the new sub-options:
  5467. <screen>
  5468. &gt; <userinput>config add Dhcp6/option-def</userinput>
  5469. &gt; <userinput>config set Dhcp6/option-def[0]/name "subopt1"</userinput>
  5470. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  5471. &gt; <userinput>config set Dhcp6/option-def[0]/space "isc"</userinput>
  5472. &gt; <userinput>config set Dhcp6/option-def[0]/type "ipv6-address"</userinput>
  5473. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  5474. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  5475. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  5476. &gt; <userinput>config commit</userinput>
  5477. &gt; <userinput></userinput>
  5478. &gt; <userinput>config add Dhcp6/option-def</userinput>
  5479. &gt; <userinput>config set Dhcp6/option-def[1]/name "subopt2"</userinput>
  5480. &gt; <userinput>config set Dhcp6/option-def[1]/code 2</userinput>
  5481. &gt; <userinput>config set Dhcp6/option-def[1]/space "isc"</userinput>
  5482. &gt; <userinput>config set Dhcp6/option-def[1]/type "string"</userinput>
  5483. &gt; <userinput>config set Dhcp6/option-def[1]/record-types ""</userinput>
  5484. &gt; <userinput>config set Dhcp6/option-def[1]/array false</userinput>
  5485. &gt; <userinput>config set Dhcp6/option-def[1]/encapsulate ""</userinput>
  5486. &gt; <userinput>config commit</userinput>
  5487. </screen>
  5488. Note that we have defined the options to belong to a new option space
  5489. (in this case, "isc").
  5490. </para>
  5491. <para>
  5492. The next step is to define a regular DHCPv6 option and specify that it
  5493. should include options from the isc option space:
  5494. <screen>
  5495. &gt; <userinput>config add Dhcp6/option-def</userinput>
  5496. &gt; <userinput>config set Dhcp6/option-def[2]/name "container"</userinput>
  5497. &gt; <userinput>config set Dhcp6/option-def[2]/code 102</userinput>
  5498. &gt; <userinput>config set Dhcp6/option-def[2]/space "dhcp6"</userinput>
  5499. &gt; <userinput>config set Dhcp6/option-def[2]/type "empty"</userinput>
  5500. &gt; <userinput>config set Dhcp6/option-def[2]/array false</userinput>
  5501. &gt; <userinput>config set Dhcp6/option-def[2]/record-types ""</userinput>
  5502. &gt; <userinput>config set Dhcp6/option-def[2]/encapsulate "isc"</userinput>
  5503. &gt; <userinput>config commit</userinput>
  5504. </screen>
  5505. The name of the option space in which the sub-options are defined
  5506. is set in the "encapsulate" field. The "type" field is set to "empty"
  5507. which imposes that this option does not carry any data other than
  5508. sub-options.
  5509. </para>
  5510. <para>
  5511. Finally, we can set values for the new options:
  5512. <screen>
  5513. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5514. &gt; <userinput>config set Dhcp6/option-data[0]/name "subopt1"</userinput>
  5515. &gt; <userinput>config set Dhcp6/option-data[0]/space "isc"</userinput>
  5516. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  5517. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  5518. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::abcd"</userinput>
  5519. &gt; <userinput>config commit</userinput>
  5520. &gt; <userinput></userinput>
  5521. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5522. &gt; <userinput>config set Dhcp6/option-data[1]/name "subopt2"</userinput>
  5523. &gt; <userinput>config set Dhcp6/option-data[1]/space "isc"</userinput>
  5524. &gt; <userinput>config set Dhcp6/option-data[1]/code 2</userinput>
  5525. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  5526. &gt; <userinput>config set Dhcp6/option-data[1]/data "Hello world"</userinput>
  5527. &gt; <userinput>config commit</userinput>
  5528. &gt; <userinput></userinput>
  5529. &gt; <userinput>config add Dhcp6/option-data</userinput>
  5530. &gt; <userinput>config set Dhcp6/option-data[2]/name "container"</userinput>
  5531. &gt; <userinput>config set Dhcp6/option-data[2]/space "dhcp6"</userinput>
  5532. &gt; <userinput>config set Dhcp6/option-data[2]/code 102</userinput>
  5533. &gt; <userinput>config set Dhcp6/option-data[2]/csv-format true</userinput>
  5534. &gt; <userinput>config set Dhcp6/option-data[2]/data ""</userinput>
  5535. &gt; <userinput>config commit</userinput>
  5536. </screen>
  5537. Even though the "container" option does not carry any data except
  5538. sub-options, the "data" field must be explicitly set to an empty value.
  5539. This is required because in the current version of BIND 10 DHCP, the
  5540. default configuration values are not propagated to the configuration parsers:
  5541. if the "data" is not set the parser will assume that this
  5542. parameter is not specified and an error will be reported.
  5543. </para>
  5544. <para>Note that it is possible to create an option which carries some data
  5545. in addition to the sub-options defined in the encapsulated option space. For example,
  5546. if the "container" option from the previous example was required to carry an uint16
  5547. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  5548. the option definition. (Such an option would then have the following
  5549. data structure: DHCP header, uint16 value, sub-options.) The value specified
  5550. with the "data" parameter - which should be a valid integer enclosed in quotes,
  5551. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  5552. </para>
  5553. </section>
  5554. <section id="dhcp6-config-subnets">
  5555. <title>IPv6 Subnet Selection</title>
  5556. <para>
  5557. The DHCPv6 server may receive requests from local (connected to the
  5558. same subnet as the server) and remote (connecting via relays) clients.
  5559. As server may have many subnet configurations defined, it must select
  5560. appropriate subnet for a given request.
  5561. </para>
  5562. <para>
  5563. The server can not assume which of configured subnets are local. It is
  5564. possible in IPv4, where there is reasonable expectation that the
  5565. server will have a (global) IPv4 address configured on the interface,
  5566. and can use that information to detect whether a subnet is local or
  5567. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  5568. to operate with having link-local addresses only. Therefore an optional
  5569. &quot;interface&quot; parameter is available within a subnet definition
  5570. to designate that a given subnet is local, i.e. reachable directly over
  5571. specified interface. For example the server that is intended to serve
  5572. a local subnet over eth0 may be configured as follows:
  5573. <screen>
  5574. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5575. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  5576. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  5577. &gt; <userinput>config set Dhcp6/subnet6[1]/interface "eth0"</userinput>
  5578. &gt; <userinput>config commit</userinput>
  5579. </screen>
  5580. </para>
  5581. </section>
  5582. <section id="dhcp6-relays">
  5583. <title>DHCPv6 Relays</title>
  5584. <para>
  5585. A DHCPv6 server with multiple subnets defined must select the
  5586. appropriate subnet when it receives a request from client. For clients
  5587. connected via relays, two mechanisms are used:
  5588. </para>
  5589. <para>
  5590. The first uses the linkaddr field in the RELAY_FORW message. The name
  5591. of this field is somewhat misleading in that it does not contain a link-layer
  5592. address: instead, it holds an address (typically a global address) that is
  5593. used to identify a link. The DHCPv6 server checks if the address belongs
  5594. to a defined subnet and, if it does, that subnet is selected for the client's
  5595. request.
  5596. </para>
  5597. <para>
  5598. The second mechanism is based on interface-id options. While forwarding a client's
  5599. message, relays may insert an interface-id option into the message that
  5600. identifies the interface on the relay that received the message. (Some
  5601. relays allow configuration of that parameter, but it is sometimes
  5602. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  5603. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  5604. server can use this information to select the appropriate subnet.
  5605. The information is also returned to the relay which then knows the
  5606. interface to use to transmit the response to the client. In order for
  5607. this to work successfully, the relay interface IDs must be unique within
  5608. the network and the server configuration must match those values.
  5609. </para>
  5610. <para>
  5611. When configuring the DHCPv6 server, it should be noted that two
  5612. similarly-named parameters can be configured for a subnet:
  5613. <itemizedlist>
  5614. <listitem><simpara>
  5615. "interface" defines which local network interface can be used
  5616. to access a given subnet.
  5617. </simpara></listitem>
  5618. <listitem><simpara>
  5619. "interface-id" specifies the content of the interface-id option
  5620. used by relays to identify the interface on the relay to which
  5621. the response packet is sent.
  5622. </simpara></listitem>
  5623. </itemizedlist>
  5624. The two are mutually exclusive: a subnet cannot be both reachable locally
  5625. (direct traffic) and via relays (remote traffic). Specifying both is a
  5626. configuration error and the DHCPv6 server will refuse such a configuration.
  5627. </para>
  5628. <para>
  5629. To specify interface-id with value "vlan123", the following commands can
  5630. be used:
  5631. <screen>
  5632. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5633. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:beef::/48"</userinput>
  5634. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:beef::/48" ]</userinput>
  5635. &gt; <userinput>config set Dhcp6/subnet6[0]/interface-id "vland123"</userinput>
  5636. &gt; <userinput>config commit</userinput>
  5637. </screen>
  5638. </para>
  5639. </section>
  5640. <section id="dhcp6-client-classifier">
  5641. <title>Client Classification in DHCPv6</title>
  5642. <note>
  5643. <para>
  5644. DHCPv6 server has been extended to support limited client classification.
  5645. Although the current capability is modest, it is expected to be expanded
  5646. in the future. It is envisaged that the majority of client classification
  5647. extensions will be using hooks extensions.
  5648. </para>
  5649. </note>
  5650. <para>In certain cases it is useful to differentiate between different types
  5651. of clients and treat them differently. The process of doing classification
  5652. is conducted in two steps. The first step is to assess incoming packet and
  5653. assign it to zero or more classes. This classification is currently simple,
  5654. but is expected to grow in capability soon. Currently the server checks whether
  5655. incoming packet has vendor class option (16). If it has, content
  5656. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  5657. class. For example, modern cable modems will send this option with value
  5658. &quot;docsis3.0&quot; and as a result the packet will belong to class
  5659. &quot;VENDOR_CLASS_docsis3.0&quot;.
  5660. </para>
  5661. <para>It is envisaged that the client classification will be used for changing
  5662. behavior of almost any part of the DHCP engine processing, including assigning
  5663. leases from different pools, assigning different option (or different values of
  5664. the same options) etc. For now, there is only one mechanism that is taking
  5665. advantage of client classification: subnet selection.</para>
  5666. <para>
  5667. Kea can be instructed to limit access to given subnets based on class information.
  5668. This is particularly useful for cases where two types of devices share the
  5669. same link and are expected to be served from two different subnets. The
  5670. primary use case for such a scenario are cable networks. There are two
  5671. classes of devices: cable modem itself, which should be handled a lease
  5672. from subnet A and all other devices behind modems that should get a lease
  5673. from subnet B. That segregation is essential to prevent overly curious
  5674. users from playing with their cable modems. For details on how to set up
  5675. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  5676. </para>
  5677. </section>
  5678. <section id="dhcp6-subnet-class">
  5679. <title>Limiting access to IPv6 subnet to certain classes</title>
  5680. <para>
  5681. In certain cases it beneficial to restrict access to certains subnets
  5682. only to clients that belong to a given subnet. For details on client
  5683. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  5684. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  5685. Let's assume that the server is connected to a network segment that uses
  5686. the 2001:db8:1::/64 prefix. The Administrator of that network has
  5687. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  5688. going to be managed by the Dhcp6 server. Only clients belonging to the
  5689. eRouter1.0 client class are allowed to use that pool. Such a
  5690. configuration can be achieved in the following way:
  5691. <screen>
  5692. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5693. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  5694. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  5695. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "eRouter1.0"</userinput>
  5696. &gt; <userinput>config commit</userinput></screen>
  5697. </para>
  5698. <para>
  5699. Care should be taken with client classification as it is easy to prevent
  5700. clients that do not meet class criteria to be denied any service altogether.
  5701. </para>
  5702. </section>
  5703. <section id="dhcp6-ddns-config">
  5704. <title>Configuring DHCPv6 for DDNS</title>
  5705. <para>
  5706. As mentioned earlier, DHCPv6 can be configured to generate requests to
  5707. the DHCP-DDNS server (referred to here as the "D2" server) to update
  5708. DNS entries. These requests are known as NameChangeRequests or NCRs.
  5709. Each NCR contains the following information:
  5710. <orderedlist>
  5711. <listitem><para>
  5712. Whether it is a request to add (update) or remove DNS entries
  5713. </para></listitem>
  5714. <listitem><para>
  5715. Whether the change requests forward DNS updates (AAAA records), reverse
  5716. DNS updates (PTR records), or both.
  5717. </para></listitem>
  5718. <listitem><para>
  5719. The FQDN, lease address, and DHCID
  5720. </para></listitem>
  5721. </orderedlist>
  5722. The parameters controlling the generation of NCRs for submission to D2
  5723. are contained in the "dhcp-ddns" section of the DHCPv6 server
  5724. configuration. The default values for this section appears as follows:
  5725. <screen>
  5726. &gt; <userinput>config show Dhcp6/dhcp-ddns</userinput>
  5727. Dhcp6/dhcp-ddns/enable-updates true boolean
  5728. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  5729. Dhcp6/dhcp-ddns/server-port 53001 integer
  5730. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  5731. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  5732. Dhcp6/dhcp-ddns/override-no-update false boolean
  5733. Dhcp6/dhcp-ddns/override-client-update false boolean
  5734. Dhcp6/dhcp-ddns/replace-client-name false boolean
  5735. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  5736. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  5737. </screen>
  5738. </para>
  5739. <para>
  5740. The "enable-updates" parameter determines whether or not DHCPv6 will
  5741. generate NCRs. By default, this value is false hence DDNS updates are
  5742. disabled. To enable DDNS updates set this value to true as follows:
  5743. </para>
  5744. <screen>
  5745. &gt; <userinput>config set Dhcp6/dhcp-ddns/enable-updates true</userinput>
  5746. &gt; <userinput>config commit</userinput>
  5747. </screen>
  5748. <section id="dhcpv6-d2-io-config">
  5749. <title>DHCP-DDNS Server Connectivty</title>
  5750. In order for NCRs to reach D2, DHCPv6 must be able to communicate with it.
  5751. The following parameters are used to establish connectivty between DHCPv6
  5752. and D2.
  5753. <para>
  5754. The parameters, "server-ip" and "server-port", specify the address of the
  5755. D2 server. By default, D2 is assumed to running on the same machine as
  5756. DHCPv6, and the default values for these two parameters should be
  5757. sufficient. However, if D2 has been configured to listen on a different
  5758. address or port, these values must altered accordingly. For example, if
  5759. D2 has been configured to listen on 198.162.1.10 port 900, the following
  5760. commands would be required:
  5761. </para>
  5762. <screen>
  5763. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-ip "198.162.1.10"</userinput>
  5764. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-port 900</userinput>
  5765. &gt; <userinput>config commit</userinput>
  5766. </screen>
  5767. D2 can be configured to listen over IPv4 or IPv6, therefore server-ip
  5768. may be either an IPv4 or IPv6 address.
  5769. <para>
  5770. The socket protocol that DHCPv6 should use to communicate with D2 is
  5771. specified with the "ncr-protocol" parameter. Currently only UDP is
  5772. supported.
  5773. </para>
  5774. <para>
  5775. The internal format for DDNS update requests sent by DHCPv6 is specified
  5776. with the "ncr-format" parameter. Currently only JSON is supported.
  5777. </para>
  5778. </section>
  5779. <section id="dhcpv6-d2-rules-config">
  5780. <title>When does DHCPv6 generates DDNS request</title>
  5781. DHCPv6 follows the behavior prescribed for DHCP servers in RFC 4704.
  5782. It is important to keep in mind that DHCPv6 provides the initial decision
  5783. making of when and what to update and forwards that information to D2 in
  5784. the form of NCRs. Carrying out the actual DNS updates and dealing with
  5785. such things as conflict resolution are the purvue of D2 (<xref linkend="dhcp-ddns-server"/>).
  5786. <para>
  5787. This section describes when DHCPv6 will generate NCRs and the
  5788. configuration parameters that can be used to influence this decision.
  5789. It assumes that the "enable-updates" paramater is true.
  5790. </para>
  5791. <note>
  5792. <para>
  5793. Currently the interface between DHCPv6 and D2 only supports requests
  5794. which update DNS entries for a single IP address. If a lease grants
  5795. more than one address, DHCPv6 will create the DDNS update request for
  5796. only the first of these addresses. Support for multiple address
  5797. mappings may be provided in a future release.
  5798. </para>
  5799. </note>
  5800. <para>
  5801. In general, DHCPv6 will generate DDNS udpate requests when:
  5802. <orderedlist>
  5803. <listitem><para>
  5804. A new lease is granted in response to a DHCP REQUEST
  5805. </para></listitem>
  5806. <listitem><para>
  5807. An existing lease is renewed but the FQDN associated with it has
  5808. changed.
  5809. </para></listitem>
  5810. <listitem><para>
  5811. An existing lease is released in response to a DHCP RELEASE
  5812. </para></listitem>
  5813. </orderedlist>
  5814. In the second case, lease renewal, two DDNS requests will be issued: one
  5815. request to remove entries for the previous FQDN and a second request to
  5816. add entries for the new FQDN. In the last case, a lease release, a
  5817. single DDNS request to remove its entries will be made. The decision
  5818. making involved when granting a new lease is more involved and is
  5819. discussed next.
  5820. </para>
  5821. <para>
  5822. DHCPv6 will generate a DDNS update request only if the DHCP REQUEST
  5823. contains the FQDN option (code 39). By default the DHCPv6 server will
  5824. respect the FQDN N and S flags specified by the client as shown in the
  5825. following table:
  5826. </para>
  5827. <table id="fqdn-flag-table">
  5828. <title>Default FQDN Flag Behavior</title>
  5829. <tgroup cols='4' align='left'>
  5830. <colspec colname='cflags'/>
  5831. <colspec colname='meaning'/>
  5832. <colspec colname='response'/>
  5833. <colspec colname='sflags'/>
  5834. <thead>
  5835. <row>
  5836. <entry>Client Flags:N-S</entry>
  5837. <entry>Client Intent</entry>
  5838. <entry>Server Response</entry>
  5839. <entry>Server Flags:N-S-O</entry>
  5840. </row>
  5841. </thead>
  5842. <tbody>
  5843. <row>
  5844. <entry>0-0</entry>
  5845. <entry>
  5846. Client wants to do forward updates, server should do reverse updates
  5847. </entry>
  5848. <entry>Server generates reverse-only request</entry>
  5849. <entry>1-0-0</entry>
  5850. </row>
  5851. <row>
  5852. <entry>0-1</entry>
  5853. <entry>Server should do both forward and reverse updates</entry>
  5854. <entry>Server generates request to update both directions</entry>
  5855. <entry>0-1-0</entry>
  5856. </row>
  5857. <row>
  5858. <entry>1-0</entry>
  5859. <entry>Client wants no updates done</entry>
  5860. <entry>Server does not generate a request</entry>
  5861. <entry>1-0-0</entry>
  5862. </row>
  5863. </tbody>
  5864. </tgroup>
  5865. </table>
  5866. <para>
  5867. The first row in the table above represents "client delegation". Here
  5868. the DHCP client states that it intends to do the forward DNS updates and
  5869. the server should do the reverese updates. By default, DHCPv6 will honor
  5870. the client's wishes and generate a DDNS request to D2 to update only
  5871. reverse DNS data. The parameter, "override-client-update", can be used
  5872. to instruct the server to override client delegation requests. When
  5873. this parameter is true, DHCPv6 will disregard requests for client
  5874. delegation and generate a DDNS request to update both forward and
  5875. reverse DNS data. In this case, the N-S-O flags in the server's
  5876. response to the client will be 0-1-1 respectively.
  5877. </para>
  5878. <para>
  5879. (Note that the flag combination N=1, S=1 is prohibited according to
  5880. RFC 4702. If such a combination is received from the client, the packet
  5881. will be dropped by the DHCPv6 server.)
  5882. </para>
  5883. <para>
  5884. To override client delegation, issue the following commands:
  5885. </para>
  5886. <screen>
  5887. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-client-update true</userinput>
  5888. &gt; <userinput>config commit</userinput>
  5889. </screen>
  5890. <para>
  5891. The third row in the table above describes the case in which the client
  5892. requests that no DNS updates be done. The parameter, "override-no-update",
  5893. can be used to instruct the server to disregard the client's wishes. When
  5894. this parameter is true, DHCPv6 will generate DDNS udpate request to D2
  5895. even if the client requests no updates be done. The N-S-O flags in the
  5896. server's response to the client will be 0-1-1.
  5897. </para>
  5898. <para>
  5899. To override client delegation, issue the following commands:
  5900. </para>
  5901. <screen>
  5902. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-no-update true</userinput>
  5903. &gt; <userinput>config commit</userinput>
  5904. </screen>
  5905. </section>
  5906. <section id="dhcpv6-fqdn-name-generation">
  5907. <title>DHCPv6 name generation for DDNS update requests</title>
  5908. Each NameChangeRequest must of course include the fully qualified domain
  5909. name whose DNS entries are to be affected. DHCPv6 can be configured to
  5910. supply a portion or all of that name based upon what it receives from
  5911. the client in the DHCP REQUEST.
  5912. <para>
  5913. The rules for determining the FQDN option are as follows:
  5914. <orderedlist>
  5915. <listitem><para>
  5916. If configured to do so ignore the REQUEST contents and generate a
  5917. FQDN using a configurable prefix and suffix.
  5918. </para></listitem>
  5919. <listitem><para>
  5920. Otherwise, using is the domain name value from the client FQDN option as
  5921. the candidate name:
  5922. <orderedlist>
  5923. <listitem><para>
  5924. If the candidate name is a fully qualified domain name then use it.
  5925. </para></listitem>
  5926. <listitem><para>
  5927. If the candidate name is a partial (i.e. unqualified) name then
  5928. add a configurable suffix to the name and use the result as the FQDN.
  5929. </para></listitem>
  5930. <listitem><para>
  5931. If the candidate name is a empty then generate a FQDN using a
  5932. configurable prefix and suffix.
  5933. </para></listitem>
  5934. </orderedlist>
  5935. </para></listitem>
  5936. </orderedlist>
  5937. To instruct DHCPv6 to always generate a FQDN, set the parameter
  5938. "replace-client-name" to true:
  5939. </para>
  5940. <screen>
  5941. &gt; <userinput>config set Dhcp6/dhcp-ddns/replace-client-name true</userinput>
  5942. &gt; <userinput>config commit</userinput>
  5943. </screen>
  5944. <para>
  5945. The prefix used when generating a FQDN is specified by the
  5946. "generated-prefix" parameter. The default value is "myhost". To alter
  5947. its value, simply set it to the desired string:
  5948. </para>
  5949. <screen>
  5950. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "another.host"</userinput>
  5951. &gt; <userinput>config commit</userinput>
  5952. </screen>
  5953. <para>
  5954. The suffix used when generating a FQDN or when qualifying a partial
  5955. name is specified by the "qualifying-suffix" parameter. The default
  5956. value is "example.com". To alter its value simply set it to the desired
  5957. string:
  5958. </para>
  5959. <screen>
  5960. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "our.net"</userinput>
  5961. &gt; <userinput>config commit</userinput>
  5962. </screen>
  5963. </section>
  5964. <para>
  5965. When qualifying a partial name, DHCPv6 will construct a name with the
  5966. format:
  5967. </para>
  5968. <para>
  5969. [candidate-name].[qualifying-suffix].
  5970. </para>
  5971. <para>
  5972. where candidate-name is the partial name supplied in the REQUEST.
  5973. For example, if FQDN domain name value was "some-computer" and assuming
  5974. the default value for qualifying-suffix, the generated FQDN would be:
  5975. </para>
  5976. <para>
  5977. some-computer.example.com.
  5978. </para>
  5979. <para>
  5980. When generating a the entire name, DHCPv6 will construct name of the
  5981. format:
  5982. </para>
  5983. <para>
  5984. [generated-prefix]-[address-text].[qualifying-suffix].
  5985. </para>
  5986. <para>
  5987. where address-text is simply the lease IP address converted to a
  5988. hyphenated string. For example, if lease address is 3001:1::70E and
  5989. assuming default values for generated-prefix and qualifying-suffix, the
  5990. generated FQDN would be:
  5991. </para>
  5992. <para>
  5993. myhost-3001-1--70E.example.com.
  5994. </para>
  5995. </section>
  5996. </section>
  5997. <section id="dhcp6-serverid">
  5998. <title>Server Identifier in DHCPv6</title>
  5999. <para>The DHCPv6 protocol uses a "server identifier" (also known
  6000. as a DUID) for clients to be able to discriminate between several
  6001. servers present on the same link. There are several types of
  6002. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  6003. possible. This format consists of a link-layer (MAC) address and a
  6004. timestamp. When started for the first time, the DHCPv6 server will
  6005. automatically generate such a DUID and store the chosen value to
  6006. a file. That file is read by the server
  6007. and the contained value used whenever the server is subsequently started.
  6008. </para>
  6009. <para>
  6010. It is unlikely that this parameter should ever need to be changed.
  6011. However, if such a need arises, stop the server, edit the file and restart
  6012. the server. (The file is named b10-dhcp6-serverid and by default is
  6013. stored in the "var" subdirectory of the directory in which BIND 10 is installed.
  6014. This can be changed when BIND 10 is built by using "--localstatedir"
  6015. on the "configure" command line.) The file is a text file that contains
  6016. double digit hexadecimal values
  6017. separated by colons. This format is similar to typical MAC address
  6018. format. Spaces are ignored. No extra characters are allowed in this
  6019. file.
  6020. </para>
  6021. </section>
  6022. <section id="dhcp6-relay-override">
  6023. <title>Using specific relay agent for a subnet</title>
  6024. <para>
  6025. The relay has to have an interface connected to the link on which
  6026. the clients are being configured. Typically the relay has a global IPv6
  6027. address configured on that interface that belongs to the subnet that
  6028. the server will assign addresses from. In such typical case, the
  6029. server is able to use IPv6 address inserted by the relay (in link-addr
  6030. field in RELAY-FORW message) to select appropriate subnet.
  6031. </para>
  6032. <para>
  6033. However, that is not always the case. The relay
  6034. address may not match the subnet in certain deployments. This
  6035. usually means that there is more than one subnet allocated for a given
  6036. link. Two most common examples where this is the case are long lasting
  6037. network renumbering (where both old and new address space is still being
  6038. used) and a cable network. In a cable network both cable modems and the
  6039. devices behind them are physically connected to the same link, yet
  6040. they use distinct addressing. In such case, the DHCPv6 server needs
  6041. additional information (like the value of interface-id option or IPv6
  6042. address inserted in the link-addr field in RELAY-FORW message) to
  6043. properly select an appropriate subnet.
  6044. </para>
  6045. <para>
  6046. The following example assumes that there is a subnet 2001:db8:1::/64
  6047. that is accessible via relay that uses 3000::1 as its IPv6 address.
  6048. The server will be able to select this subnet for any incoming packets
  6049. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  6050. It will also select that subnet for a relay with address 3000::1.
  6051. <screen>
  6052. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  6053. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  6054. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::2 - 2001:db8:1::ffff" ]</userinput>
  6055. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  6056. &gt; <userinput>config commit</userinput></screen>
  6057. </para>
  6058. </section>
  6059. <section id="dhcp6-client-class-relay">
  6060. <title>Segregating IPv6 clients in a cable network</title>
  6061. <para>
  6062. In certain cases, it is useful to mix relay address information,
  6063. introduced in <xref linkend="dhcp6-relay-override"/> with client
  6064. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  6065. One specific example is cable network, where typically modems
  6066. get addresses from a different subnet than all devices connected
  6067. behind them.
  6068. </para>
  6069. <para>
  6070. Let's assume that there is one CMTS (Cable Modem Termination System)
  6071. with one CM MAC (a physical link that modems are connected to).
  6072. We want the modems to get addresses from the 3000::/64 subnet,
  6073. while everything connected behind modems should get addresses from
  6074. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  6075. an uses address 3000::1. The following configuration can serve
  6076. that configuration:
  6077. <screen>
  6078. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  6079. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "3000::/64"</userinput>
  6080. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "3000::2 - 3000::ffff" ]</userinput>
  6081. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "docsis3.0"</userinput>
  6082. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  6083. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  6084. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:1::/64"</userinput>
  6085. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff" ]</userinput>
  6086. &gt; <userinput>config set Dhcp6/subnet6[1]/relay/ip-address "3000::1"</userinput>
  6087. &gt; <userinput>config commit</userinput></screen>
  6088. </para>
  6089. </section>
  6090. <section id="dhcp6-std">
  6091. <title>Supported Standards</title>
  6092. <para>The following standards and draft standards are currently
  6093. supported:</para>
  6094. <itemizedlist>
  6095. <listitem>
  6096. <simpara><ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>: Supported messages are SOLICIT,
  6097. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND and REPLY.</simpara>
  6098. </listitem>
  6099. <listitem>
  6100. <simpara><ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>: Supported options are IA_PD and
  6101. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  6102. </listitem>
  6103. <listitem>
  6104. <simpara><ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>: Supported option is DNS_SERVERS.</simpara>
  6105. </listitem>
  6106. <listitem>
  6107. <simpara><ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>: Supported option is CLIENT_FQDN.</simpara>
  6108. </listitem>
  6109. </itemizedlist>
  6110. </section>
  6111. <section id="dhcp6-limit">
  6112. <title>DHCPv6 Server Limitations</title>
  6113. <para> These are the current limitations and known problems
  6114. with the DHCPv6 server
  6115. software. Most of them are reflections of the early stage of
  6116. development and should be treated as <quote>not implemented
  6117. yet</quote>, rather than actual limitations.</para>
  6118. <itemizedlist>
  6119. <listitem> <!-- see tickets #3234, #3281 -->
  6120. <para>
  6121. On-line configuration has some limitations. Adding new subnets or
  6122. modifying existing ones work, as is removing the last subnet from
  6123. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  6124. there are 4 subnets configured) will cause issues. The problem is
  6125. caused by simplistic subnet-id assignment. The subnets are always
  6126. numbered, starting from 1. That subnet-id is then used in leases
  6127. that are stored in the lease database. Removing non-last subnet will
  6128. cause the configuration information to mismatch data in the lease
  6129. database. It is possible to manually update subnet-id fields in
  6130. MySQL or PostgreSQL database, but it is awkward and error prone
  6131. process. A better reconfiguration support is planned.
  6132. </para>
  6133. </listitem>
  6134. <listitem>
  6135. <para>
  6136. On startup, the DHCPv6 server does not get the full configuration from
  6137. BIND 10. To remedy this, after starting BIND 10, modify any parameter
  6138. and commit the changes, e.g.
  6139. <screen>
  6140. &gt; <userinput>config show Dhcp6/renew-timer</userinput>
  6141. Dhcp6/renew-timer 1000 integer (default)
  6142. &gt; <userinput>config set Dhcp6/renew-timer 1001</userinput>
  6143. &gt; <userinput>config commit</userinput></screen>
  6144. </para>
  6145. </listitem>
  6146. <listitem>
  6147. <simpara>Temporary addresses are not supported.</simpara>
  6148. </listitem>
  6149. <listitem>
  6150. <simpara>
  6151. The server will allocate, renew or rebind a maximum of one lease
  6152. for a particular IA option (IA_NA or IA_PD) sent by a client.
  6153. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  6154. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  6155. for multiple addresses or prefixes to be allocated for a single IA.
  6156. </simpara>
  6157. </listitem>
  6158. <listitem>
  6159. <simpara>Temporary addresses are not supported.</simpara>
  6160. </listitem>
  6161. <listitem>
  6162. <simpara>
  6163. Confirmation (CONFIRM), duplication report (DECLINE),
  6164. stateless configuration (INFORMATION-REQUEST) and client
  6165. reconfiguration (RECONFIGURE) are not yet supported.
  6166. </simpara>
  6167. </listitem>
  6168. <listitem>
  6169. <simpara>
  6170. The server doesn't act upon expired leases. In particular,
  6171. when a lease expires, the server doesn't request removal of
  6172. the DNS records associated with it.
  6173. </simpara>
  6174. </listitem>
  6175. </itemizedlist>
  6176. </section>
  6177. <!--
  6178. <section id="dhcp6-srv-examples">
  6179. <title>Kea DHCPv6 server examples</title>
  6180. <para>
  6181. This section provides easy to use example. Each example can be read
  6182. separately. It is not intended to be read sequentially as there will
  6183. be many repetitions between examples. They are expected to serve as
  6184. easy to use copy-paste solutions to many common deployments.
  6185. </para>
  6186. @todo: add simple configuration for direct clients
  6187. @todo: add configuration for relayed clients
  6188. @todo: add client classification example
  6189. </section> -->
  6190. </chapter>
  6191. <chapter id="dhcp-ddns-server">
  6192. <title>The DHCP-DDNS Server</title>
  6193. <para>
  6194. The DHCP-DDNS Server (known informally as D2) conducts the client side of
  6195. the DDNS protocol (defined in RFC 2136) on behalf of the DHCPv4 and DHCPv6
  6196. servers. The DHCP servers construct
  6197. DDNS update requests, known as NameChangeRequests (NCRs), based upon DHCP
  6198. lease change events and then post these to D2. D2 attempts to match
  6199. each such request to the appropriate DNS server(s) and carry out the
  6200. necessary conversation with those servers to update the DNS data.
  6201. </para>
  6202. <para>
  6203. In order to match a request to appropriate DNS servers, D2 must have a
  6204. catalog of servers from which to select. In fact, D2 has two such catalogs,
  6205. one for forward DNS and one for reverse DNS; these catalogs are referred
  6206. to as DDNS Domain Lists. Each list consists of one or more named DDNS
  6207. Domains. Further, each DDNS Domain has a list of of one or more DNS
  6208. servers that publish the DNS data for that domain.
  6209. </para>
  6210. <para>
  6211. When conducting forward domain matching, D2 will compare the FQDN in
  6212. the request against the name of each forward DDNS Domain. The domain
  6213. whose name matches the longest portion of the FQDN is considered the
  6214. best match. For example, if the FQDN is "myhost.sample.example.com.",
  6215. and there are two forward domains in the catalog: "sample.example.com."
  6216. and "example.com.", the former is regarded as the best match. In some
  6217. cases, it may not be possible to find a suitable match. Given the same two
  6218. forward domains there would be no match for the FQDN, "bogus.net", so the
  6219. request would be rejected. Finally, if there are no forward DDNS Domains
  6220. defined, D2 will simply disregard the forward update portion of requests.
  6221. </para>
  6222. <para>
  6223. When conducting reverse domain matching, D2 constructs a reverse
  6224. FQDN from the lease address in the request and compare that against
  6225. the name of each reverse DDNS Domain. Again, the domain whose name matches
  6226. the longest portion of the FQDN is considered the best match. For instance,
  6227. if the lease address is "172.16.1.40" and there are two reverse domains in
  6228. the catalog: "1.16.172.in-addr.arpa." and "16.172.in-addr.arpa", the
  6229. former is the best match. As with forward matching, it is possible to not
  6230. find a suitable match. Given the same two domains, there would be no
  6231. match for the lease address, "192.168.1.50", and the request would be
  6232. rejected. Finally, if there are no reverse DDNS Domains defined, D2 will
  6233. simply disregard the reverse update portion of requests.
  6234. </para>
  6235. <section id="dhcp-ddns-server-start-stop">
  6236. <title>Starting and Stopping the DHCP-DDNS Server</title>
  6237. <para>
  6238. <command>b10-dhcp-ddns</command> is the BIND 10 DHCP-DDNS server and,
  6239. like other parts of BIND 10, is configured through the
  6240. <command>bindctl</command> program.
  6241. </para>
  6242. <para>
  6243. After starting BIND 10 and entering bindctl, the first step in
  6244. configuring the server is to add it to the list of running BIND 10
  6245. services.
  6246. <screen>
  6247. &gt; <userinput>config add Init/components b10-dhcp-ddns</userinput>
  6248. &gt; <userinput>config set Init/components/b10-dhcp-ddns/kind dispensable</userinput>
  6249. &gt; <userinput>config commit</userinput>
  6250. </screen>
  6251. </para>
  6252. <para>
  6253. To remove <command>b10-dhcp-ddns</command> from the set of running services,
  6254. the <command>b10-dhcp-ddns</command> is removed from list of Init components:
  6255. <screen>
  6256. &gt; <userinput>config remove Init/components b10-dhcp-ddns</userinput>
  6257. &gt; <userinput>config commit</userinput>
  6258. </screen>
  6259. </para>
  6260. <para>
  6261. Note that the server was only removed from the list, so BIND10 will not
  6262. restart it, but the server itself is still running. Hence it is usually
  6263. desired to stop it:
  6264. </para>
  6265. <screen>
  6266. &gt; <userinput>DhcpDdns shutdown</userinput>
  6267. </screen>
  6268. <para>
  6269. Upon start up the module will load its configuration and begin listening
  6270. for NCRs based on that configuration.
  6271. </para>
  6272. </section> <!-- end start-stop -->
  6273. <section id="d2-configuration">
  6274. <title>Configuring the DHCP-DDNS Server</title>
  6275. <para>
  6276. Once the server is started, it can be configured. To view the
  6277. current configuration, use the following command in <command>bindctl</command>:
  6278. <screen>
  6279. &gt; <userinput>config show DhcpDdns</userinput></screen>
  6280. When starting b10-dhcp-ddns module for the first time, the default
  6281. configuration will be available. It will look similar to this:
  6282. <screen>
  6283. &gt; <userinput>config show DhcpDdns</userinput>
  6284. DhcpDdns/interface "eth0" string (default)
  6285. DhcpDdns/ip_address "127.0.0.1" string (default)
  6286. DhcpDdns/port 53001 integer (default)
  6287. DhcpDdns/tsig_keys [] list (default)
  6288. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  6289. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  6290. </screen>
  6291. <para>
  6292. (While displayed, the parameter "interface" is not implemented, and
  6293. will be removed in the near future.)
  6294. </para>
  6295. </para>
  6296. <para>
  6297. The configuration can be divided as follows, each of which is described
  6298. in its own section:
  6299. </para>
  6300. <itemizedlist>
  6301. <listitem>
  6302. <simpara>
  6303. <command>General Server Parameters</command> &mdash;
  6304. values which control connectivity and global server behavior
  6305. </simpara>
  6306. </listitem>
  6307. <listitem>
  6308. <simpara>
  6309. <command>TSIG Key Info</command> &mdash;
  6310. defines the TSIG keys used for secure traffic with DNS servers
  6311. </simpara>
  6312. </listitem>
  6313. <listitem>
  6314. <simpara>
  6315. <command>Forward DDNS</command> &mdash;
  6316. defines the catalog of Forward DDNS Domains
  6317. </simpara>
  6318. </listitem>
  6319. <listitem>
  6320. <simpara>
  6321. <command>Reverse DDNS</command> &mdash;
  6322. defines the catalog of Forward DDNS Domains
  6323. </simpara>
  6324. </listitem>
  6325. </itemizedlist>
  6326. <section id="d2-server-parameter-config">
  6327. <title>General Server Parameters</title>
  6328. <para>
  6329. The DHCP-DDNS server must listen for requests on a known address and
  6330. port. By default, it will listen at 127.0.0.1 on port 53001. This is
  6331. governed by the parameters, "ip-address" and "port". Either value
  6332. may be changed using config set/commit. For example to change the
  6333. server to listen at 192.168.1.10 port 900:
  6334. <screen>
  6335. &gt; <userinput>config set DhcpDdns/ip_address "192.168.1.10"</userinput>
  6336. &gt; <userinput>config set DhcpDdns/port 900</userinput>
  6337. &gt; <userinput>config commit</userinput>
  6338. </screen>
  6339. The server may be configured to listen over IPv4 or IPv6, therefore
  6340. ip-address may an IPv4 or IPv6 address.
  6341. </para>
  6342. <warning>
  6343. <simpara>
  6344. When the DHCP-DDNS server is configured to listen at an address
  6345. other than the loopback address (127.0.0.1 or ::1), it is possible
  6346. for a malicious attacker to send bogus NameChangeRequests to it
  6347. and change entries in the DNS. For this reason, addresses other
  6348. than the IPv4 or IPv6 loopback addresses should only be used
  6349. for testing purposes. A future version of Kea will implement
  6350. authentication to guard against such attacks.
  6351. </simpara>
  6352. </warning>
  6353. <note>
  6354. <simpara>
  6355. If the ip_address and port are changed, it will be necessary to change the
  6356. corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
  6357. </simpara>
  6358. </note>
  6359. </section> <!-- "d2-server-parameter-config" -->
  6360. <section id="d2-tsig-key-list-config">
  6361. <title>TSIG Key List</title>
  6362. <note>
  6363. <simpara>
  6364. While this section may be displayed and edited using bindctl, the use
  6365. of TSIG in actual communications between D2 and DNS servers is not yet
  6366. implemented.
  6367. </simpara>
  6368. </note>
  6369. <para>
  6370. DDNS protocol can be conducted with or without TSIG as defined in
  6371. RFC 2845. This configuration section allows the administrator to
  6372. define the dictionary of TSIG keys to may be used. To use TSIG
  6373. when working with a specific DDNS Domain that key must be defined in
  6374. the TSIG Key List and referenced by name in that domain's entry in
  6375. the DDNS catalog.
  6376. </para>
  6377. <para>
  6378. As one might gather from its name, this section is a list of
  6379. TSIG keys. Each key has three parameters:
  6380. <itemizedlist>
  6381. <listitem>
  6382. <simpara>
  6383. <command>name</command> &mdash;
  6384. is a unique text label used to idenfity the this key within the
  6385. list. It is this value that is used to specify which key (if any)
  6386. should be used with a specific DNS server. So long as it is
  6387. unique, its content is arbitrary. It cannot be blank.
  6388. </simpara>
  6389. </listitem>
  6390. <listitem>
  6391. <simpara>
  6392. <command>algorithm</command> &mdash;
  6393. specifies which hashing algorithm should be used with this
  6394. key. This value is not currently used.
  6395. </simpara>
  6396. </listitem>
  6397. <listitem>
  6398. <simpara>
  6399. <command>secret</command> &mdash;
  6400. is used to specify the shared secret key code for this key. This
  6401. value is not currently used.
  6402. </simpara>
  6403. </listitem>
  6404. </itemizedlist>
  6405. </para>
  6406. <para>
  6407. By default, the TSIG Key list is empty:
  6408. <screen>
  6409. <userinput>> config show DhcpDdns/tsig_keys</userinput>
  6410. DhcpDdns/tsig_keys [] list (default)
  6411. </screen>
  6412. To create a new key in the list, one must first add a new key element:
  6413. <screen>
  6414. <userinput>> config add DhcpDdns/tsig_keys</userinput>
  6415. </screen>
  6416. Displaying the new element, reveals this:
  6417. <screen>
  6418. <userinput>> config show DhcpDdns/tsig_keys[0]</userinput>
  6419. DhcpDdns/tsig_keys[0]/name "" string (default)
  6420. DhcpDdns/tsig_keys[0]/algorithm "hmac_md5" string (modified)
  6421. DhcpDdns/tsig_keys[0]/secret "" string (default)
  6422. </screen>
  6423. Populating the key name and secret, while accepting the default value
  6424. for alogorithm:
  6425. <screen>
  6426. <userinput>> config set DhcpDdns/tsig_keys[0]/name "key1.example.com"</userinput>
  6427. <userinput>> config set DhcpDdns/tsig_keys[0]/secret "123456789"</userinput>
  6428. <userinput>> config commit</userinput>
  6429. </screen>
  6430. </para>
  6431. </section> <!-- "d2-tsig-key-list-config" -->
  6432. <section id="d2-forward-ddns-config">
  6433. <title>Forward DDNS</title>
  6434. <para>
  6435. The Forward DDNS section is used to configure D2's forward update
  6436. behavior. Currently it contains a single parameter, the catalog of
  6437. forward DDNS Domains:
  6438. <screen>
  6439. <userinput>> config show DhcpDdns/forward_ddns/</userinput>
  6440. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  6441. </screen>
  6442. By default, this list is empty, which will cause the server to ignore
  6443. the forward update portions of requests.
  6444. </para>
  6445. <section id="add-forward-ddns-domain">
  6446. <title>Adding Forward DDNS Domains</title>
  6447. <para>
  6448. A forward DDNS Domain maps a forward DNS zone to a set of DNS servers
  6449. which maintain the forward DNS data for that zone. You will need one
  6450. forward DDNS Domain for each zone you wish to service. It may very
  6451. well be that some or all of your zones are maintained by the same
  6452. servers. You will still need one DDNS Domain per zone. Remember that
  6453. matching a request to the appropriate server(s) is done by zone and
  6454. a DDNS Domain only defines a single zone.
  6455. </para>
  6456. <para>
  6457. The section describes how to add Forward DDNS Domains. Repeat these
  6458. steps for each Forward DDNS Domain desired. Each Forward DDNS Domain
  6459. has the following parameters:
  6460. <itemizedlist>
  6461. <listitem>
  6462. <simpara>
  6463. <command>name</command> &mdash;
  6464. The fully qualified domain name (or zone) that this DDNS Domain
  6465. can update. This is value used to compare against the request
  6466. FQDN during forward matching. It must be unique within the
  6467. catalog.
  6468. </simpara>
  6469. </listitem>
  6470. <listitem>
  6471. <simpara>
  6472. <command>key_name</command> &mdash;
  6473. If TSIG is used with this domain's servers, this
  6474. value should be the name of the key from within the TSIG Key List
  6475. to use. If the value is blank (the default), TSIG will not be
  6476. used in DDNS converations with this domain's servers. Currently
  6477. TSIG has not been implemented, so this value is ignored.
  6478. </simpara>
  6479. </listitem>
  6480. <listitem>
  6481. <simpara>
  6482. <command>dns_servers</command> &mdash;
  6483. A list of one or more DNS servers which can conduct the server
  6484. side of the DDNS protocol for this domain. The servers
  6485. are used in a first to last preference. In other words, when D2
  6486. begins to process a request for this domain it will pick the
  6487. first server in this list and attempt to communicate with it.
  6488. If that attempt fails, it will move to next one in the list and
  6489. so on until the it achieves success or the list is exhausted.
  6490. </simpara>
  6491. </listitem>
  6492. </itemizedlist>
  6493. To create a new forward DDNS Domain, one must first add a new domain
  6494. element:
  6495. <screen>
  6496. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains</userinput>
  6497. </screen>
  6498. Displaying the DDNS Domain reveals this:
  6499. <screen>
  6500. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]</userinput>
  6501. DhcpDdns/forward_ddns/ddns_domains[0]/name "" string (default)
  6502. DhcpDdns/forward_ddns/ddns_domains[0]/key_name "" string (default)
  6503. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers [] list (default)
  6504. </screen>
  6505. To set the domain's name to "other.example.com":
  6506. <screen>
  6507. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[1]/name "other.example.com"</userinput>
  6508. <userinput>> config commit</userinput>
  6509. </screen>
  6510. It is permissable to add a domain without any servers. If that domain
  6511. should be matched to a request, however, the request will fail. In
  6512. order to make the domain useful though, we must add at least one DNS
  6513. server to it.
  6514. </para>
  6515. <section id="add-forward-dns-servers">
  6516. <title>Adding Forward DNS Servers</title>
  6517. <para>
  6518. The section describes how to add DNS servers to a Forward DDNS Domain.
  6519. Repeat them for as many servers as desired for a each domain.
  6520. </para>
  6521. <para>
  6522. Forward DNS Server entries represent actual DNS servers which
  6523. support the server side of the DDNS protocol. Each Forward DNS Server
  6524. has the following parameters:
  6525. <itemizedlist>
  6526. <listitem>
  6527. <simpara>
  6528. <command>hostname</command> &mdash;
  6529. The resolvable host name of the DNS server. This value is not
  6530. yet implemented.
  6531. </simpara>
  6532. </listitem>
  6533. <listitem>
  6534. <simpara>
  6535. <command>ip_address</command> &mdash;
  6536. The IP address at which the server listens for DDNS requests.
  6537. This may be either an IPv4 or an IPv6 address.
  6538. </simpara>
  6539. </listitem>
  6540. <listitem>
  6541. <simpara>
  6542. <command>port</command> &mdash;
  6543. The port on which the server listens for DDNS requests. It
  6544. defaults to the standard DNS service port of 53.
  6545. </simpara>
  6546. </listitem>
  6547. </itemizedlist>
  6548. To create a new forward DNS Server, one must first add a new server
  6549. element to the domain:
  6550. <screen>
  6551. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers</userinput>
  6552. </screen>
  6553. Displaying the DNS Server element should appear as follows:
  6554. <screen>
  6555. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  6556. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  6557. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  6558. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  6559. </screen>
  6560. As stated earlier, "hostname" is not yet supported so, the parameter
  6561. "ip_address" must be set to the address of the DNS server. If for
  6562. example the service is running at "172.88.99.10", then set it as
  6563. follows:
  6564. <screen>
  6565. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  6566. <userinput>> config commit</userinput>
  6567. </screen>
  6568. </para>
  6569. </section> <!-- "add-forward-dns-servers" -->
  6570. </section> <!-- "add-forward-ddns-domains" -->
  6571. </section> <!-- "d2-forward-ddns-config" -->
  6572. <section id="d2-reverse-ddns-config">
  6573. <title>Reverse DDNS</title>
  6574. <para>
  6575. The Reverse DDNS section is used to configure D2's reverse update
  6576. behavior, and the concepts are the same as for the forward DDNS
  6577. section. Currently it contains a single parameter, the catalog of
  6578. reverse DDNS Domains:
  6579. <screen>
  6580. <userinput>> config show DhcpDdns/reverse_ddns/</userinput>
  6581. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  6582. </screen>
  6583. By default, this list is empty, which will cause the server to ignore
  6584. the reverse update portions of requests.
  6585. </para>
  6586. <section id="add-reverse-ddns-domain">
  6587. <title>Adding Reverse DDNS Domains</title>
  6588. <para>
  6589. A reverse DDNS Domain maps a reverse DNS zone to a set of DNS servers
  6590. which maintain the reverse DNS data for that zone. You will need one
  6591. reverse DDNS Domain for each zone you wish to service. It may very
  6592. well be that some or all of your zones are maintained by the same
  6593. servers; even then, you will still need one DDNS Domain entry for each
  6594. zone. Remember that
  6595. matching a request to the appropriate server(s) is done by zone and
  6596. a DDNS Domain only defines a single zone.
  6597. </para>
  6598. <para>
  6599. The section describes how to add Reverse DDNS Domains. Repeat these
  6600. steps for each Reverse DDNS Domain desired. Each Reverse DDNS Domain
  6601. has the following parameters:
  6602. <itemizedlist>
  6603. <listitem>
  6604. <simpara>
  6605. <command>name</command> &mdash;
  6606. The fully qualified reverse zone that this DDNS Domain
  6607. can update. This is the value used during reverse matching
  6608. which will compare it with a reversed version of the request's
  6609. lease address. The zone name should follow the appropriate
  6610. standards: for example, to to support the IPv4 subnet 172.16.1,
  6611. the name should be. "1.16.172.in-addr.arpa.". Similarly,
  6612. to support an IPv6 subent of 2001:db8:1, the name should be
  6613. "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa."
  6614. Whatever the name, it must be unique within the catalog.
  6615. </simpara>
  6616. </listitem>
  6617. <listitem>
  6618. <simpara>
  6619. <command>key_name</command> &mdash;
  6620. If TSIG should be used with this domain's servers, then this
  6621. value should be the name of the key from within the TSIG Key List
  6622. to use. If the value is blank (the default), TSIG will not be
  6623. used in DDNS converations with this domain's servers. Currently
  6624. this value is not used as TSIG has not been implemented.
  6625. </simpara>
  6626. </listitem>
  6627. <listitem>
  6628. <simpara>
  6629. <command>dns_servers</command> &mdash;
  6630. a list of one or more DNS servers which can conduct the server
  6631. side of the DDNS protocol for this domain. Currently the servers
  6632. are used in a first to last preference. In other words, when D2
  6633. begins to process a request for this domain it will pick the
  6634. first server in this list and attempt to communicate with it.
  6635. If that attempt fails, it will move to next one in the list and
  6636. so on until the it achieves success or the list is exhausted.
  6637. </simpara>
  6638. </listitem>
  6639. </itemizedlist>
  6640. To create a new reverse DDNS Domain, one must first add a new domain
  6641. element:
  6642. <screen>
  6643. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains</userinput>
  6644. </screen>
  6645. Displaying the DDNS Domain reveals this:
  6646. <screen>
  6647. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]</userinput>
  6648. DhcpDdns/reverse_ddns/ddns_domains[0]/name "" string (default)
  6649. DhcpDdns/reverse_ddns/ddns_domains[0]/key_name "" string (default)
  6650. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers [] list (default)
  6651. </screen>
  6652. For domain supporting the subnet 2001:db8:1::, we would set the
  6653. domain's name as follows:
  6654. <screen>
  6655. <userinput>> config set DhcpDdns/reverse_ddns/ddns_domains[1]/name "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa."</userinput>
  6656. <userinput>> config commit</userinput>
  6657. </screen>
  6658. It is permissable to add a domain without any servers. If that domain
  6659. should be matched to a request, however, the request will fail. In
  6660. order to make the domain useful though, we must add at least one DNS
  6661. server to it.
  6662. </para>
  6663. <section id="add-reverse-dns-servers">
  6664. <title>Adding Reverse DNS Servers</title>
  6665. <para>
  6666. The section describes how to add DNS servers to a Reverse DDNS Domain.
  6667. Repeat them for as many servers as desired for a each domain.
  6668. </para>
  6669. <para>
  6670. Reverse DNS Server entries represents a actual DNS servers which
  6671. support the server side of the DDNS protocol. Each Reverse DNS Server
  6672. has the following parameters:
  6673. <itemizedlist>
  6674. <listitem>
  6675. <simpara>
  6676. <command>hostname</command> &mdash;
  6677. The resolvable host name of the DNS server. This value is
  6678. currently ignored.
  6679. </simpara>
  6680. </listitem>
  6681. <listitem>
  6682. <simpara>
  6683. <command>ip_address</command> &mdash;
  6684. The IP address at which the server listens for DDNS requests.
  6685. </simpara>
  6686. </listitem>
  6687. <listitem>
  6688. <simpara>
  6689. <command>port</command> &mdash;
  6690. The port on which the server listens for DDNS requests. It
  6691. defaults to the standard DNS service port of 53.
  6692. </simpara>
  6693. </listitem>
  6694. </itemizedlist>
  6695. To create a new reverse DNS Server, one must first add a new server
  6696. element to the domain:
  6697. <screen>
  6698. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers</userinput>
  6699. </screen>
  6700. Displaying the DNS Server element should appear as follows:
  6701. <screen>
  6702. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  6703. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  6704. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  6705. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  6706. </screen>
  6707. As stated earlier, "hostname" is not yet supported so, the parameter
  6708. "ip_address" must be set to the address of the DNS server. If for
  6709. example the service is running at "172.88.99.10", then set it as
  6710. follows:
  6711. <screen>
  6712. <userinput>> config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  6713. <userinput>> config commit</userinput>
  6714. </screen>
  6715. </para>
  6716. </section> <!-- "add-reverse-dns-servers" -->
  6717. </section> <!-- "add-reverse-ddns-domains" -->
  6718. </section> <!-- "d2-reverse-ddns-config" -->
  6719. <section id="d2-exmaple-config">
  6720. <title>Example DHCP-DDNS Server Configuration</title>
  6721. <para>
  6722. This section provides an example DHCP-DDNS server configuration based
  6723. on a small example network. Let's suppose our example network has
  6724. three domains, each with their own subnet.
  6725. <table>
  6726. <title>Our example network</title>
  6727. <tgroup cols='4' align='left'>
  6728. <colspec colname='domain'/>
  6729. <colspec colname='subnet'/>
  6730. <colspec colname='fservers'/>
  6731. <colspec colname='rservers'/>
  6732. <thead>
  6733. <row>
  6734. <entry>Domain</entry>
  6735. <entry>Subnet</entry>
  6736. <entry>Forward DNS Servers</entry>
  6737. <entry>Reverse DNS Servers</entry>
  6738. </row>
  6739. </thead>
  6740. <tbody>
  6741. <row>
  6742. <entry>four.example.com</entry>
  6743. <entry>192.0.2.0/24</entry>
  6744. <entry>172.16.1.5, 172.16.2.5</entry>
  6745. <entry>172.16.1.5, 172.16.2.5</entry>
  6746. </row>
  6747. <row>
  6748. <entry>six.example.com</entry>
  6749. <entry>2001:db8:1::/64</entry>
  6750. <entry>3001:1::50</entry>
  6751. <entry>3001:1::51</entry>
  6752. </row>
  6753. <row>
  6754. <entry>example.com</entry>
  6755. <entry>192.0.0.0/16</entry>
  6756. <entry>172.16.2.5</entry>
  6757. <entry>172.16.2.5</entry>
  6758. </row>
  6759. </tbody>
  6760. </tgroup>
  6761. </table>
  6762. </para>
  6763. <para>
  6764. We need to construct three forward DDNS Domains:
  6765. <table>
  6766. <title>Forward DDNS Domains Needed</title>
  6767. <tgroup cols='3' align='left'>
  6768. <colspec colname='num'/>
  6769. <colspec colname='name'/>
  6770. <colspec colname='servers'/>
  6771. <thead>
  6772. <row>
  6773. <entry>#</entry>
  6774. <entry>DDNS Domain Name</entry>
  6775. <entry>DNS Servers</entry>
  6776. </row>
  6777. </thead>
  6778. <tbody>
  6779. <row>
  6780. <entry>1.</entry>
  6781. <entry>four.example.com.</entry>
  6782. <entry>172.16.1.5, 172.16.2.5</entry>
  6783. </row>
  6784. <row>
  6785. <entry>2.</entry>
  6786. <entry>six.example.com.</entry>
  6787. <entry>3001:1::50</entry>
  6788. </row>
  6789. <row>
  6790. <entry>3.</entry>
  6791. <entry>example.com.</entry>
  6792. <entry>172.16.2.5</entry>
  6793. </row>
  6794. </tbody>
  6795. </tgroup>
  6796. </table>
  6797. As discussed earlier, FQDN to domain matching is based on the longest
  6798. match. The FQDN, "myhost.four.example.com.", will match the first
  6799. domain ("four.example.com") while "admin.example.com." will match the
  6800. third domain ("example.com"). The
  6801. FQDN, "other.example.net." will fail to match any domain and would
  6802. be rejected.
  6803. </para>
  6804. <para>
  6805. The following series of commands in bindctl will create the Forward
  6806. DDNS Domains.
  6807. <screen>
  6808. <userinput>
  6809. > config add DhcpDdns/forward_ddns/ddns_domains
  6810. > config set DhcpDdns/forward_ddns/ddns_domains[0]/name "four.example.com."
  6811. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  6812. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  6813. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  6814. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  6815. >
  6816. > config add DhcpDdns/forward_ddns/ddns_domains
  6817. > config set DhcpDdns/forward_ddns/ddns_domains[1]/name "six.example.com."
  6818. > config add DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers
  6819. > config set DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  6820. >
  6821. > config add DhcpDdns/forward_ddns/ddns_domains
  6822. > config set DhcpDdns/forward_ddns/ddns_domains[2]/name "example.com."
  6823. > config add DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers
  6824. > config set DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  6825. >
  6826. > config commit
  6827. </userinput>
  6828. </screen>
  6829. </para>
  6830. <para>
  6831. Similarly, we need to construct the three reverse DDNS Domains:
  6832. <table>
  6833. <title>Reverse DDNS Domains Needed</title>
  6834. <tgroup cols='3' align='left'>
  6835. <colspec colname='num'/>
  6836. <colspec colname='DDNS Domain name'/>
  6837. <colspec colname='DDNS Domain DNS Servers'/>
  6838. <thead>
  6839. <row>
  6840. <entry>#</entry>
  6841. <entry>DDNS Domain Name</entry>
  6842. <entry>DNS Servers</entry>
  6843. </row>
  6844. </thead>
  6845. <tbody>
  6846. <row>
  6847. <entry>1.</entry>
  6848. <entry>2.0.192.in-addr.arpa.</entry>
  6849. <entry>172.16.1.5, 172.16.2.5</entry>
  6850. </row>
  6851. <row>
  6852. <entry>2.</entry>
  6853. <entry>1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa.</entry>
  6854. <entry>3001:1::50</entry>
  6855. </row>
  6856. <row>
  6857. <entry>3.</entry>
  6858. <entry>0.182.in-addr.arpa.</entry>
  6859. <entry>172.16.2.5</entry>
  6860. </row>
  6861. </tbody>
  6862. </tgroup>
  6863. </table>
  6864. An address of "192.0.2.150" will match the first domain,
  6865. "2001:db8:1::10" will match the second domain, and "192.0.50.77"
  6866. the third domain.
  6867. </para>
  6868. <para>
  6869. The following series of commands in bindctl will create our Reverse
  6870. DDNS Domains.
  6871. <screen>
  6872. <userinput>
  6873. > config add DhcpDdns/reverse_ddns/ddns_domains
  6874. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/name "2.0.192.in-addr.arpa."
  6875. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  6876. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  6877. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  6878. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  6879. >
  6880. > config add DhcpDdns/reverse_ddns/ddns_domains
  6881. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/name "1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa."
  6882. > config add DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers
  6883. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  6884. >
  6885. > config add DhcpDdns/reverse_ddns/ddns_domains
  6886. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/name "0.192.in-addr.arpa."
  6887. > config add DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers
  6888. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  6889. >
  6890. > config commit
  6891. </userinput>
  6892. </screen>
  6893. </para>
  6894. </section> <!-- end of "d2-example" -->
  6895. </section> <!-- end of section "d2-configuration" -->
  6896. <section>
  6897. <title>DHCP-DDNS Server Limitations</title>
  6898. <para>The following are the current limitations of the DHCP-DDNS Server.</para>
  6899. <itemizedlist>
  6900. <listitem>
  6901. <simpara>
  6902. Requests received from the DHCP servers are placed in a
  6903. queue until they are processed. Currently all queued requests
  6904. are lost when the server shuts down.
  6905. </simpara>
  6906. </listitem>
  6907. <listitem>
  6908. <simpara>
  6909. TSIG Authentication (<ulink
  6910. url="http://tools.ietf.org/html/rfc2845">RFC 2845</ulink>)
  6911. is not supported yet.
  6912. </simpara>
  6913. </listitem>
  6914. </itemizedlist>
  6915. </section>
  6916. </chapter> <!-- DHCP-DDNS Server -->
  6917. <chapter id="libdhcp">
  6918. <title>libdhcp++ library</title>
  6919. <para>
  6920. libdhcp++ is a common library written in C++ that handles
  6921. many DHCP-related tasks, including:
  6922. <itemizedlist>
  6923. <listitem>
  6924. <simpara>DHCPv4 and DHCPv6 packets parsing, manipulation and assembly</simpara>
  6925. </listitem>
  6926. <listitem>
  6927. <simpara>Option parsing, manipulation and assembly</simpara>
  6928. </listitem>
  6929. <listitem>
  6930. <simpara>Network interface detection</simpara>
  6931. </listitem>
  6932. <listitem>
  6933. <simpara>Socket operations such as creation, data transmission and reception and socket closing.</simpara>
  6934. </listitem>
  6935. </itemizedlist>
  6936. </para>
  6937. <para>
  6938. While this library is currently used by BIND 10 DHCP, it is designed to
  6939. be a portable, universal library, useful for any kind of DHCP-related software.
  6940. </para>
  6941. <!-- TODO: point to doxygen docs -->
  6942. <section id="iface-detect">
  6943. <title>Interface detection and Socket handling</title>
  6944. <para>Both the DHCPv4 and DHCPv6 components share network
  6945. interface detection routines. Interface detection is
  6946. currently supported on Linux, all BSD family (FreeBSD, NetBSD,
  6947. OpenBSD), Mac OS X and Solaris 11 systems.</para>
  6948. <para>DHCPv4 requires special raw socket processing to send and receive
  6949. packets from hosts that do not have IPv4 address assigned yet. Support
  6950. for this operation is implemented on Linux only, so it is likely that
  6951. DHCPv4 component will not work in certain cases on systems other than
  6952. Linux.</para>
  6953. </section>
  6954. <!--
  6955. <section id="packet-handling">
  6956. <title>DHCPv4/DHCPv6 packet handling</title>
  6957. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  6958. </section>
  6959. -->
  6960. </chapter>
  6961. <chapter id="statistics">
  6962. <title>Statistics</title>
  6963. <para>
  6964. The <command>b10-stats</command> process is started by
  6965. <command>b10-init</command>.
  6966. It periodically collects statistics data from various modules
  6967. and aggregates it.
  6968. <!-- TODO -->
  6969. </para>
  6970. <para>
  6971. This stats daemon provides commands to identify if it is
  6972. running, show specified or all statistics data, and show specified
  6973. or all statistics data schema.
  6974. For example, using <command>bindctl</command>:
  6975. <screen>
  6976. &gt; <userinput>Stats show</userinput>
  6977. {
  6978. "Auth": {
  6979. "opcode.iquery": 0,
  6980. "opcode.notify": 10,
  6981. "opcode.query": 869617,
  6982. ...
  6983. "queries.tcp": 1749,
  6984. "queries.udp": 867868
  6985. },
  6986. "Init": {
  6987. "boot_time": "2011-01-20T16:59:03Z"
  6988. },
  6989. "Stats": {
  6990. "boot_time": "2011-01-20T16:59:05Z",
  6991. "last_update_time": "2011-01-20T17:04:05Z",
  6992. "lname": "4d3869d9_a@jreed.example.net",
  6993. "report_time": "2011-01-20T17:04:06Z",
  6994. "timestamp": 1295543046.823504
  6995. }
  6996. }
  6997. </screen>
  6998. </para>
  6999. </chapter>
  7000. <chapter id="logging">
  7001. <title>Logging</title>
  7002. <section>
  7003. <title>Logging configuration</title>
  7004. <para>
  7005. The logging system in BIND 10 is configured through the
  7006. Logging module. All BIND 10 modules will look at the
  7007. configuration in Logging to see what should be logged and
  7008. to where.
  7009. <!-- TODO: what is context of Logging module for readers of this guide? -->
  7010. </para>
  7011. <section>
  7012. <title>Loggers</title>
  7013. <para>
  7014. Within BIND 10, a message is logged through a component
  7015. called a "logger". Different parts of BIND 10 log messages
  7016. through different loggers, and each logger can be configured
  7017. independently of one another.
  7018. </para>
  7019. <para>
  7020. In the Logging module, you can specify the configuration
  7021. for zero or more loggers; any that are not specified will
  7022. take appropriate default values.
  7023. </para>
  7024. <para>
  7025. The three most important elements of a logger configuration
  7026. are the <option>name</option> (the component that is
  7027. generating the messages), the <option>severity</option>
  7028. (what to log), and the <option>output_options</option>
  7029. (where to log).
  7030. </para>
  7031. <section>
  7032. <title>name (string)</title>
  7033. <para>
  7034. Each logger in the system has a name, the name being that
  7035. of the component using it to log messages. For instance,
  7036. if you want to configure logging for the resolver module,
  7037. you add an entry for a logger named <quote>Resolver</quote>. This
  7038. configuration will then be used by the loggers in the
  7039. Resolver module, and all the libraries used by it.
  7040. </para>
  7041. <!-- TODO: later we will have a way to know names of all modules
  7042. Right now you can only see what their names are if they are running
  7043. (a simple 'help' without anything else in bindctl for instance).
  7044. -->
  7045. <para>
  7046. If you want to specify logging for one specific library
  7047. within the module, you set the name to
  7048. <replaceable>module.library</replaceable>. For example, the
  7049. logger used by the nameserver address store component
  7050. has the full name of <quote>Resolver.nsas</quote>. If
  7051. there is no entry in Logging for a particular library,
  7052. it will use the configuration given for the module.
  7053. <!-- TODO: how to know these specific names?
  7054. We will either have to document them or tell the administrator to
  7055. specify module-wide logging and see what appears...
  7056. -->
  7057. </para>
  7058. <para>
  7059. <!-- TODO: severity has not been covered yet -->
  7060. To illustrate this, suppose you want the cache library
  7061. to log messages of severity DEBUG, and the rest of the
  7062. resolver code to log messages of severity INFO. To achieve
  7063. this you specify two loggers, one with the name
  7064. <quote>Resolver</quote> and severity INFO, and one with
  7065. the name <quote>Resolver.cache</quote> with severity
  7066. DEBUG. As there are no entries for other libraries (e.g.
  7067. the nsas), they will use the configuration for the module
  7068. (<quote>Resolver</quote>), so giving the desired behavior.
  7069. </para>
  7070. <para>
  7071. One special case is that of a module name of <quote>*</quote>
  7072. (asterisks), which is interpreted as <emphasis>any</emphasis>
  7073. module. You can set global logging options by using this,
  7074. including setting the logging configuration for a library
  7075. that is used by multiple modules (e.g. <quote>*.config</quote>
  7076. specifies the configuration library code in whatever
  7077. module is using it).
  7078. </para>
  7079. <para>
  7080. If there are multiple logger specifications in the
  7081. configuration that might match a particular logger, the
  7082. specification with the more specific logger name takes
  7083. precedence. For example, if there are entries for
  7084. both <quote>*</quote> and <quote>Resolver</quote>, the
  7085. resolver module &mdash; and all libraries it uses &mdash;
  7086. will log messages according to the configuration in the
  7087. second entry (<quote>Resolver</quote>). All other modules
  7088. will use the configuration of the first entry
  7089. (<quote>*</quote>). If there was also a configuration
  7090. entry for <quote>Resolver.cache</quote>, the cache library
  7091. within the resolver would use that in preference to the
  7092. entry for <quote>Resolver</quote>.
  7093. </para>
  7094. <para>
  7095. One final note about the naming. When specifying the
  7096. module name within a logger, use the name of the module
  7097. as specified in <command>bindctl</command>, e.g.
  7098. <quote>Resolver</quote> for the resolver module,
  7099. <quote>Xfrout</quote> for the xfrout module, etc. When
  7100. the message is logged, the message will include the name
  7101. of the logger generating the message, but with the module
  7102. name replaced by the name of the process implementing
  7103. the module (so for example, a message generated by the
  7104. <quote>Auth.cache</quote> logger will appear in the output
  7105. with a logger name of <quote>b10-auth.cache</quote>).
  7106. </para>
  7107. </section>
  7108. <section>
  7109. <title>severity (string)</title>
  7110. <para>
  7111. This specifies the category of messages logged.
  7112. Each message is logged with an associated severity which
  7113. may be one of the following (in descending order of
  7114. severity):
  7115. </para>
  7116. <itemizedlist>
  7117. <listitem>
  7118. <simpara> FATAL </simpara>
  7119. </listitem>
  7120. <listitem>
  7121. <simpara> ERROR </simpara>
  7122. </listitem>
  7123. <listitem>
  7124. <simpara> WARN </simpara>
  7125. </listitem>
  7126. <listitem>
  7127. <simpara> INFO </simpara>
  7128. </listitem>
  7129. <listitem>
  7130. <simpara> DEBUG </simpara>
  7131. </listitem>
  7132. </itemizedlist>
  7133. <para>
  7134. When the severity of a logger is set to one of these
  7135. values, it will only log messages of that severity, and
  7136. the severities above it. The severity may also be set to
  7137. NONE, in which case all messages from that logger are
  7138. inhibited.
  7139. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  7140. </para>
  7141. </section>
  7142. <section>
  7143. <title>output_options (list)</title>
  7144. <para>
  7145. Each logger can have zero or more
  7146. <option>output_options</option>. These specify where log
  7147. messages are sent to. These are explained in detail below.
  7148. </para>
  7149. <para>
  7150. The other options for a logger are:
  7151. </para>
  7152. </section>
  7153. <section>
  7154. <title>debuglevel (integer)</title>
  7155. <para>
  7156. When a logger's severity is set to DEBUG, this value
  7157. specifies what debug messages should be printed. It ranges
  7158. from 0 (least verbose) to 99 (most verbose).
  7159. </para>
  7160. <!-- TODO: complete this sentence:
  7161. The general classification of debug message types is
  7162. TODO; there's a ticket to determine these levels, see #1074
  7163. -->
  7164. <para>
  7165. If severity for the logger is not DEBUG, this value is ignored.
  7166. </para>
  7167. </section>
  7168. <section>
  7169. <title>additive (true or false)</title>
  7170. <para>
  7171. If this is true, the <option>output_options</option> from
  7172. the parent will be used. For example, if there are two
  7173. loggers configured; <quote>Resolver</quote> and
  7174. <quote>Resolver.cache</quote>, and <option>additive</option>
  7175. is true in the second, it will write the log messages
  7176. not only to the destinations specified for
  7177. <quote>Resolver.cache</quote>, but also to the destinations
  7178. as specified in the <option>output_options</option> in
  7179. the logger named <quote>Resolver</quote>.
  7180. <!-- TODO: check this -->
  7181. </para>
  7182. </section>
  7183. </section>
  7184. <section>
  7185. <title>Output Options</title>
  7186. <para>
  7187. The main settings for an output option are the
  7188. <option>destination</option> and a value called
  7189. <option>output</option>, the meaning of which depends on
  7190. the destination that is set.
  7191. </para>
  7192. <section>
  7193. <title>destination (string)</title>
  7194. <para>
  7195. The destination is the type of output. It can be one of:
  7196. </para>
  7197. <itemizedlist>
  7198. <listitem>
  7199. <simpara> console </simpara>
  7200. </listitem>
  7201. <listitem>
  7202. <simpara> file </simpara>
  7203. </listitem>
  7204. <listitem>
  7205. <simpara> syslog </simpara>
  7206. </listitem>
  7207. </itemizedlist>
  7208. </section>
  7209. <section>
  7210. <title>output (string)</title>
  7211. <para>
  7212. Depending on what is set as the output destination, this
  7213. value is interpreted as follows:
  7214. </para>
  7215. <variablelist>
  7216. <varlistentry>
  7217. <term><option>destination</option> is <quote>console</quote></term>
  7218. <listitem>
  7219. <para>
  7220. The value of output must be one of <quote>stdout</quote>
  7221. (messages printed to standard output) or
  7222. <quote>stderr</quote> (messages printed to standard
  7223. error).
  7224. </para>
  7225. <para>
  7226. Note: if output is set to <quote>stderr</quote> and a lot of
  7227. messages are produced in a short time (e.g. if the logging
  7228. level is set to DEBUG), you may occasionally see some messages
  7229. jumbled up together. This is due to a combination of the way
  7230. that messages are written to the screen and the unbuffered
  7231. nature of the standard error stream. If this occurs, it is
  7232. recommended that output be set to <quote>stdout</quote>.
  7233. </para>
  7234. </listitem>
  7235. </varlistentry>
  7236. <varlistentry>
  7237. <term><option>destination</option> is <quote>file</quote></term>
  7238. <listitem>
  7239. <para>
  7240. The value of output is interpreted as a file name;
  7241. log messages will be appended to this file.
  7242. </para>
  7243. </listitem>
  7244. </varlistentry>
  7245. <varlistentry>
  7246. <term><option>destination</option> is <quote>syslog</quote></term>
  7247. <listitem>
  7248. <para>
  7249. The value of output is interpreted as the
  7250. <command>syslog</command> facility (e.g.
  7251. <emphasis>local0</emphasis>) that should be used
  7252. for log messages.
  7253. </para>
  7254. </listitem>
  7255. </varlistentry>
  7256. </variablelist>
  7257. <para>
  7258. The other options for <option>output_options</option> are:
  7259. </para>
  7260. <section>
  7261. <title>flush (true of false)</title>
  7262. <para>
  7263. Flush buffers after each log message. Doing this will
  7264. reduce performance but will ensure that if the program
  7265. terminates abnormally, all messages up to the point of
  7266. termination are output.
  7267. </para>
  7268. </section>
  7269. <section>
  7270. <title>maxsize (integer)</title>
  7271. <para>
  7272. Only relevant when destination is file, this is maximum
  7273. file size of output files in bytes. When the maximum
  7274. size is reached, the file is renamed and a new file opened.
  7275. (For example, a ".1" is appended to the name &mdash;
  7276. if a ".1" file exists, it is renamed ".2",
  7277. etc.)
  7278. </para>
  7279. <para>
  7280. If this is 0, no maximum file size is used.
  7281. </para>
  7282. <note>
  7283. <simpara>
  7284. Due to a limitation of the underlying logging library
  7285. (log4cplus), rolling over the log files (from ".1" to
  7286. ".2", etc) may show odd results: There can be
  7287. multiple small files at the timing of roll over. This
  7288. can happen when multiple BIND 10 processes try to roll
  7289. over the files simultaneously.
  7290. Version 1.1.0 of log4cplus solved this problem, so if
  7291. this or higher version of log4cplus is used to build
  7292. BIND 10, it shouldn't happen. Even for older versions
  7293. it is normally expected to happen rarely unless the log
  7294. messages are produced very frequently by multiple
  7295. different processes.
  7296. </simpara>
  7297. </note>
  7298. </section>
  7299. <section>
  7300. <title>maxver (integer)</title>
  7301. <para>
  7302. Maximum number of old log files to keep around when
  7303. rolling the output file. Only relevant when
  7304. <option>destination</option> is <quote>file</quote>.
  7305. </para>
  7306. </section>
  7307. </section>
  7308. </section>
  7309. <section>
  7310. <title>Example session</title>
  7311. <para>
  7312. In this example we want to set the global logging to
  7313. write to the file <filename>/var/log/my_bind10.log</filename>,
  7314. at severity WARN. We want the authoritative server to
  7315. log at DEBUG with debuglevel 40, to a different file
  7316. (<filename>/tmp/debug_messages</filename>).
  7317. </para>
  7318. <para>
  7319. Start <command>bindctl</command>.
  7320. </para>
  7321. <para>
  7322. <screen>["login success "]
  7323. &gt; <userinput>config show Logging</userinput>
  7324. Logging/loggers [] list
  7325. </screen>
  7326. </para>
  7327. <para>
  7328. By default, no specific loggers are configured, in which
  7329. case the severity defaults to INFO and the output is
  7330. written to stderr.
  7331. </para>
  7332. <para>
  7333. Let's first add a default logger:
  7334. </para>
  7335. <!-- TODO: adding the empty loggers makes no sense -->
  7336. <para>
  7337. <screen>&gt; <userinput>config add Logging/loggers</userinput>
  7338. &gt; <userinput>config show Logging</userinput>
  7339. Logging/loggers/ list (modified)
  7340. </screen>
  7341. </para>
  7342. <para>
  7343. The loggers value line changed to indicate that it is no
  7344. longer an empty list:
  7345. </para>
  7346. <para>
  7347. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  7348. Logging/loggers[0]/name "" string (default)
  7349. Logging/loggers[0]/severity "INFO" string (default)
  7350. Logging/loggers[0]/debuglevel 0 integer (default)
  7351. Logging/loggers[0]/additive false boolean (default)
  7352. Logging/loggers[0]/output_options [] list (default)
  7353. </screen>
  7354. </para>
  7355. <para>
  7356. The name is mandatory, so we must set it. We will also
  7357. change the severity as well. Let's start with the global
  7358. logger.
  7359. </para>
  7360. <para>
  7361. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  7362. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  7363. &gt; <userinput>config show Logging/loggers</userinput>
  7364. Logging/loggers[0]/name "*" string (modified)
  7365. Logging/loggers[0]/severity "WARN" string (modified)
  7366. Logging/loggers[0]/debuglevel 0 integer (default)
  7367. Logging/loggers[0]/additive false boolean (default)
  7368. Logging/loggers[0]/output_options [] list (default)
  7369. </screen>
  7370. </para>
  7371. <para>
  7372. Of course, we need to specify where we want the log
  7373. messages to go, so we add an entry for an output option.
  7374. </para>
  7375. <para>
  7376. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  7377. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  7378. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  7379. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  7380. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  7381. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  7382. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  7383. </screen>
  7384. </para>
  7385. <para>
  7386. These aren't the values we are looking for.
  7387. </para>
  7388. <para>
  7389. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  7390. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  7391. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  7392. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  7393. </screen>
  7394. </para>
  7395. <para>
  7396. Which would make the entire configuration for this logger
  7397. look like:
  7398. </para>
  7399. <para>
  7400. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  7401. Logging/loggers[0]/name "*" string (modified)
  7402. Logging/loggers[0]/severity "WARN" string (modified)
  7403. Logging/loggers[0]/debuglevel 0 integer (default)
  7404. Logging/loggers[0]/additive false boolean (default)
  7405. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  7406. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  7407. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  7408. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  7409. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  7410. </screen>
  7411. </para>
  7412. <para>
  7413. That looks OK, so let's commit it before we add the
  7414. configuration for the authoritative server's logger.
  7415. </para>
  7416. <para>
  7417. <screen>&gt; <userinput> config commit</userinput></screen>
  7418. </para>
  7419. <para>
  7420. Now that we have set it, and checked each value along
  7421. the way, adding a second entry is quite similar.
  7422. </para>
  7423. <para>
  7424. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  7425. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  7426. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  7427. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  7428. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  7429. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  7430. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  7431. &gt; <userinput> config commit</userinput>
  7432. </screen>
  7433. </para>
  7434. <para>
  7435. And that's it. Once we have found whatever it was we
  7436. needed the debug messages for, we can simply remove the
  7437. second logger to let the authoritative server use the
  7438. same settings as the rest.
  7439. </para>
  7440. <para>
  7441. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  7442. &gt; <userinput> config commit</userinput>
  7443. </screen>
  7444. </para>
  7445. <para>
  7446. And every module will now be using the values from the
  7447. logger named <quote>*</quote>.
  7448. </para>
  7449. </section>
  7450. </section>
  7451. <section>
  7452. <title>Logging Message Format</title>
  7453. <para>
  7454. Each message written by BIND 10 to the configured logging
  7455. destinations comprises a number of components that identify
  7456. the origin of the message and, if the message indicates
  7457. a problem, information about the problem that may be
  7458. useful in fixing it.
  7459. </para>
  7460. <para>
  7461. Consider the message below logged to a file:
  7462. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  7463. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  7464. </para>
  7465. <para>
  7466. Note: the layout of messages written to the system logging
  7467. file (syslog) may be slightly different. This message has
  7468. been split across two lines here for display reasons; in the
  7469. logging file, it will appear on one line.)
  7470. </para>
  7471. <para>
  7472. The log message comprises a number of components:
  7473. <variablelist>
  7474. <varlistentry>
  7475. <term>2011-06-15 13:48:22.034</term>
  7476. <!-- TODO: timestamp repeated even if using syslog? -->
  7477. <listitem><para>
  7478. The date and time at which the message was generated.
  7479. </para></listitem>
  7480. </varlistentry>
  7481. <varlistentry>
  7482. <term>ERROR</term>
  7483. <listitem><para>
  7484. The severity of the message.
  7485. </para></listitem>
  7486. </varlistentry>
  7487. <varlistentry>
  7488. <term>[b10-resolver.asiolink]</term>
  7489. <listitem><para>
  7490. The source of the message. This comprises two components:
  7491. the BIND 10 process generating the message (in this
  7492. case, <command>b10-resolver</command>) and the module
  7493. within the program from which the message originated
  7494. (which in the example is the asynchronous I/O link
  7495. module, asiolink).
  7496. </para></listitem>
  7497. </varlistentry>
  7498. <varlistentry>
  7499. <term>ASIODNS_OPENSOCK</term>
  7500. <listitem><para>
  7501. The message identification. Every message in BIND 10
  7502. has a unique identification, which can be used as an
  7503. index into the <ulink
  7504. url="bind10-messages.html"><citetitle>BIND 10 Messages
  7505. Manual</citetitle></ulink> (<ulink
  7506. url="http://bind10.isc.org/docs/bind10-messages.html"
  7507. />) from which more information can be obtained.
  7508. </para></listitem>
  7509. </varlistentry>
  7510. <varlistentry>
  7511. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  7512. <listitem><para>
  7513. A brief description of the cause of the problem.
  7514. Within this text, information relating to the condition
  7515. that caused the message to be logged will be included.
  7516. In this example, error number 111 (an operating
  7517. system-specific error number) was encountered when
  7518. trying to open a TCP connection to port 53 on the
  7519. local system (address 127.0.0.1). The next step
  7520. would be to find out the reason for the failure by
  7521. consulting your system's documentation to identify
  7522. what error number 111 means.
  7523. </para></listitem>
  7524. </varlistentry>
  7525. </variablelist>
  7526. </para>
  7527. </section>
  7528. </chapter>
  7529. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  7530. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  7531. <!-- <index> <title>Index</title> </index> -->
  7532. </book>
  7533. <!--
  7534. TODO:
  7535. Overview
  7536. Getting BIND 10 Installed
  7537. Basics
  7538. Dependencies
  7539. Optional
  7540. Advanced
  7541. How Does Everything Work Together?
  7542. Need Help?
  7543. -->