bind10-guide.xml 283 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755
  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>This chapter covers those parts of BIND 10 that are common to
  3108. both servers. DHCPv4-specific details are covered in <xref linkend="dhcp4"/>,
  3109. while those details specific to DHCPv6 are described in <xref linkend="dhcp6"/>
  3110. </para>
  3111. <note>
  3112. <simpara>
  3113. In this release of BIND 10, the DHCPv4 and DHCPv6 servers
  3114. must be considered experimental.
  3115. </simpara>
  3116. </note>
  3117. <section id="dhcp-install-configure">
  3118. <title>DHCP Database Installation and Configuration</title>
  3119. <para>
  3120. BIND 10 DHCP stores its leases in a lease database. The software has been written in
  3121. a way that makes it possible to choose which database product should be used to
  3122. store the lease information. At present, only support for MySQL is provided, and that support must
  3123. be explicitly included when BIND 10 is built. This section covers the building of
  3124. BIND 10 with MySQL and the creation of the lease database.
  3125. </para>
  3126. <section>
  3127. <title>Install MySQL</title>
  3128. <para>
  3129. Install MySQL according to the instructions for your system. The client development
  3130. libraries must be installed.
  3131. </para>
  3132. </section>
  3133. <section>
  3134. <title>Build and Install BIND 10</title>
  3135. <para>
  3136. Build and install BIND 10 as described in <xref linkend="installation"/>, with
  3137. the following modification: to enable the MySQL database code, at the
  3138. "configure" step (see <xref linkend="configure"/>), specify the location of the
  3139. MySQL configuration program "mysql_config" with the "--with-dhcp-mysql" switch,
  3140. i.e.
  3141. <screen><userinput>./configure [other-options] --with-dhcp-mysql</userinput></screen>
  3142. ...if MySQL was installed in the default location, or:
  3143. <screen><userinput>./configure [other-options] --with-dhcp-mysql=<replaceable>path-to-mysql_config</replaceable></userinput></screen>
  3144. ...if not.
  3145. </para>
  3146. </section>
  3147. <section id="dhcp-database-create">
  3148. <title>Create MySQL Database and BIND 10 User</title>
  3149. <para>
  3150. The next task is to create both the lease database and the user under which the servers will
  3151. access it. A number of steps are required:
  3152. </para>
  3153. <para>
  3154. 1. Log into MySQL as "root":
  3155. <screen>$ <userinput>mysql -u root -p</userinput>
  3156. Enter password:<userinput/>
  3157. :<userinput/>
  3158. mysql></screen>
  3159. </para>
  3160. <para>
  3161. 2. Create the database:
  3162. <screen>mysql> <userinput>CREATE DATABASE <replaceable>database-name</replaceable>;</userinput></screen>
  3163. ... <replaceable>database-name</replaceable> is the name you have chosen for the database.
  3164. </para>
  3165. <para>
  3166. 3. Create the database tables:
  3167. <screen>mysql> <userinput>CONNECT <replaceable>database-name</replaceable>;</userinput>
  3168. mysql> <userinput>SOURCE <replaceable>path-to-bind10</replaceable>/share/bind10/dhcpdb_create.mysql</userinput></screen>
  3169. </para>
  3170. <para>
  3171. 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:
  3172. <screen>mysql> <userinput>CREATE USER '<replaceable>user-name</replaceable>'@'localhost' IDENTIFIED BY '<replaceable>password</replaceable>';</userinput>
  3173. mysql> <userinput>GRANT ALL ON <replaceable>database-name</replaceable>.* TO '<replaceable>user-name</replaceable>'@'localhost';</userinput></screen>
  3174. </para>
  3175. <para>
  3176. 5. Exit MySQL:
  3177. <screen>mysql> <userinput>quit</userinput>
  3178. Bye<userinput/>
  3179. $</screen>
  3180. </para>
  3181. </section>
  3182. </section>
  3183. </chapter>
  3184. <chapter id="dhcp4">
  3185. <title>The DHCPv4 Server</title>
  3186. <section id="dhcp4-start-stop">
  3187. <title>Starting and Stopping the DHCPv4 Server</title>
  3188. <para>
  3189. <command>b10-dhcp4</command> is the BIND 10 DHCPv4 server and, like other
  3190. parts of BIND 10, is configured through the <command>bindctl</command>
  3191. program.
  3192. </para>
  3193. <para>
  3194. After starting BIND 10 and entering bindctl, the first step
  3195. in configuring the server is to add it to the list of running BIND 10 services.
  3196. <screen>
  3197. &gt; <userinput>config add Init/components b10-dhcp4</userinput>
  3198. &gt; <userinput>config set Init/components/b10-dhcp4/kind dispensable</userinput>
  3199. &gt; <userinput>config commit</userinput>
  3200. </screen>
  3201. </para>
  3202. <para>
  3203. To remove <command>b10-dhcp4</command> from the set of running services,
  3204. the <command>b10-dhcp4</command> is removed from list of Init components:
  3205. <screen>
  3206. &gt; <userinput>config remove Init/components b10-dhcp4</userinput>
  3207. &gt; <userinput>config commit</userinput>
  3208. </screen>
  3209. </para>
  3210. <para>
  3211. Note that the server was only removed from the list, so BIND10 will not
  3212. restart it, but the server itself is still running. Hence it is usually
  3213. desired to stop it:
  3214. <screen>
  3215. &gt; <userinput>Dhcp4 shutdown</userinput>
  3216. </screen>
  3217. </para>
  3218. <para>
  3219. On start-up, the server will detect available network interfaces
  3220. and will attempt to open UDP sockets on all interfaces that
  3221. are up, running, are not loopback, and have IPv4 address
  3222. assigned.
  3223. The server will then listen to incoming traffic. Currently
  3224. supported client messages are DISCOVER and REQUEST. The server
  3225. will respond to them with OFFER and ACK, respectively.
  3226. Since the DHCPv4 server opens privileged ports, it requires root
  3227. access. Make sure you run this daemon as root.
  3228. </para>
  3229. </section>
  3230. <section id="dhcp4-configuration">
  3231. <title>Configuring the DHCPv4 Server</title>
  3232. <para>
  3233. Once the server is started, it can be configured. To view the
  3234. current configuration, use the following command in <command>bindctl</command>:
  3235. <screen>
  3236. &gt; <userinput>config show Dhcp4</userinput></screen>
  3237. When starting the DHCPv4 daemon for the first time, the default configuration
  3238. will be available. It will look similar to this:
  3239. <screen>
  3240. &gt; <userinput>config show Dhcp4</userinput>
  3241. Dhcp4/interfaces/ list (default)
  3242. Dhcp4/renew-timer 1000 integer (default)
  3243. Dhcp4/rebind-timer 2000 integer (default)
  3244. Dhcp4/valid-lifetime 4000 integer (default)
  3245. Dhcp4/option-data [] list (default)
  3246. Dhcp4/lease-database/type "memfile" string (default)
  3247. Dhcp4/lease-database/name "" string (default)
  3248. Dhcp4/lease-database/user "" string (default)
  3249. Dhcp4/lease-database/host "" string (default)
  3250. Dhcp4/lease-database/password "" string (default)
  3251. Dhcp4/subnet4 [] list (default)
  3252. </screen>
  3253. </para>
  3254. <para>
  3255. To change one of the parameters, simply follow
  3256. the usual <command>bindctl</command> procedure. For example, to make the
  3257. leases longer, change their valid-lifetime parameter:
  3258. <screen>
  3259. &gt; <userinput>config set Dhcp4/valid-lifetime 7200</userinput>
  3260. &gt; <userinput>config commit</userinput></screen>
  3261. Please note that most Dhcp4 parameters are of global scope
  3262. and apply to all defined subnets, unless they are overridden on a
  3263. per-subnet basis.
  3264. </para>
  3265. <section>
  3266. <title>Database Configuration</title>
  3267. <para>
  3268. All leases issued by the server are stored in the lease database. Currently,
  3269. the only supported database is MySQL
  3270. <footnote>
  3271. <para>
  3272. The server comes with an in-memory database ("memfile") configured as the default
  3273. database. This is used for internal testing and is not supported. In addition,
  3274. it does not store lease information on disk: lease information will be lost if the
  3275. server is restarted.
  3276. </para>
  3277. </footnote>, and so the server must be configured to
  3278. access the correct database with the appropriate credentials.
  3279. </para>
  3280. <note>
  3281. <para>
  3282. Database access information must be configured for the DHCPv4 server, even if
  3283. it has already been configured for the DHCPv6 server. The servers store their
  3284. information independently, so each server can use a separate
  3285. database or both servers can use the same database.
  3286. </para>
  3287. </note>
  3288. <para>
  3289. Database configuration is controlled through the Dhcp4/lease-database parameters.
  3290. The type of the database must be set to MySQL (although the string entered is "mysql"):
  3291. <screen>
  3292. &gt; <userinput>config set Dhcp4/lease-database/type "mysql"</userinput>
  3293. </screen>
  3294. Next, the name of the database is to hold the leases must be set: this is the
  3295. name used when the lease database was created (see <xref linkend="dhcp-database-create"/>).
  3296. <screen>
  3297. &gt; <userinput>config set Dhcp4/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  3298. </screen>
  3299. If the database is located on a different system to the DHCPv4 server, the
  3300. database host name must also be specified (although note that this configuration
  3301. may have a severe impact on server performance):
  3302. <screen>
  3303. &gt; <userinput>config set Dhcp4/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  3304. </screen>
  3305. The usual state of affairs will be to have the database on the same machine as the
  3306. DHCPv4 server. In this case, set the value to the empty string (this is the default):
  3307. <screen>
  3308. &gt; <userinput>config set Dhcp4/lease-database/host ""</userinput>
  3309. </screen>
  3310. </para>
  3311. <para>
  3312. Finally, the credentials of the account under which the server will access the database
  3313. should be set:
  3314. <screen>
  3315. &gt; <userinput>config set Dhcp4/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  3316. &gt; <userinput>config set Dhcp4/lease-database/password "<replaceable>password</replaceable>"</userinput>
  3317. </screen>
  3318. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  3319. </para>
  3320. <note>
  3321. <para>The password is echoed when entered and is stored in clear text in the BIND 10 configuration
  3322. database. Improved password security will be added in a future version of BIND 10 DHCP</para>
  3323. </note>
  3324. </section>
  3325. <section id="dhcp4-interface-selection">
  3326. <title>Interface selection</title>
  3327. <para>
  3328. When DHCPv4 server starts up, by default it will listen to the DHCP
  3329. traffic and respond to it on all interfaces detected during startup.
  3330. However, in many cases it is desired to configure the server to listen and
  3331. respond on selected interfaces only. The sample commands in this section
  3332. show how to make interface selection using bindctl.
  3333. </para>
  3334. <para>
  3335. The default configuration can be presented with the following command:
  3336. <screen>
  3337. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  3338. <userinput>Dhcp4/interfaces[0] "*" string</userinput></screen>
  3339. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  3340. </para>
  3341. <para>
  3342. In order to override the default configuration, the existing entry can be replaced
  3343. with the actual interface name:
  3344. <screen>
  3345. &gt; <userinput>config set Dhcp4/interfaces[0] eth1</userinput>
  3346. &gt; <userinput>config commit</userinput></screen>
  3347. Other interface names can be added on one-by-one basis:
  3348. <screen>
  3349. &gt; <userinput>config add Dhcp4/interfaces eth2</userinput>
  3350. &gt; <userinput>config commit</userinput></screen>
  3351. Configuration will now contain two interfaces which can be presented as follows:
  3352. <screen>
  3353. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  3354. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  3355. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput></screen>
  3356. When configuration gets committed, the server will start to listen on
  3357. eth1 and eth2 interfaces only.
  3358. </para>
  3359. <para>
  3360. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  3361. interface names:
  3362. <screen>
  3363. &gt; <userinput>config add Dhcp4/interfaces *</userinput>
  3364. &gt; <userinput>config commit</userinput></screen>
  3365. This will result in the following configuration:
  3366. <screen>
  3367. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  3368. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  3369. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput>
  3370. <userinput>Dhcp4/interfaces[2] "*" string</userinput></screen>
  3371. The presence of the wildcard name implies that server will listen on all interfaces.
  3372. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  3373. <screen>
  3374. &gt; <userinput>config remove Dhcp4/interfaces[2]</userinput>
  3375. &gt; <userinput>config commit</userinput></screen>
  3376. </para>
  3377. </section>
  3378. <section id="dhcp4-address-config">
  3379. <title>Configuration of IPv4 Address Pools</title>
  3380. <para>
  3381. The essential role of DHCPv4 server is address assignment. The server
  3382. has to be configured with at least one subnet and one pool of dynamic
  3383. addresses to be managed. For example, assume that the server
  3384. is connected to a network segment that uses the 192.0.2.0/24
  3385. prefix. The Administrator of that network has decided that addresses from range
  3386. 192.0.2.10 to 192.0.2.20 are going to be managed by the Dhcp4
  3387. server. Such a configuration can be achieved in the following way:
  3388. <screen>
  3389. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3390. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  3391. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  3392. &gt; <userinput>config commit</userinput></screen>
  3393. Note that subnet is defined as a simple string, but the pool parameter
  3394. is actually a list of pools: for this reason, the pool definition is
  3395. enclosed in square brackets, even though only one range of addresses
  3396. is specified.</para>
  3397. <para>It is possible to define more than one pool in a
  3398. subnet: continuing the previous example, further assume that
  3399. 192.0.2.64/26 should be also be managed by the server. It could be written as
  3400. 192.0.2.64 to 192.0.2.127. Alternatively, it can be expressed more simply as
  3401. 192.0.2.64/26. Both formats are supported by Dhcp4 and can be mixed in the pool list.
  3402. For example, one could define the following pools:
  3403. <screen>
  3404. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10-192.0.2.20", "192.0.2.64/26" ]</userinput>
  3405. &gt; <userinput>config commit</userinput></screen>
  3406. The number of pools is not limited, but for performance reasons it is recommended to
  3407. use as few as possible. Space and tabulations in pool definitions are ignored, so
  3408. spaces before and after hyphen are optional. They can be used to improve readability.
  3409. </para>
  3410. <para>
  3411. The server may be configured to serve more than one subnet. To add a second subnet,
  3412. use a command similar to the following:
  3413. <screen>
  3414. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3415. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.3.0/24"</userinput>
  3416. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.3.0/24" ]</userinput>
  3417. &gt; <userinput>config commit</userinput></screen>
  3418. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  3419. previous example. The <command>config add Dhcp4/subnet4</command> command adds
  3420. another (second) subnet. It can be referred to as
  3421. <command>Dhcp4/subnet4[1]</command>. In this example, we allow server to
  3422. dynamically assign all addresses available in the whole subnet.
  3423. </para>
  3424. <para>
  3425. When configuring a DHCPv4 server using prefix/length notation, please pay
  3426. attention to the boundary values. When specifying that the server should use
  3427. a given pool, it will be able to allocate also first (typically network
  3428. address) and the last (typically broadcast address) address from that pool.
  3429. In the aforementioned example of pool 192.0.3.0/24, both 192.0.3.0 and
  3430. 192.0.3.255 addresses may be assigned as well. This may be invalid in some
  3431. network configurations. If you want to avoid this, please use the "min-max" notation.
  3432. </para>
  3433. </section>
  3434. <section id="dhcp4-std-options">
  3435. <title>Standard DHCPv4 options</title>
  3436. <para>
  3437. One of the major features of DHCPv4 server is to provide configuration
  3438. options to clients. Although there are several options that require
  3439. special behavior, most options are sent by the server only if the client
  3440. explicitly requested them. The following example shows how to
  3441. configure DNS servers, which is one of the most frequently used
  3442. options. Options specified in this way are considered global and apply
  3443. to all configured subnets.
  3444. <screen>
  3445. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3446. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  3447. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  3448. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3449. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3450. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.3.1, 192.0.3.2"</userinput>
  3451. &gt; <userinput>config commit</userinput>
  3452. </screen>
  3453. </para>
  3454. <para>
  3455. The first line creates new entry in option-data table. It
  3456. contains information on all global options that the server is
  3457. supposed to configure in all subnets. The second line specifies
  3458. option name. For a complete list of currently supported names,
  3459. see <xref linkend="dhcp4-std-options-list"/> below.
  3460. The third line specifies option code, which must match one of the
  3461. values from that list. Line 4 specifies option space, which must always
  3462. be set to "dhcp4" as these are standard DHCPv4 options. For
  3463. other option spaces, including custom option spaces, see <xref
  3464. linkend="dhcp4-option-spaces"/>. The fifth line specifies the format in
  3465. which the data will be entered: use of CSV (comma
  3466. separated values) is recommended. The sixth line gives the actual value to
  3467. be sent to clients. Data is specified as a normal text, with
  3468. values separated by commas if more than one value is
  3469. allowed.
  3470. </para>
  3471. <para>
  3472. Options can also be configured as hexadecimal values. If csv-format is
  3473. set to false, option data must be specified as a hex string. The
  3474. following commands configure the domain-name-servers option for all
  3475. subnets with the following addresses: 192.0.3.1 and 192.0.3.2.
  3476. Note that csv-format is set to false.
  3477. <screen>
  3478. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3479. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  3480. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  3481. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3482. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format false</userinput>
  3483. &gt; <userinput>config set Dhcp4/option-data[0]/data "C0 00 03 01 C0 00 03 02"</userinput>
  3484. &gt; <userinput>config commit</userinput>
  3485. </screen>
  3486. </para>
  3487. <para>
  3488. It is possible to override options on a per-subnet basis. If
  3489. clients connected to most of your subnets are expected to get the
  3490. same values of a given option, you should use global options: you
  3491. can then override specific values for a small number of subnets.
  3492. On the other hand, if you use different values in each subnet,
  3493. it does not make sense to specify global option values
  3494. (Dhcp4/option-data), rather you should set only subnet-specific values
  3495. (Dhcp4/subnet[X]/option-data[Y]).
  3496. </para>
  3497. <para>
  3498. The following commands override the global
  3499. DNS servers option for a particular subnet, setting a single DNS
  3500. server with address 192.0.2.3.
  3501. <screen>
  3502. &gt; <userinput>config add Dhcp4/subnet4[0]/option-data</userinput>
  3503. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/name "domain-name-servers"</userinput>
  3504. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/code 6</userinput>
  3505. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/space "dhcp4"</userinput>
  3506. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/csv-format true</userinput>
  3507. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/data "192.0.2.3"</userinput>
  3508. &gt; <userinput>config commit</userinput></screen>
  3509. </para>
  3510. <note>
  3511. <para>In a future version of Kea, it will not be necessary to specify
  3512. the option code, space and csv-format fields as they will be set
  3513. automatically.</para>
  3514. </note>
  3515. <para>
  3516. The currently supported standard DHCPv4 options are
  3517. listed in <xref linkend="dhcp4-std-options-list"/>
  3518. and <xref linkend="dhcp4-std-options-list-part2"/>.
  3519. The "Name" and "Code"
  3520. are the values that should be used as a name in the option-data
  3521. structures. "Type" designates the format of the data: the meanings of
  3522. the various types is given in <xref linkend="dhcp-types"/>.
  3523. </para>
  3524. <para>
  3525. Some options are designated as arrays, which means that more than one
  3526. value is allowed in such an option. For example the option time-servers
  3527. allows the specification of more than one IPv4 address, so allowing
  3528. clients to obtain the the addresses of multiple NTP servers.
  3529. </para>
  3530. <!-- @todo: describe record types -->
  3531. <para>
  3532. The <xref linkend="dhcp4-custom-options"/> describes the configuration
  3533. syntax to create custom option definitions (formats). It is generally not
  3534. allowed to create custom definitions for standard options, even if the
  3535. definition being created matches the actual option format defined in the
  3536. RFCs. There is an exception from this rule for standard options for which
  3537. Kea does not provide a definition yet. In order to use such options,
  3538. a server administrator must create a definition as described in
  3539. <xref linkend="dhcp4-custom-options"/> in the 'dhcp4' option space. This
  3540. definition should match the option format described in the relevant
  3541. RFC but configuration mechanism would allow any option format as it has
  3542. no means to validate it at the moment.
  3543. </para>
  3544. <para>
  3545. <table frame="all" id="dhcp4-std-options-list">
  3546. <title>List of standard DHCPv4 options</title>
  3547. <tgroup cols='4'>
  3548. <colspec colname='name'/>
  3549. <colspec colname='code'/>
  3550. <colspec colname='type'/>
  3551. <colspec colname='array'/>
  3552. <thead>
  3553. <row>
  3554. <entry>Name</entry>
  3555. <entry>Code</entry>
  3556. <entry>Type</entry>
  3557. <entry>Array?</entry>
  3558. </row>
  3559. </thead>
  3560. <tbody>
  3561. <row><entry>subnet-mask</entry><entry>1</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3562. <row><entry>time-offset</entry><entry>2</entry><entry>int32</entry><entry>false</entry></row>
  3563. <row><entry>routers</entry><entry>3</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3564. <row><entry>time-servers</entry><entry>4</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3565. <row><entry>name-servers</entry><entry>5</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3566. <row><entry>domain-name-servers</entry><entry>6</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3567. <row><entry>log-servers</entry><entry>7</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3568. <row><entry>cookie-servers</entry><entry>8</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3569. <row><entry>lpr-servers</entry><entry>9</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3570. <row><entry>impress-servers</entry><entry>10</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3571. <row><entry>resource-location-servers</entry><entry>11</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3572. <row><entry>host-name</entry><entry>12</entry><entry>string</entry><entry>false</entry></row>
  3573. <row><entry>boot-size</entry><entry>13</entry><entry>uint16</entry><entry>false</entry></row>
  3574. <row><entry>merit-dump</entry><entry>14</entry><entry>string</entry><entry>false</entry></row>
  3575. <row><entry>domain-name</entry><entry>15</entry><entry>fqdn</entry><entry>false</entry></row>
  3576. <row><entry>swap-server</entry><entry>16</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3577. <row><entry>root-path</entry><entry>17</entry><entry>string</entry><entry>false</entry></row>
  3578. <row><entry>extensions-path</entry><entry>18</entry><entry>string</entry><entry>false</entry></row>
  3579. <row><entry>ip-forwarding</entry><entry>19</entry><entry>boolean</entry><entry>false</entry></row>
  3580. <row><entry>non-local-source-routing</entry><entry>20</entry><entry>boolean</entry><entry>false</entry></row>
  3581. <row><entry>policy-filter</entry><entry>21</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3582. <row><entry>max-dgram-reassembly</entry><entry>22</entry><entry>uint16</entry><entry>false</entry></row>
  3583. <row><entry>default-ip-ttl</entry><entry>23</entry><entry>uint8</entry><entry>false</entry></row>
  3584. <row><entry>path-mtu-aging-timeout</entry><entry>24</entry><entry>uint32</entry><entry>false</entry></row>
  3585. <row><entry>path-mtu-plateau-table</entry><entry>25</entry><entry>uint16</entry><entry>true</entry></row>
  3586. <row><entry>interface-mtu</entry><entry>26</entry><entry>uint16</entry><entry>false</entry></row>
  3587. <row><entry>all-subnets-local</entry><entry>27</entry><entry>boolean</entry><entry>false</entry></row>
  3588. <row><entry>broadcast-address</entry><entry>28</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3589. <row><entry>perform-mask-discovery</entry><entry>29</entry><entry>boolean</entry><entry>false</entry></row>
  3590. <row><entry>mask-supplier</entry><entry>30</entry><entry>boolean</entry><entry>false</entry></row>
  3591. <row><entry>router-discovery</entry><entry>31</entry><entry>boolean</entry><entry>false</entry></row>
  3592. <row><entry>router-solicitation-address</entry><entry>32</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3593. <row><entry>static-routes</entry><entry>33</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3594. <row><entry>trailer-encapsulation</entry><entry>34</entry><entry>boolean</entry><entry>false</entry></row>
  3595. <row><entry>arp-cache-timeout</entry><entry>35</entry><entry>uint32</entry><entry>false</entry></row>
  3596. <row><entry>ieee802-3-encapsulation</entry><entry>36</entry><entry>boolean</entry><entry>false</entry></row>
  3597. <row><entry>default-tcp-ttl</entry><entry>37</entry><entry>uint8</entry><entry>false</entry></row>
  3598. <row><entry>tcp-keepalive-internal</entry><entry>38</entry><entry>uint32</entry><entry>false</entry></row>
  3599. <row><entry>tcp-keepalive-garbage</entry><entry>39</entry><entry>boolean</entry><entry>false</entry></row>
  3600. </tbody>
  3601. </tgroup>
  3602. </table>
  3603. </para>
  3604. <para>
  3605. <table frame="all" id="dhcp4-std-options-list-part2">
  3606. <title>List of standard DHCPv4 options (continued)</title>
  3607. <tgroup cols='4'>
  3608. <colspec colname='name'/>
  3609. <colspec colname='code'/>
  3610. <colspec colname='type'/>
  3611. <colspec colname='array'/>
  3612. <thead>
  3613. <row>
  3614. <entry>Name</entry>
  3615. <entry>Code</entry>
  3616. <entry>Type</entry>
  3617. <entry>Array?</entry>
  3618. </row>
  3619. </thead>
  3620. <tbody>
  3621. <row><entry>nis-domain</entry><entry>40</entry><entry>string</entry><entry>false</entry></row>
  3622. <row><entry>nis-servers</entry><entry>41</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3623. <row><entry>ntp-servers</entry><entry>42</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3624. <row><entry>vendor-encapsulated-options</entry><entry>43</entry><entry>empty</entry><entry>false</entry></row>
  3625. <row><entry>netbios-name-servers</entry><entry>44</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3626. <row><entry>netbios-dd-server</entry><entry>45</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3627. <row><entry>netbios-node-type</entry><entry>46</entry><entry>uint8</entry><entry>false</entry></row>
  3628. <row><entry>netbios-scope</entry><entry>47</entry><entry>string</entry><entry>false</entry></row>
  3629. <row><entry>font-servers</entry><entry>48</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3630. <row><entry>x-display-manager</entry><entry>49</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3631. <row><entry>dhcp-requested-address</entry><entry>50</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3632. <!-- Lease time should not be configured by a user.
  3633. <row><entry>dhcp-lease-time</entry><entry>51</entry><entry>uint32</entry><entry>false</entry></row>
  3634. -->
  3635. <row><entry>dhcp-option-overload</entry><entry>52</entry><entry>uint8</entry><entry>false</entry></row>
  3636. <!-- Message Type, Server Identifier and Parameter Request List should not be configured by a user.
  3637. <row><entry>dhcp-message-type</entry><entry>53</entry><entry>uint8</entry><entry>false</entry></row>
  3638. <row><entry>dhcp-server-identifier</entry><entry>54</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3639. <row><entry>dhcp-parameter-request-list</entry><entry>55</entry><entry>uint8</entry><entry>true</entry></row>
  3640. -->
  3641. <row><entry>dhcp-message</entry><entry>56</entry><entry>string</entry><entry>false</entry></row>
  3642. <row><entry>dhcp-max-message-size</entry><entry>57</entry><entry>uint16</entry><entry>false</entry></row>
  3643. <!-- Renewal and rebinding time should not be configured by a user.
  3644. <row><entry>dhcp-renewal-time</entry><entry>58</entry><entry>uint32</entry><entry>false</entry></row>
  3645. <row><entry>dhcp-rebinding-time</entry><entry>59</entry><entry>uint32</entry><entry>false</entry></row>
  3646. -->
  3647. <row><entry>vendor-class-identifier</entry><entry>60</entry><entry>binary</entry><entry>false</entry></row>
  3648. <!-- Client identifier should not be configured by a user.
  3649. <row><entry>dhcp-client-identifier</entry><entry>61</entry><entry>binary</entry><entry>false</entry></row>
  3650. -->
  3651. <row><entry>nwip-domain-name</entry><entry>62</entry><entry>string</entry><entry>false</entry></row>
  3652. <row><entry>nwip-suboptions</entry><entry>63</entry><entry>binary</entry><entry>false</entry></row>
  3653. <row><entry>tftp-server-name</entry><entry>66</entry><entry>string</entry><entry>false</entry></row>
  3654. <row><entry>boot-file-name</entry><entry>67</entry><entry>string</entry><entry>false</entry></row>
  3655. <row><entry>user-class</entry><entry>77</entry><entry>binary</entry><entry>false</entry></row>
  3656. <row><entry>fqdn</entry><entry>81</entry><entry>record</entry><entry>false</entry></row>
  3657. <row><entry>dhcp-agent-options</entry><entry>82</entry><entry>empty</entry><entry>false</entry></row>
  3658. <row><entry>authenticate</entry><entry>90</entry><entry>binary</entry><entry>false</entry></row>
  3659. <row><entry>client-last-transaction-time</entry><entry>91</entry><entry>uint32</entry><entry>false</entry></row>
  3660. <row><entry>associated-ip</entry><entry>92</entry><entry>ipv4-address</entry><entry>true</entry></row>
  3661. <row><entry>subnet-selection</entry><entry>118</entry><entry>ipv4-address</entry><entry>false</entry></row>
  3662. <row><entry>domain-search</entry><entry>119</entry><entry>binary</entry><entry>false</entry></row>
  3663. <row><entry>vivco-suboptions</entry><entry>124</entry><entry>binary</entry><entry>false</entry></row>
  3664. <row><entry>vivso-suboptions</entry><entry>125</entry><entry>binary</entry><entry>false</entry></row>
  3665. </tbody>
  3666. </tgroup>
  3667. </table>
  3668. </para>
  3669. <para>
  3670. <table frame="all" id="dhcp-types">
  3671. <title>List of standard DHCP option types</title>
  3672. <tgroup cols='2'>
  3673. <colspec colname='name'/>
  3674. <colspec colname='meaning'/>
  3675. <thead>
  3676. <row><entry>Name</entry><entry>Meaning</entry></row>
  3677. </thead>
  3678. <tbody>
  3679. <row><entry>binary</entry><entry>An arbitrary string of bytes, specified as a set of hexadecimal digits.</entry></row>
  3680. <row><entry>boolean</entry><entry>Boolean value with allowed values true or false</entry></row>
  3681. <row><entry>empty</entry><entry>No value, data is carried in suboptions</entry></row>
  3682. <row><entry>fqdn</entry><entry>Fully qualified domain name (e.g. www.example.com)</entry></row>
  3683. <row><entry>ipv4-address</entry><entry>IPv4 address in the usual dotted-decimal notation (e.g. 192.0.2.1)</entry></row>
  3684. <row><entry>ipv6-address</entry><entry>IPv6 address in the usual colon notation (e.g. 2001:db8::1)</entry></row>
  3685. <row><entry>record</entry><entry>Structured data that may comprise any types (except "record" and "empty")</entry></row>
  3686. <row><entry>string</entry><entry>Any text</entry></row>
  3687. <row><entry>uint8</entry><entry>8 bit unsigned integer with allowed values 0 to 255</entry></row>
  3688. <row><entry>uint16</entry><entry>16 bit unsinged integer with allowed values 0 to 65535</entry></row>
  3689. <row><entry>uint32</entry><entry>32 bit unsigned integer with allowed values 0 to 4294967295</entry></row>
  3690. </tbody>
  3691. </tgroup>
  3692. </table>
  3693. </para>
  3694. </section>
  3695. <section id="dhcp4-custom-options">
  3696. <title>Custom DHCPv4 options</title>
  3697. <para>It is also possible to define options other than the standard ones.
  3698. Assume that we want to define a new DHCPv4 option called "foo" which will have
  3699. code 222 and will convey a single unsigned 32 bit integer value. We can define
  3700. such an option by using the following commands:
  3701. <screen>
  3702. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3703. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  3704. &gt; <userinput>config set Dhcp4/option-def[0]/code 222</userinput>
  3705. &gt; <userinput>config set Dhcp4/option-def[0]/type "uint32"</userinput>
  3706. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  3707. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  3708. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  3709. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  3710. &gt; <userinput>config commit</userinput></screen>
  3711. The "false" value of the "array" parameter determines that the option
  3712. does NOT comprise an array of "uint32" values but rather a single value.
  3713. Two other parameters have been left blank: "record-types" and "encapsulate".
  3714. The former specifies the comma separated list of option data fields if the
  3715. option comprises a record of data fields. The "record-fields" value should
  3716. be non-empty if the "type" is set to "record". Otherwise it must be left
  3717. blank. The latter parameter specifies the name of the option space being
  3718. encapsulated by the particular option. If the particular option does not
  3719. encapsulate any option space it should be left blank.
  3720. Note that the above set of comments define the format of the new option and do not
  3721. set its values.
  3722. </para>
  3723. <note>
  3724. <para>
  3725. In the current release the default values are not propagated to the
  3726. parser when the new configuration is being set. Therefore, all
  3727. parameters must be specified at all times, even if their values are
  3728. left blank.
  3729. </para>
  3730. </note>
  3731. <para>Once the new option format is defined, its value is set
  3732. in the same way as for a standard option. For example the following
  3733. commands set a global value that applies to all subnets.
  3734. <screen>
  3735. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3736. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  3737. &gt; <userinput>config set Dhcp4/option-data[0]/code 222</userinput>
  3738. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3739. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3740. &gt; <userinput>config set Dhcp4/option-data[0]/data "12345"</userinput>
  3741. &gt; <userinput>config commit</userinput></screen>
  3742. </para>
  3743. <para>New options can take more complex forms than simple use of
  3744. primitives (uint8, string, ipv4-address etc): it is possible to
  3745. define an option comprising a number of existing primitives.
  3746. </para>
  3747. <para>Assume we want to define a new option that will consist of
  3748. an IPv4 address, followed by unsigned 16 bit integer, followed by
  3749. a boolean value, followed by a text string. Such an option could
  3750. be defined in the following way:
  3751. <screen>
  3752. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3753. &gt; <userinput>config set Dhcp4/option-def[0]/name "bar"</userinput>
  3754. &gt; <userinput>config set Dhcp4/option-def[0]/code 223</userinput>
  3755. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  3756. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  3757. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  3758. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, boolean, string"</userinput>
  3759. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  3760. </screen>
  3761. The "type" is set to "record" to indicate that the option contains
  3762. multiple values of different types. These types are given as a comma-separated
  3763. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  3764. </para>
  3765. <para>
  3766. The values of the option are set as follows:
  3767. <screen>
  3768. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3769. &gt; <userinput>config set Dhcp4/option-data[0]/name "bar"</userinput>
  3770. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  3771. &gt; <userinput>config set Dhcp4/option-data[0]/code 223</userinput>
  3772. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3773. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.100, 123, true, Hello World"</userinput>
  3774. &gt; <userinput>config commit</userinput></screen>
  3775. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  3776. list of values. The values in the "data" must correspond to the types set in
  3777. the "record-types" field of the option definition.
  3778. </para>
  3779. <note>
  3780. <para>
  3781. It is recommended that boolean values are specified using "true" and "false"
  3782. strings. This helps to prevent errors when typing multiple comma separated
  3783. values, as it make it easier to identify the type of the value being typed,
  3784. and compare it with the order of data fields. Nevetheless, it is possible
  3785. to use integer values: "1" and "0", instead of "true" and "false"
  3786. accordingly. If other integer value is specified, the configuration is
  3787. rejected.
  3788. </para>
  3789. </note>
  3790. </section>
  3791. <section id="dhcp4-vendor-opts">
  3792. <title>DHCPv4 vendor specific options</title>
  3793. <para>
  3794. Currently there are three option spaces defined: dhcp4 (to
  3795. be used in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there
  3796. is also vendor-encapsulated-options-space, which is empty by default, but options
  3797. can be defined in it. Those options are called vendor-specific
  3798. information options. The following examples show how to define
  3799. an option "foo" with code 1 that consists of an IPv4 address, an
  3800. unsigned 16 bit integer and a string. The "foo" option is conveyed
  3801. in a vendor specific information option.
  3802. </para>
  3803. <para>
  3804. The first step is to define the format of the option:
  3805. <screen>
  3806. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3807. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  3808. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  3809. &gt; <userinput>config set Dhcp4/option-def[0]/space "vendor-encapsulated-options-space"</userinput>
  3810. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  3811. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  3812. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, string"</userinput>
  3813. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulates ""</userinput>
  3814. &gt; <userinput>config commit</userinput>
  3815. </screen>
  3816. (Note that the option space is set to "vendor-encapsulated-options-space".)
  3817. Once the option format is defined, the next step is to define actual values
  3818. for that option:
  3819. <screen>
  3820. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3821. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  3822. &gt; <userinput>config set Dhcp4/option-data[0]/space "vendor-encapsulated-options-space"</userinput>
  3823. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  3824. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3825. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3, 123, Hello World"</userinput>
  3826. &gt; <userinput>config commit</userinput></screen>
  3827. We also set up a dummy value for vendor-opts, the option that conveys our sub-option "foo".
  3828. This is required else the option will not be included in messages sent to the client.
  3829. <screen>
  3830. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3831. &gt; <userinput>config set Dhcp4/option-data[1]/name "vendor-encapsulated-options"</userinput>
  3832. &gt; <userinput>config set Dhcp4/option-data[1]/space "dhcp4"</userinput>
  3833. &gt; <userinput>config set Dhcp4/option-data[1]/code 43</userinput>
  3834. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format false</userinput>
  3835. &gt; <userinput>config set Dhcp4/option-data[1]/data ""</userinput>
  3836. &gt; <userinput>config commit</userinput></screen>
  3837. </para>
  3838. <note>
  3839. <para>
  3840. With this version of BIND 10, the "vendor-encapsulated-options" option
  3841. must be specified in the configuration although it has no configurable
  3842. parameters. If it is not specified, the server will assume that it is
  3843. not configured and will not send it to a client. In the future there
  3844. will be no need to include this option in the configuration.
  3845. </para>
  3846. </note>
  3847. </section>
  3848. <section id="dhcp4-option-spaces">
  3849. <title>Nested DHCPv4 options (custom option spaces)</title>
  3850. <para>It is sometimes useful to define completely new option
  3851. space. This is the case when user creates new option in the
  3852. standard option space ("dhcp4 or "dhcp6") and wants this option
  3853. to convey sub-options. Thanks to being in the separate space,
  3854. sub-option codes will have a separate numbering scheme and may
  3855. overlap with codes of standard options.
  3856. </para>
  3857. <para>Note that creation of a new option space when defining
  3858. sub-options for a standard option is not required, because it is
  3859. created by default if the standard option is meant to convey any
  3860. sub-options (see <xref linkend="dhcp4-vendor-opts"/>).
  3861. </para>
  3862. <para>
  3863. Assume that we want to have a DHCPv4 option called "container" with
  3864. code 222 that conveys two sub-options with codes 1 and 2.
  3865. First we need to define the new sub-options:
  3866. <screen>
  3867. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3868. &gt; <userinput>config set Dhcp4/option-def[0]/name "subopt1"</userinput>
  3869. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  3870. &gt; <userinput>config set Dhcp4/option-def[0]/space "isc"</userinput>
  3871. &gt; <userinput>config set Dhcp4/option-def[0]/type "ipv4-address"</userinput>
  3872. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  3873. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  3874. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  3875. &gt; <userinput>config commit</userinput>
  3876. &gt; <userinput>config add Dhcp4/option-def</userinput>
  3877. &gt; <userinput>config set Dhcp4/option-def[1]/name "subopt2"</userinput>
  3878. &gt; <userinput>config set Dhcp4/option-def[1]/code 2</userinput>
  3879. &gt; <userinput>config set Dhcp4/option-def[1]/space "isc"</userinput>
  3880. &gt; <userinput>config set Dhcp4/option-def[1]/type "string"</userinput>
  3881. &gt; <userinput>config set Dhcp4/option-def[1]/record-types ""</userinput>
  3882. &gt; <userinput>config set Dhcp4/option-def[1]/array false</userinput>
  3883. &gt; <userinput>config set Dhcp4/option-def[1]/encapsulate ""</userinput>
  3884. &gt; <userinput>config commit</userinput>
  3885. </screen>
  3886. Note that we have defined the options to belong to a new option space
  3887. (in this case, "isc").
  3888. </para>
  3889. <para>
  3890. The next step is to define a regular DHCPv4 option with our desired
  3891. code and specify that it should include options from the new option space:
  3892. <screen>
  3893. &gt; <userinput>add Dhcp4/option-def</userinput>
  3894. &gt; <userinput>set Dhcp4/option-def[2]/name "container"</userinput>
  3895. &gt; <userinput>set Dhcp4/option-def[2]/code 222</userinput>
  3896. &gt; <userinput>set Dhcp4/option-def[2]/space "dhcp4"</userinput>
  3897. &gt; <userinput>set Dhcp4/option-def[2]/type "empty"</userinput>
  3898. &gt; <userinput>set Dhcp4/option-def[2]/array false</userinput>
  3899. &gt; <userinput>set Dhcp4/option-def[2]/record-types ""</userinput>
  3900. &gt; <userinput>set Dhcp4/option-def[2]/encapsulate "isc"</userinput>
  3901. &gt; <userinput>commit</userinput>
  3902. </screen>
  3903. The name of the option space in which the sub-options are defined
  3904. is set in the "encapsulate" field. The "type" field is set to "empty"
  3905. to indicate that this option does not carry any data other than
  3906. sub-options.
  3907. </para>
  3908. <para>
  3909. Finally, we can set values for the new options:
  3910. <screen>
  3911. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3912. &gt; <userinput>config set Dhcp4/option-data[0]/name "subopt1"</userinput>
  3913. &gt; <userinput>config set Dhcp4/option-data[0]/space "isc"</userinput>
  3914. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  3915. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  3916. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3"</userinput>
  3917. &gt; <userinput>config commit</userinput>
  3918. <userinput></userinput>
  3919. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3920. &gt; <userinput>config set Dhcp4/option-data[1]/name "subopt2"</userinput>
  3921. &gt; <userinput>config set Dhcp4/option-data[1]/space "isc"</userinput>
  3922. &gt; <userinput>config set Dhcp4/option-data[1]/code 2</userinput>
  3923. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format true</userinput>
  3924. &gt; <userinput>config set Dhcp4/option-data[1]/data "Hello world"</userinput>
  3925. &gt; <userinput>config commit</userinput>
  3926. <userinput></userinput>
  3927. &gt; <userinput>config add Dhcp4/option-data</userinput>
  3928. &gt; <userinput>config set Dhcp4/option-data[2]/name "container"</userinput>
  3929. &gt; <userinput>config set Dhcp4/option-data[2]/space "dhcp4"</userinput>
  3930. &gt; <userinput>config set Dhcp4/option-data[2]/code 222</userinput>
  3931. &gt; <userinput>config set Dhcp4/option-data[2]/csv-format true</userinput>
  3932. &gt; <userinput>config set Dhcp4/option-data[2]/data ""</userinput>
  3933. &gt; <userinput>config commit</userinput>
  3934. </screen>
  3935. Even though the "container" option does not carry any data except
  3936. sub-options, the "data" field must be explicitly set to an empty value.
  3937. This is required because in the current version of BIND 10 DHCP, the
  3938. default configuration values are not propagated to the configuration parsers:
  3939. if the "data" is not set the parser will assume that this
  3940. parameter is not specified and an error will be reported.
  3941. </para>
  3942. <para>Note that it is possible to create an option which carries some data
  3943. in addition to the sub-options defined in the encapsulated option space. For example,
  3944. if the "container" option from the previous example was required to carry an uint16
  3945. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  3946. the option definition. (Such an option would then have the following
  3947. data structure: DHCP header, uint16 value, sub-options.) The value specified
  3948. with the "data" parameter - which should be a valid integer enclosed in quotes,
  3949. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  3950. </para>
  3951. </section>
  3952. <section id="dhcp4-client-classifier">
  3953. <title>Client Classification in DHCPv4</title>
  3954. <note>
  3955. <para>
  3956. DHCPv4 server has been extended to support limited client classification.
  3957. Although the current capability is modest, it is expected to be expanded
  3958. in the future. It is envisaged that the majority of client classification
  3959. extensions will be using hooks extensions.
  3960. </para>
  3961. </note>
  3962. <para>In certain cases it is useful to differentiate between different
  3963. types of clients and treat them differently. The process of doing
  3964. classification is conducted in two steps. The first step is to assess
  3965. incoming packet and assign it to zero or more classes. This classification
  3966. is currently simple, but is expected to grow in capability soon. Currently
  3967. the server checks whether incoming packet has vendor class identifier
  3968. option (60). If it has, content of that option is prepended with
  3969. &quot;VENDOR_CLASS_&quot; then is interpreted as a class. For example,
  3970. modern cable modems will send this option with value &quot;docsis3.0&quot;
  3971. and as a result the packet will belong to class &quot;VENDOR_CLASS_docsis3.0&quot;.
  3972. </para>
  3973. <para>It is envisaged that the client classification will be used for changing
  3974. behavior of almost any part of the DHCP message processing, including assigning
  3975. leases from different pools, assigning different option (or different values of
  3976. the same options) etc. For now, there are only two mechanisms that are taking
  3977. advantage of client classification: specific processing for cable modems and
  3978. subnet selection.</para>
  3979. <para>
  3980. For clients that belong to the VENDOR_CLASS_docsis3.0 class, the siaddr
  3981. field is set to the value of next-server (if specified in a subnet). If
  3982. there is boot-file-name option specified, its value is also set in the
  3983. file field in the DHCPv4 packet. For eRouter1.0 class, the siaddr is
  3984. always set to 0.0.0.0. That capability is expected to be moved to
  3985. external hook library that will be dedicated to cable modems.
  3986. </para>
  3987. <para>
  3988. Kea can be instructed to limit access to given subnets based on class information.
  3989. This is particularly useful for cases where two types of devices share the
  3990. same link and are expected to be served from two different subnets. The
  3991. primary use case for such a scenario is cable networks. There are two
  3992. classes of devices: cable modem itself, which should be handled a lease
  3993. from subnet A and all other devices behind modems that should get a lease
  3994. from subnet B. That segregation is essential to prevent overly curious
  3995. users from playing with their cable modems. For details on how to set up
  3996. class restrictions on subnets, see <xref linkend="dhcp4-subnet-class"/>.
  3997. </para>
  3998. </section>
  3999. <section id="dhcp4-subnet-class">
  4000. <title>Limiting access to IPv4 subnet to certain classes</title>
  4001. <para>
  4002. In certain cases it beneficial to restrict access to certain subnets
  4003. only to clients that belong to a given subnet. For details on client
  4004. classes, see <xref linkend="dhcp4-client-classifier"/>. This is an
  4005. extension of a previous example from <xref linkend="dhcp4-address-config"/>.
  4006. Let's assume that the server is connected to a network segment that uses
  4007. the 192.0.2.0/24 prefix. The Administrator of that network has decided
  4008. that addresses from range 192.0.2.10 to 192.0.2.20 are going to be
  4009. managed by the Dhcp4 server. Only clients belonging to client class
  4010. VENDOR_CLASS_docsis3.0 are allowed to use this subnet. Such a
  4011. configuration can be achieved in the following way:
  4012. <screen>
  4013. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4014. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  4015. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  4016. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "VENDOR_CLASS_docsis3.0"</userinput>
  4017. &gt; <userinput>config commit</userinput></screen>
  4018. </para>
  4019. <para>
  4020. Care should be taken with client classification as it is easy to prevent
  4021. clients that do not meet class criteria to be denied any service altogether.
  4022. </para>
  4023. </section>
  4024. </section> <!-- end of configuring DHCPv4 server section with many subsections -->
  4025. <section id="dhcp4-serverid">
  4026. <title>Server Identifier in DHCPv4</title>
  4027. <para>
  4028. The DHCPv4 protocol uses a "server identifier" for clients to be able
  4029. to discriminate between several servers present on the same link: this
  4030. value is an IPv4 address of the server. The server chooses the IPv4 address
  4031. of the interface on which the message from the client (or relay) has been
  4032. received. A single server instance will use multiple server identifiers
  4033. if it is receiving queries on multiple interfaces.
  4034. </para>
  4035. <para>
  4036. Currently there is no mechanism to override the default server identifiers
  4037. by an administrator. In the future, the configuration mechanism will be used
  4038. to specify the custom server identifier.
  4039. </para>
  4040. </section>
  4041. <section id="dhcp4-next-server">
  4042. <title>Next server (siaddr)</title>
  4043. <para>In some cases, clients want to obtain configuration from the TFTP server.
  4044. Although there is a dedicated option for it, some devices may use siaddr field
  4045. in the DHCPv4 packet for that purpose. That specific field can be configured
  4046. using next-server directive. It is possible to define it in global scope or
  4047. for a given subnet only. If both are defined, subnet value takes precedence.
  4048. The value in subnet can be set to 0.0.0.0, which means that next-server should
  4049. not be sent. It may also be set to empty string, which means the same as if
  4050. it was not defined at all - use global value.
  4051. </para>
  4052. <screen>
  4053. &gt; <userinput>config add Dhcp4/next-server</userinput>
  4054. &gt; <userinput>config set Dhcp4/next-server "192.0.2.123"</userinput>
  4055. &gt; <userinput>config commit</userinput>
  4056. <userinput></userinput>
  4057. &gt; <userinput>config add Dhcp4/subnet[0]/next-server</userinput>
  4058. &gt; <userinput>config set Dhcp4/subnet[0]/next-server "192.0.2.234"</userinput>
  4059. &gt; <userinput>config commit</userinput>
  4060. </screen>
  4061. </section>
  4062. <section id="dhcp4-echo-client-id">
  4063. <title>Echoing client-id (RFC6842)</title>
  4064. <para>Original DHCPv4 spec (RFC2131) states that the DHCPv4
  4065. server must not send back client-id options when responding to
  4066. clients. However, in some cases that confused clients that did
  4067. not have MAC address or client-id. See RFC6842 for details. That
  4068. behavior has changed with the publication of RFC6842 which
  4069. updated RFC2131. That update now states that the server must
  4070. send client-id if client sent it. That is the default behaviour
  4071. that Kea offers. However, in some cases older devices that do
  4072. not support RFC6842 may refuse to accept responses that include
  4073. client-id option. To enable backward compatibility, an optional
  4074. configuration parameter has been introduced. To configure it,
  4075. use the following commands:</para>
  4076. <screen>
  4077. &gt; <userinput>config add Dhcp4/echo-client-id</userinput>
  4078. &gt; <userinput>config set Dhcp4/echo-client-id False</userinput>
  4079. &gt; <userinput>config commit</userinput>
  4080. </screen>
  4081. </section>
  4082. <section id="dhcp4-subnet-selection">
  4083. <title>How DHCPv4 server selects subnet for a client</title>
  4084. <para>
  4085. The DHCPv4 server differentiates between the directly connected clients,
  4086. clients trying to renew leases and clients sending their messages through
  4087. relays. For the directly connected clients the server will check the
  4088. configuration of the interface on which the message has been received, and
  4089. if the server configuration doesn't match any configured subnet the
  4090. message is discarded.</para>
  4091. <para>Assuming that the server's interface is configured with the 192.0.2.3
  4092. IPv4 address, the server will only process messages received through
  4093. this interface from the directly connected client, if there is a subnet
  4094. configured, to which this IPv4 address belongs, e.g. 192.0.2.0/24.
  4095. The server will use this subnet to assign IPv4 address for the client.
  4096. </para>
  4097. <para>
  4098. The rule above does not apply when the client unicasts its message, i.e.
  4099. is trying to renew its lease. Such message is accepted through any
  4100. interface. The renewing client sets ciaddr to the currently used IPv4
  4101. address. The server uses this address to select the subnet for the client
  4102. (in particular, to extend the lease using this address).
  4103. </para>
  4104. <para>
  4105. If the message is relayed it is accepted through any interface. The giaddr
  4106. set by the relay agent is used to select the subnet for the client.
  4107. </para>
  4108. <para>
  4109. It is also possible to specify a relay IPv4 address for a given subnet. It
  4110. can be used to match incoming packets into a subnet in uncommon configurations,
  4111. e.g. shared subnets. See <xref linkend="dhcp4-relay-override"/> for details.
  4112. </para>
  4113. <note>
  4114. <para>The subnet selection mechanism described in this section is based
  4115. on the assumption that client classification is not used. The classification
  4116. mechanism alters the way in which subnet is selected for the client,
  4117. depending on the clasess that the client belongs to.</para>
  4118. </note>
  4119. </section>
  4120. <section id="dhcp4-relay-override">
  4121. <title>Using specific relay agent for a subnet</title>
  4122. <para>
  4123. The relay has to have an interface connected to the link on which
  4124. the clients are being configured. Typically the relay has an IPv4
  4125. address configured on that interface that belongs to the subnet that
  4126. the server will assign addresses from. In such typical case, the
  4127. server is able to use IPv4 address inserted by the relay (in GIADDR
  4128. field of the DHCPv4 packet) to select appropriate subnet.
  4129. </para>
  4130. <para>
  4131. However, that is not always the case. In certain uncommon, but
  4132. valid deployments, the relay address may not match the subnet. This
  4133. usually means that there is more than one subnet allocated for a given
  4134. link. Two most common examples where this is the case are long lasting
  4135. network renumbering (where both old and new address space is still being
  4136. used) and a cable network. In a cable network both cable modems and the
  4137. devices behind them are physically connected to the same link, yet
  4138. they use distinct addressing. In such case, the DHCPv4 server needs
  4139. additional information (IPv4 address of the relay) to properly select
  4140. an appropriate subnet.
  4141. </para>
  4142. <para>
  4143. The following example assumes that there is a subnet 192.0.2.0/24
  4144. that is accessible via relay that uses 10.0.0.1 as its IPv4 address.
  4145. The server will be able to select this subnet for any incoming packets
  4146. that came from a relay that has an address in 192.0.2.0/24 subnet.
  4147. It will also select that subnet for a relay with address 10.0.0.1.
  4148. <screen>
  4149. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4150. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  4151. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  4152. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.0.0.1"</userinput>
  4153. &gt; <userinput>config commit</userinput></screen>
  4154. </para>
  4155. </section>
  4156. <section id="dhcp4-srv-example-client-class-relay">
  4157. <title>Segregating IPv4 clients in a cable network</title>
  4158. <para>
  4159. In certain cases, it is useful to mix relay address information,
  4160. introduced in <xref linkend="dhcp4-relay-override"/> with client
  4161. classification, explained in <xref linkend="dhcp4-subnet-class"/>.
  4162. One specific example is cable network, where typically modems
  4163. get addresses from a different subnet than all devices connected
  4164. behind them.
  4165. </para>
  4166. <para>
  4167. Let's assume that there is one CMTS (Cable Modem Termination System)
  4168. with one CM MAC (a physical link that modems are connected to).
  4169. We want the modems to get addresses from the 10.1.1.0/24 subnet, while
  4170. everything connected behind modems should get addresses from another
  4171. subnet (192.0.2.0/24). The CMTS that acts as a relay an uses address
  4172. 10.1.1.1. The following configuration can serve that configuration:
  4173. <screen>
  4174. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4175. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "10.1.1.0/24"</userinput>
  4176. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "10.1.1.2 - 10.1.1.20" ]</userinput>
  4177. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "docsis3.0"</userinput>
  4178. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.1.1.1"</userinput>
  4179. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  4180. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.2.0/24"</userinput>
  4181. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  4182. &gt; <userinput>config set Dhcp4/subnet4[1]/relay/ip-address "10.1.1.1"</userinput>
  4183. &gt; <userinput>config commit</userinput></screen>
  4184. </para>
  4185. </section>
  4186. <section id="dhcp4-std">
  4187. <title>Supported Standards</title>
  4188. <para>The following standards and draft standards are currently
  4189. supported:</para>
  4190. <itemizedlist>
  4191. <listitem>
  4192. <simpara><ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>: Supported messages are DISCOVER, OFFER,
  4193. REQUEST, RELEASE, ACK, and NAK.</simpara>
  4194. </listitem>
  4195. <listitem>
  4196. <simpara><ulink url="http://tools.ietf.org/html/rfc2132">RFC 2132</ulink>:
  4197. Supported options are: PAD (0),
  4198. END(255), Message Type(53), DHCP Server Identifier (54),
  4199. Domain Name (15), DNS Servers (6), IP Address Lease Time
  4200. (51), Subnet mask (1), and Routers (3).</simpara>
  4201. </listitem>
  4202. <listitem>
  4203. <simpara><ulink url="http://tools.ietf.org/html/rfc3046">RFC 3046</ulink>:
  4204. Relay Agent Information option is supported.</simpara>
  4205. </listitem>
  4206. <listitem>
  4207. <simpara><ulink url="http://tools.ietf.org/html/rfc6842">RFC 6842</ulink>:
  4208. Server by default sends back client-id option. That capability may be
  4209. disabled. See <xref linkend="dhcp4-echo-client-id"/> for details.
  4210. </simpara>
  4211. </listitem>
  4212. </itemizedlist>
  4213. </section>
  4214. <section id="dhcp4-limit">
  4215. <title>DHCPv4 Server Limitations</title>
  4216. <para>These are the current limitations of the DHCPv4 server
  4217. software. Most of them are reflections of the current stage of
  4218. development and should be treated as <quote>not implemented
  4219. yet</quote>, rather than actual limitations.</para>
  4220. <itemizedlist>
  4221. <listitem> <!-- see tickets #3234, #3281 -->
  4222. <para>
  4223. On-line configuration has some limitations. Adding new subnets or
  4224. modifying existing ones work, as is removing the last subnet from
  4225. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  4226. there are 4 subnets configured) will cause issues. The problem is
  4227. caused by simplistic subnet-id assignment. The subnets are always
  4228. numbered, starting from 1. That subnet-id is then used in leases
  4229. that are stored in the lease database. Removing non-last subnet will
  4230. cause the configuration information to mismatch data in the lease
  4231. database. It is possible to manually update subnet-id fields in
  4232. MySQL database, but it is awkward and error prone process. A better
  4233. reconfiguration support is planned.
  4234. </para>
  4235. </listitem>
  4236. <listitem>
  4237. <para>
  4238. On startup, the DHCPv4 server does not get the full configuration from
  4239. BIND 10. To remedy this, after starting BIND 10, modify any parameter
  4240. and commit the changes, e.g.
  4241. <screen>
  4242. &gt; <userinput>config show Dhcp4/renew-timer</userinput>
  4243. Dhcp4/renew-timer 1000 integer (default)
  4244. &gt; <userinput>config set Dhcp4/renew-timer 1001</userinput>
  4245. &gt; <userinput>config commit</userinput></screen>
  4246. </para>
  4247. </listitem>
  4248. <listitem>
  4249. <simpara>The DHCPv4 server does not support
  4250. BOOTP. That is a design choice and the limitation is
  4251. permanent. If you have legacy nodes that can't use DHCP and
  4252. require BOOTP support, please use the latest version of ISC DHCP,
  4253. available from <ulink url="http://www.isc.org/software/dhcp"/>.</simpara>
  4254. </listitem>
  4255. <listitem>
  4256. <simpara>Raw sockets operation is working on Linux
  4257. only. See <xref linkend="iface-detect"/> for details.</simpara>
  4258. </listitem>
  4259. <listitem>
  4260. <simpara>The DHCPv4 server does not verify that
  4261. assigned address is unused. According to <ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>, the
  4262. allocating server should verify that address is not used by
  4263. sending ICMP echo request.</simpara>
  4264. </listitem>
  4265. <listitem>
  4266. <simpara>Address rebinding (REBIND) and duplication report (DECLINE)
  4267. are not supported yet.</simpara>
  4268. </listitem>
  4269. <listitem>
  4270. <simpara>DNS Update is not yet supported.</simpara>
  4271. </listitem>
  4272. </itemizedlist>
  4273. </section>
  4274. <!--
  4275. <section id="dhcp4-srv-examples">
  4276. <title>Kea DHCPv4 server examples</title>
  4277. <para>
  4278. This section provides easy to use example. Each example can be read
  4279. separately. It is not intended to be read sequentially as there will
  4280. be many repetitions between examples. They are expected to serve as
  4281. easy to use copy-paste solutions to many common deployments.
  4282. </para>
  4283. @todo: add simple configuration for direct clients
  4284. @todo: add configuration for relayed clients
  4285. @todo: add client classification example
  4286. </section> -->
  4287. </chapter>
  4288. <chapter id="dhcp6">
  4289. <title>The DHCPv6 Server</title>
  4290. <section id="dhcp6-start-stop">
  4291. <title>Starting and Stopping the DHCPv6 Server</title>
  4292. <para>
  4293. <command>b10-dhcp6</command> is the BIND 10 DHCPv6 server and, like other
  4294. parts of BIND 10, is configured through the <command>bindctl</command>
  4295. program.
  4296. </para>
  4297. <para>
  4298. After starting BIND 10 and starting <command>bindctl</command>, the first step
  4299. in configuring the server is to add <command>b10-dhcp6</command> to the list of running BIND 10 services.
  4300. <screen>
  4301. &gt; <userinput>config add Init/components b10-dhcp6</userinput>
  4302. &gt; <userinput>config set Init/components/b10-dhcp6/kind dispensable</userinput>
  4303. &gt; <userinput>config commit</userinput>
  4304. </screen>
  4305. </para>
  4306. <para>
  4307. To remove <command>b10-dhcp6</command> from the set of running services,
  4308. the <command>b10-dhcp6</command> is removed from list of Init components:
  4309. <screen>
  4310. &gt; <userinput>config remove Init/components b10-dhcp6</userinput>
  4311. &gt; <userinput>config commit</userinput>
  4312. </screen>
  4313. </para>
  4314. <para>
  4315. Note that the server was only removed from the list, so BIND10 will not
  4316. restart it, but the server itself is still running. Hence it is usually
  4317. desired to stop it:
  4318. <screen>
  4319. &gt; <userinput>Dhcp6 shutdown</userinput>
  4320. </screen>
  4321. </para>
  4322. <para>
  4323. During start-up the server will detect available network interfaces
  4324. and will attempt to open UDP sockets on all interfaces that
  4325. are up, running, are not loopback, are multicast-capable, and
  4326. have IPv6 address assigned. It will then listen to incoming traffic.
  4327. </para>
  4328. </section>
  4329. <section id="dhcp6-configuration">
  4330. <title>DHCPv6 Server Configuration</title>
  4331. <para>
  4332. Once the server has been started, it can be configured. To view the
  4333. current configuration, use the following command in <command>bindctl</command>:
  4334. <screen>&gt; <userinput>config show Dhcp6</userinput></screen>
  4335. When starting the Dhcp6 daemon for the first time, the default configuration
  4336. will be available. It will look similar to this:
  4337. <screen>
  4338. &gt; <userinput>config show Dhcp6</userinput>
  4339. Dhcp6/interfaces/ list (default)
  4340. Dhcp6/renew-timer 1000 integer (default)
  4341. Dhcp6/rebind-timer 2000 integer (default)
  4342. Dhcp6/preferred-lifetime 3000 integer (default)
  4343. Dhcp6/valid-lifetime 4000 integer (default)
  4344. Dhcp6/option-data [] list (default)
  4345. Dhcp6/lease-database/type "memfile" string (default)
  4346. Dhcp6/lease-database/name "" string (default)
  4347. Dhcp6/lease-database/user "" string (default)
  4348. Dhcp6/lease-database/host "" string (default)
  4349. Dhcp6/lease-database/password "" string (default)
  4350. Dhcp6/subnet6/ list
  4351. </screen>
  4352. </para>
  4353. <para>
  4354. To change one of the parameters, simply follow
  4355. the usual <command>bindctl</command> procedure. For example, to make the
  4356. leases longer, change their valid-lifetime parameter:
  4357. <screen>
  4358. &gt; <userinput>config set Dhcp6/valid-lifetime 7200</userinput>
  4359. &gt; <userinput>config commit</userinput></screen>
  4360. Most Dhcp6 parameters are of global scope
  4361. and apply to all defined subnets, unless they are overridden on a
  4362. per-subnet basis.
  4363. </para>
  4364. <note>
  4365. <para>
  4366. With this version of BIND 10, there are a number of known limitations
  4367. and problems in the DHCPv6 server. See <xref linkend="dhcp6-limit"/>.
  4368. </para>
  4369. </note>
  4370. <section>
  4371. <title>Database Configuration</title>
  4372. <para>
  4373. All leases issued by the server are stored in the lease database. Currently,
  4374. the only supported database is MySQL
  4375. <footnote>
  4376. <para>
  4377. The server comes with an in-memory database ("memfile") configured as the default
  4378. database. This is used for internal testing and is not supported. In addition,
  4379. it does not store lease information on disk: lease information will be lost if the
  4380. server is restarted.
  4381. </para>
  4382. </footnote>, and so the server must be configured to
  4383. access the correct database with the appropriate credentials.
  4384. </para>
  4385. <note>
  4386. <para>
  4387. Database access information must be configured for the DHCPv6 server, even if
  4388. it has already been configured for the DHCPv4 server. The servers store their
  4389. information independently, so each server can use a separate
  4390. database or both servers can use the same database.
  4391. </para>
  4392. </note>
  4393. <para>
  4394. Database configuration is controlled through the Dhcp6/lease-database parameters.
  4395. The type of the database must be set to MySQL (although the string entered is "mysql"):
  4396. <screen>
  4397. &gt; <userinput>config set Dhcp6/lease-database/type "mysql"</userinput>
  4398. </screen>
  4399. Next, the name of the database is to hold the leases must be set: this is the
  4400. name used when the lease database was created (see <xref linkend="dhcp-database-create"/>).
  4401. <screen>
  4402. &gt; <userinput>config set Dhcp6/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  4403. </screen>
  4404. If the database is located on a different system to the DHCPv6 server, the
  4405. database host name must also be specified (although note that this configuration
  4406. may have a severe impact on server performance):
  4407. <screen>
  4408. &gt; <userinput>config set Dhcp6/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  4409. </screen>
  4410. The usual state of affairs will be to have the database on the same machine as the
  4411. DHCPv6 server. In this case, set the value to the empty string (this is the default):
  4412. <screen>
  4413. &gt; <userinput>config set Dhcp6/lease-database/host ""</userinput>
  4414. </screen>
  4415. </para>
  4416. <para>
  4417. Finally, the credentials of the account under which the server will access the database
  4418. should be set:
  4419. <screen>
  4420. &gt; <userinput>config set Dhcp6/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  4421. &gt; <userinput>config set Dhcp6/lease-database/password "<replaceable>password</replaceable>"</userinput>
  4422. </screen>
  4423. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  4424. </para>
  4425. <note>
  4426. <para>The password is echoed when entered and is stored in clear text in the BIND 10 configuration
  4427. database. Improved password security will be added in a future version of BIND 10 DHCP</para>
  4428. </note>
  4429. </section>
  4430. <section id="dhcp6-interface-selection">
  4431. <title>Interface selection</title>
  4432. <para>
  4433. When DHCPv6 server starts up, by default it will listen to the DHCP
  4434. traffic and respond to it on all interfaces detected during startup.
  4435. However, in many cases it is desired to configure the server to listen and
  4436. respond on selected interfaces only. The sample commands in this section
  4437. show how to make interface selection using bindctl.
  4438. </para>
  4439. <para>
  4440. The default configuration can be presented with the following command:
  4441. <screen>
  4442. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  4443. <userinput>Dhcp6/interfaces[0] "*" string</userinput></screen>
  4444. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  4445. </para>
  4446. <para>
  4447. In order to override the default configuration, the existing entry can be replaced
  4448. with the actual interface name:
  4449. <screen>
  4450. &gt; <userinput>config set Dhcp6/interfaces[0] eth1</userinput>
  4451. &gt; <userinput>config commit</userinput></screen>
  4452. Other interface names can be added on one-by-one basis:
  4453. <screen>
  4454. &gt; <userinput>config add Dhcp6/interfaces eth2</userinput>
  4455. &gt; <userinput>config commit</userinput></screen>
  4456. Configuration will now contain two interfaces which can be presented as follows:
  4457. <screen>
  4458. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  4459. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  4460. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput></screen>
  4461. When configuration gets committed, the server will start to listen on
  4462. eth1 and eth2 interfaces only.
  4463. </para>
  4464. <para>
  4465. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  4466. interface names:
  4467. <screen>
  4468. &gt; <userinput>config add Dhcp6/interfaces *</userinput>
  4469. &gt; <userinput>config commit</userinput></screen>
  4470. This will result in the following configuration:
  4471. <screen>
  4472. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  4473. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  4474. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput>
  4475. <userinput>Dhcp6/interfaces[2] "*" string</userinput></screen>
  4476. The presence of the wildcard name implies that server will listen on all interfaces.
  4477. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  4478. <screen>
  4479. &gt; <userinput>config remove Dhcp6/interfaces[2]</userinput>
  4480. &gt; <userinput>config commit</userinput></screen>
  4481. </para>
  4482. </section>
  4483. <section id="dhcp6-unicast">
  4484. <title>Unicast traffic support</title>
  4485. <para>
  4486. When DHCPv6 server starts up, by default it listens to the DHCP traffic
  4487. sent to multicast address ff02::1:2 on each interface that it is
  4488. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  4489. In some cases it is useful to configure a server to handle incoming
  4490. traffic sent to the global unicast addresses as well. The most common
  4491. reason for that is to have relays send their traffic to the server
  4492. directly. To configure server to listen on specific unicast address, a
  4493. notation to specify interfaces has been extended. Interface name can be
  4494. optionally followed by a slash, followed by global unicast address that
  4495. server should listen on. That will be done in addition to normal
  4496. link-local binding + listening on ff02::1:2 address. The sample commands
  4497. listed below show how to listen on 2001:db8::1 (a global address)
  4498. configured on the eth1 interface.
  4499. </para>
  4500. <para>
  4501. <screen>
  4502. &gt; <userinput>config set Dhcp6/interfaces[0] eth1/2001:db8::1</userinput>
  4503. &gt; <userinput>config commit</userinput></screen>
  4504. When configuration gets committed, the server will start to listen on
  4505. eth1 on link-local address, mutlicast group (ff02::1:2) and 2001:db8::1.
  4506. </para>
  4507. <para>
  4508. It is possible to mix interface names, wildcards and interface name/addresses
  4509. on the Dhcp6/interface list. It is not possible to specify more than one
  4510. unicast address on a given interface.
  4511. </para>
  4512. <para>
  4513. Care should be taken to specify proper unicast addresses. The server will
  4514. attempt to bind to those addresses specified, without any additional checks.
  4515. That approach is selected on purpose, so in the software can be used to
  4516. communicate over uncommon addresses if the administrator desires so.
  4517. </para>
  4518. </section>
  4519. <section id="dhcp6-address-config">
  4520. <title>Subnet and Address Pool</title>
  4521. <para>
  4522. The essential role of a DHCPv6 server is address assignment. For this,
  4523. the server has to be configured with at least one subnet and one pool of dynamic
  4524. addresses to be managed. For example, assume that the server
  4525. is connected to a network segment that uses the 2001:db8:1::/64
  4526. prefix. The Administrator of that network has decided that addresses from range
  4527. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  4528. server. Such a configuration can be achieved in the following way:
  4529. <screen>
  4530. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4531. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  4532. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  4533. &gt; <userinput>config commit</userinput></screen>
  4534. Note that subnet is defined as a simple string, but the pool parameter
  4535. is actually a list of pools: for this reason, the pool definition is
  4536. enclosed in square brackets, even though only one range of addresses
  4537. is specified.</para>
  4538. <para>It is possible to define more than one pool in a
  4539. subnet: continuing the previous example, further assume that
  4540. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  4541. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  4542. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  4543. formats are supported by Dhcp6 and can be mixed in the pool list.
  4544. For example, one could define the following pools:
  4545. <screen>
  4546. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]</userinput>
  4547. &gt; <userinput>config commit</userinput></screen>
  4548. The number of pools is not limited, but for performance reasons it is recommended to
  4549. use as few as possible.
  4550. </para>
  4551. <para>
  4552. The server may be configured to serve more than one subnet. To add a second subnet,
  4553. use a command similar to the following:
  4554. <screen>
  4555. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4556. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  4557. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  4558. &gt; <userinput>config commit</userinput></screen>
  4559. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  4560. previous example. The <command>config add Dhcp6/subnet6</command> command adds
  4561. another (second) subnet. It can be referred to as
  4562. <command>Dhcp6/subnet6[1]</command>. In this example, we allow server to
  4563. dynamically assign all addresses available in the whole subnet. Although
  4564. very wasteful, it is certainly a valid configuration to dedicate the
  4565. whole /48 subnet for that purpose.
  4566. </para>
  4567. <para>
  4568. When configuring a DHCPv6 server using prefix/length notation, please pay
  4569. attention to the boundary values. When specifying that the server should use
  4570. a given pool, it will be able to allocate also first (typically network
  4571. address) address from that pool. For example for pool 2001:db8::/64 the
  4572. 2001:db8:: address may be assigned as well. If you want to avoid this,
  4573. please use the "min-max" notation.
  4574. </para>
  4575. </section>
  4576. <section>
  4577. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  4578. <title>Subnet and Prefix Delegation Pools</title>
  4579. <para>
  4580. Subnets may also be configured to delegate address prefixes....
  4581. A subnet may have one or more prefix delegation pools. Each pool has
  4582. a prefixed address, which is specified as a prefix and a prefix length,
  4583. as well as a delegated prefix length. A sample configuration is shown
  4584. below:
  4585. <screen>
  4586. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4587. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  4588. &gt; <userinput>config show Dhcp6/subnet6[0]</userinput>
  4589. &gt; <userinput>config add Dhcp6/subnet6[0]/pd-pools</userinput>
  4590. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix "2001:db8:1::"</userinput>
  4591. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix-len 64</userinput>
  4592. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/delegated-len 96</userinput>
  4593. &gt; <userinput>config commit</userinput></screen>
  4594. </para>
  4595. </section>
  4596. <section id="dhcp6-std-options">
  4597. <title>Standard DHCPv6 options</title>
  4598. <para>
  4599. One of the major features of DHCPv6 server is to provide configuration
  4600. options to clients. Although there are several options that require
  4601. special behavior, most options are sent by the server only if the client
  4602. explicitly requested them. The following example shows how to
  4603. configure DNS servers, which is one of the most frequently used
  4604. options. Numbers in the first column are added for easier reference and
  4605. will not appear on screen. Options specified in this way are considered
  4606. global and apply to all configured subnets.
  4607. <screen>
  4608. 1. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4609. 2. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  4610. 3. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  4611. 4. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  4612. 5. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4613. 6. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::cafe, 2001:db8::babe"</userinput>
  4614. 7. &gt; <userinput>config commit</userinput>
  4615. </screen>
  4616. </para>
  4617. <para>
  4618. The first line creates new entry in option-data table. It
  4619. contains information on all global options that the server is
  4620. supposed to configure in all subnets. The second line specifies
  4621. option name. For a complete list of currently supported names,
  4622. see <xref linkend="dhcp6-std-options-list"/>.
  4623. The third line specifies option code, which must match one of the
  4624. values from that
  4625. list. Line 4 specifies option space, which must always
  4626. be set to "dhcp6" as these are standard DHCPv6 options. For
  4627. other name spaces, including custom option spaces, see <xref
  4628. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  4629. which the data will be entered: use of CSV (comma
  4630. separated values) is recommended. The sixth line gives the actual value to
  4631. be sent to clients. Data is specified as a normal text, with
  4632. values separated by commas if more than one value is
  4633. allowed.
  4634. </para>
  4635. <para>
  4636. Options can also be configured as hexadecimal values. If csv-format is
  4637. set to false, the option data must be specified as a string of hexadecimal
  4638. numbers. The
  4639. following commands configure the DNS-SERVERS option for all
  4640. subnets with the following addresses: 2001:db8:1::cafe and
  4641. 2001:db8:1::babe.
  4642. <screen>
  4643. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4644. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  4645. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  4646. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  4647. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format false</userinput>
  4648. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001 0DB8 0001 0000 0000 0000</userinput>
  4649. <userinput>0000 CAFE 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  4650. &gt; <userinput>config commit</userinput>
  4651. </screen>
  4652. (The value for the setting of the "data" element is split across two
  4653. lines in this document for clarity: when entering the command, the
  4654. whole string should be entered on the same line.)
  4655. </para>
  4656. <para>
  4657. It is possible to override options on a per-subnet basis. If
  4658. clients connected to most of your subnets are expected to get the
  4659. same values of a given option, you should use global options: you
  4660. can then override specific values for a small number of subnets.
  4661. On the other hand, if you use different values in each subnet,
  4662. it does not make sense to specify global option values
  4663. (Dhcp6/option-data), rather you should set only subnet-specific values
  4664. (Dhcp6/subnet[X]/option-data[Y]).
  4665. </para>
  4666. <para>
  4667. The following commands override the global
  4668. DNS servers option for a particular subnet, setting a single DNS
  4669. server with address 2001:db8:1::3.
  4670. <screen>
  4671. &gt; <userinput>config add Dhcp6/subnet6[0]/option-data</userinput>
  4672. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/name "dns-servers"</userinput>
  4673. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/code 23</userinput>
  4674. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/space "dhcp6"</userinput>
  4675. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/csv-format true</userinput>
  4676. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/data "2001:db8:1::3"</userinput>
  4677. &gt; <userinput>config commit</userinput></screen>
  4678. </para>
  4679. <note>
  4680. <para>
  4681. In future versions of BIND 10 DHCP, it will not be necessary to specify
  4682. option code, space and csv-format fields, as those fields will be set
  4683. automatically.
  4684. </para>
  4685. </note>
  4686. <para>
  4687. The currently supported standard DHCPv6 options are
  4688. listed in <xref linkend="dhcp6-std-options-list"/>.
  4689. The "Name" and "Code"
  4690. are the values that should be used as a name in the option-data
  4691. structures. "Type" designates the format of the data: the meanings of
  4692. the various types is given in <xref linkend="dhcp-types"/>.
  4693. </para>
  4694. <para>
  4695. Some options are designated as arrays, which means that more than one
  4696. value is allowed in such an option. For example the option dns-servers
  4697. allows the specification of more than one IPv6 address, so allowing
  4698. clients to obtain the the addresses of multiple DNS servers.
  4699. </para>
  4700. <!-- @todo: describe record types -->
  4701. <para>
  4702. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  4703. syntax to create custom option definitions (formats). It is generally not
  4704. allowed to create custom definitions for standard options, even if the
  4705. definition being created matches the actual option format defined in the
  4706. RFCs. There is an exception from this rule for standard options for which
  4707. Kea does not provide a definition yet. In order to use such options,
  4708. a server administrator must create a definition as described in
  4709. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  4710. definition should match the option format described in the relevant
  4711. RFC but configuration mechanism would allow any option format as it has
  4712. no means to validate it at the moment.
  4713. </para>
  4714. <para>
  4715. <table frame="all" id="dhcp6-std-options-list">
  4716. <title>List of standard DHCPv6 options</title>
  4717. <tgroup cols='4'>
  4718. <colspec colname='name'/>
  4719. <colspec colname='code'/>
  4720. <colspec colname='type'/>
  4721. <colspec colname='array'/>
  4722. <thead>
  4723. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  4724. </thead>
  4725. <tbody>
  4726. <!-- Our engine uses those options on its own, admin must not configure them on his own
  4727. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  4728. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  4729. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  4730. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  4731. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  4732. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  4733. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  4734. <!-- Our engine uses those options on its own, admin must not configure them on his own
  4735. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  4736. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  4737. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  4738. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  4739. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  4740. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  4741. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  4742. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  4743. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  4744. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  4745. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  4746. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  4747. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  4748. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4749. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4750. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  4751. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  4752. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  4753. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4754. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4755. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  4756. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  4757. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4758. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  4759. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  4760. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4761. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  4762. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  4763. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  4764. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  4765. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4766. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  4767. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  4768. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  4769. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  4770. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  4771. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  4772. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  4773. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  4774. </tbody>
  4775. </tgroup>
  4776. </table>
  4777. </para>
  4778. </section>
  4779. <section id="dhcp6-custom-options">
  4780. <title>Custom DHCPv6 options</title>
  4781. <para>It is also possible to define options other than the standard ones.
  4782. Assume that we want to define a new DHCPv6 option called "foo" which will have
  4783. code 100 and will convey a single unsigned 32 bit integer value. We can define
  4784. such an option by using the following commands:
  4785. <screen>
  4786. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4787. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  4788. &gt; <userinput>config set Dhcp6/option-def[0]/code 100</userinput>
  4789. &gt; <userinput>config set Dhcp6/option-def[0]/type "uint32"</userinput>
  4790. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4791. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  4792. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  4793. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  4794. &gt; <userinput>config commit</userinput></screen>
  4795. The "false" value of the "array" parameter determines that the option
  4796. does NOT comprise an array of "uint32" values but rather a single value.
  4797. Two other parameters have been left blank: "record-types" and "encapsulate".
  4798. The former specifies the comma separated list of option data fields if the
  4799. option comprises a record of data fields. The "record-fields" value should
  4800. be non-empty if the "type" is set to "record". Otherwise it must be left
  4801. blank. The latter parameter specifies the name of the option space being
  4802. encapsulated by the particular option. If the particular option does not
  4803. encapsulate any option space it should be left blank.
  4804. Note that the above set of comments define the format of the new option and do not
  4805. set its values.
  4806. </para>
  4807. <para>Once the new option format is defined, its value is set
  4808. in the same way as for a standard option. For example the following
  4809. commands set a global value that applies to all subnets.
  4810. <screen>
  4811. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4812. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  4813. &gt; <userinput>config set Dhcp6/option-data[0]/code 100</userinput>
  4814. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  4815. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4816. &gt; <userinput>config set Dhcp6/option-data[0]/data "12345"</userinput>
  4817. &gt; <userinput>config commit</userinput></screen>
  4818. </para>
  4819. <para>New options can take more complex forms than simple use of
  4820. primitives (uint8, string, ipv6-address etc): it is possible to
  4821. define an option comprising a number of existing primitives.
  4822. </para>
  4823. <para>
  4824. Assume we want to define a new option that will consist of an IPv6
  4825. address, followed by an unsigned 16 bit integer, followed by a
  4826. boolean value, followed by a text string. Such an option could
  4827. be defined in the following way:
  4828. <screen>
  4829. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4830. &gt; <userinput>config set Dhcp6/option-def[0]/name "bar"</userinput>
  4831. &gt; <userinput>config set Dhcp6/option-def[0]/code 101</userinput>
  4832. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  4833. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  4834. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4835. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, boolean, string"</userinput>
  4836. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  4837. </screen>
  4838. The "type" is set to "record" to indicate that the option contains
  4839. multiple values of different types. These types are given as a comma-separated
  4840. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  4841. </para>
  4842. <para>
  4843. The values of the option are set as follows:
  4844. <screen>
  4845. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4846. &gt; <userinput>config set Dhcp6/option-data[0]/name "bar"</userinput>
  4847. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  4848. &gt; <userinput>config set Dhcp6/option-data[0]/code 101</userinput>
  4849. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4850. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, false, Hello World"</userinput>
  4851. &gt; <userinput>config commit</userinput></screen>
  4852. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  4853. list of values. The values in the "data" must correspond to the types set in
  4854. the "record-types" field of the option definition.
  4855. </para>
  4856. <note>
  4857. <para>
  4858. It is recommended that boolean values are specified using "true" and "false"
  4859. strings. This helps to prevent errors when typing multiple comma separated
  4860. values, as it make it easier to identify the type of the value being typed,
  4861. and compare it with the order of data fields. Nevetheless, it is possible
  4862. to use integer values: "1" and "0", instead of "true" and "false"
  4863. accordingly. If other integer value is specified, the configuration is
  4864. rejected.
  4865. </para>
  4866. </note>
  4867. </section>
  4868. <section id="dhcp6-vendor-opts">
  4869. <title>DHCPv6 vendor specific options</title>
  4870. <para>
  4871. Currently there are three option spaces defined: dhcp4 (to be used
  4872. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  4873. vendor-opts-space, which is empty by default, but options can be
  4874. defined in it. Those options are called vendor-specific information
  4875. options. The following examples show how to define an option "foo"
  4876. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  4877. and a string. The "foo" option is conveyed in a vendor specific
  4878. information option. This option comprises a single uint32 value
  4879. that is set to "12345". The sub-option "foo" follows the data
  4880. field holding this value.
  4881. <screen>
  4882. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4883. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  4884. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  4885. &gt; <userinput>config set Dhcp6/option-def[0]/space "vendor-opts-space"</userinput>
  4886. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  4887. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4888. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, string"</userinput>
  4889. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulates ""</userinput>
  4890. &gt; <userinput>config commit</userinput>
  4891. </screen>
  4892. (Note that the option space is set to "vendor-opts-space".)
  4893. Once the option format is defined, the next step is to define actual values
  4894. for that option:
  4895. <screen>
  4896. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4897. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  4898. &gt; <userinput>config set Dhcp6/option-data[0]/space "vendor-opts-space"</userinput>
  4899. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  4900. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4901. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, Hello World"</userinput>
  4902. &gt; <userinput>config commit</userinput></screen>
  4903. We should also define values for the vendor-opts, that will convey our option foo.
  4904. <screen>
  4905. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4906. &gt; <userinput>config set Dhcp6/option-data[1]/name "vendor-opts"</userinput>
  4907. &gt; <userinput>config set Dhcp6/option-data[1]/space "dhcp6"</userinput>
  4908. &gt; <userinput>config set Dhcp6/option-data[1]/code 17</userinput>
  4909. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  4910. &gt; <userinput>config set Dhcp6/option-data[1]/data "12345"</userinput>
  4911. &gt; <userinput>config commit</userinput></screen>
  4912. </para>
  4913. </section>
  4914. <section id="dhcp6-option-spaces">
  4915. <title>Nested DHCPv6 options (custom option spaces)</title>
  4916. <para>It is sometimes useful to define completely new option
  4917. spaces. This is useful if the user wants his new option to
  4918. convey sub-options that use separate numbering scheme, for
  4919. example sub-options with codes 1 and 2. Those option codes
  4920. conflict with standard DHCPv6 options, so a separate option
  4921. space must be defined.
  4922. </para>
  4923. <para>Note that it is not required to create new option space when
  4924. defining sub-options for a standard option because it is by
  4925. default created if the standard option is meant to convey
  4926. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  4927. </para>
  4928. <para>
  4929. Assume that we want to have a DHCPv6 option called "container"
  4930. with code 102 that conveys two sub-options with codes 1 and 2.
  4931. First we need to define the new sub-options:
  4932. <screen>
  4933. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4934. &gt; <userinput>config set Dhcp6/option-def[0]/name "subopt1"</userinput>
  4935. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  4936. &gt; <userinput>config set Dhcp6/option-def[0]/space "isc"</userinput>
  4937. &gt; <userinput>config set Dhcp6/option-def[0]/type "ipv6-address"</userinput>
  4938. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  4939. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4940. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  4941. &gt; <userinput>config commit</userinput>
  4942. &gt; <userinput></userinput>
  4943. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4944. &gt; <userinput>config set Dhcp6/option-def[1]/name "subopt2"</userinput>
  4945. &gt; <userinput>config set Dhcp6/option-def[1]/code 2</userinput>
  4946. &gt; <userinput>config set Dhcp6/option-def[1]/space "isc"</userinput>
  4947. &gt; <userinput>config set Dhcp6/option-def[1]/type "string"</userinput>
  4948. &gt; <userinput>config set Dhcp6/option-def[1]/record-types ""</userinput>
  4949. &gt; <userinput>config set Dhcp6/option-def[1]/array false</userinput>
  4950. &gt; <userinput>config set Dhcp6/option-def[1]/encapsulate ""</userinput>
  4951. &gt; <userinput>config commit</userinput>
  4952. </screen>
  4953. Note that we have defined the options to belong to a new option space
  4954. (in this case, "isc").
  4955. </para>
  4956. <para>
  4957. The next step is to define a regular DHCPv6 option and specify that it
  4958. should include options from the isc option space:
  4959. <screen>
  4960. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4961. &gt; <userinput>config set Dhcp6/option-def[2]/name "container"</userinput>
  4962. &gt; <userinput>config set Dhcp6/option-def[2]/code 102</userinput>
  4963. &gt; <userinput>config set Dhcp6/option-def[2]/space "dhcp6"</userinput>
  4964. &gt; <userinput>config set Dhcp6/option-def[2]/type "empty"</userinput>
  4965. &gt; <userinput>config set Dhcp6/option-def[2]/array false</userinput>
  4966. &gt; <userinput>config set Dhcp6/option-def[2]/record-types ""</userinput>
  4967. &gt; <userinput>config set Dhcp6/option-def[2]/encapsulate "isc"</userinput>
  4968. &gt; <userinput>config commit</userinput>
  4969. </screen>
  4970. The name of the option space in which the sub-options are defined
  4971. is set in the "encapsulate" field. The "type" field is set to "empty"
  4972. which imposes that this option does not carry any data other than
  4973. sub-options.
  4974. </para>
  4975. <para>
  4976. Finally, we can set values for the new options:
  4977. <screen>
  4978. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4979. &gt; <userinput>config set Dhcp6/option-data[0]/name "subopt1"</userinput>
  4980. &gt; <userinput>config set Dhcp6/option-data[0]/space "isc"</userinput>
  4981. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  4982. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4983. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::abcd"</userinput>
  4984. &gt; <userinput>config commit</userinput>
  4985. &gt; <userinput></userinput>
  4986. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4987. &gt; <userinput>config set Dhcp6/option-data[1]/name "subopt2"</userinput>
  4988. &gt; <userinput>config set Dhcp6/option-data[1]/space "isc"</userinput>
  4989. &gt; <userinput>config set Dhcp6/option-data[1]/code 2</userinput>
  4990. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  4991. &gt; <userinput>config set Dhcp6/option-data[1]/data "Hello world"</userinput>
  4992. &gt; <userinput>config commit</userinput>
  4993. &gt; <userinput></userinput>
  4994. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4995. &gt; <userinput>config set Dhcp6/option-data[2]/name "container"</userinput>
  4996. &gt; <userinput>config set Dhcp6/option-data[2]/space "dhcp6"</userinput>
  4997. &gt; <userinput>config set Dhcp6/option-data[2]/code 102</userinput>
  4998. &gt; <userinput>config set Dhcp6/option-data[2]/csv-format true</userinput>
  4999. &gt; <userinput>config set Dhcp6/option-data[2]/data ""</userinput>
  5000. &gt; <userinput>config commit</userinput>
  5001. </screen>
  5002. Even though the "container" option does not carry any data except
  5003. sub-options, the "data" field must be explicitly set to an empty value.
  5004. This is required because in the current version of BIND 10 DHCP, the
  5005. default configuration values are not propagated to the configuration parsers:
  5006. if the "data" is not set the parser will assume that this
  5007. parameter is not specified and an error will be reported.
  5008. </para>
  5009. <para>Note that it is possible to create an option which carries some data
  5010. in addition to the sub-options defined in the encapsulated option space. For example,
  5011. if the "container" option from the previous example was required to carry an uint16
  5012. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  5013. the option definition. (Such an option would then have the following
  5014. data structure: DHCP header, uint16 value, sub-options.) The value specified
  5015. with the "data" parameter - which should be a valid integer enclosed in quotes,
  5016. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  5017. </para>
  5018. </section>
  5019. <section id="dhcp6-config-subnets">
  5020. <title>IPv6 Subnet Selection</title>
  5021. <para>
  5022. The DHCPv6 server may receive requests from local (connected to the
  5023. same subnet as the server) and remote (connecting via relays) clients.
  5024. As server may have many subnet configurations defined, it must select
  5025. appropriate subnet for a given request.
  5026. </para>
  5027. <para>
  5028. The server can not assume which of configured subnets are local. It is
  5029. possible in IPv4, where there is reasonable expectation that the
  5030. server will have a (global) IPv4 address configured on the interface,
  5031. and can use that information to detect whether a subnet is local or
  5032. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  5033. to operate with having link-local addresses only. Therefore an optional
  5034. &quot;interface&quot; parameter is available within a subnet definition
  5035. to designate that a given subnet is local, i.e. reachable directly over
  5036. specified interface. For example the server that is intended to serve
  5037. a local subnet over eth0 may be configured as follows:
  5038. <screen>
  5039. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5040. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  5041. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  5042. &gt; <userinput>config set Dhcp6/subnet6[1]/interface "eth0"</userinput>
  5043. &gt; <userinput>config commit</userinput>
  5044. </screen>
  5045. </para>
  5046. </section>
  5047. <section id="dhcp6-relays">
  5048. <title>DHCPv6 Relays</title>
  5049. <para>
  5050. A DHCPv6 server with multiple subnets defined must select the
  5051. appropriate subnet when it receives a request from client. For clients
  5052. connected via relays, two mechanisms are used:
  5053. </para>
  5054. <para>
  5055. The first uses the linkaddr field in the RELAY_FORW message. The name
  5056. of this field is somewhat misleading in that it does not contain a link-layer
  5057. address: instead, it holds an address (typically a global address) that is
  5058. used to identify a link. The DHCPv6 server checks if the address belongs
  5059. to a defined subnet and, if it does, that subnet is selected for the client's
  5060. request.
  5061. </para>
  5062. <para>
  5063. The second mechanism is based on interface-id options. While forwarding a client's
  5064. message, relays may insert an interface-id option into the message that
  5065. identifies the interface on the relay that received the message. (Some
  5066. relays allow configuration of that parameter, but it is sometimes
  5067. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  5068. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  5069. server can use this information to select the appropriate subnet.
  5070. The information is also returned to the relay which then knows the
  5071. interface to use to transmit the response to the client. In order for
  5072. this to work successfully, the relay interface IDs must be unique within
  5073. the network and the server configuration must match those values.
  5074. </para>
  5075. <para>
  5076. When configuring the DHCPv6 server, it should be noted that two
  5077. similarly-named parameters can be configured for a subnet:
  5078. <itemizedlist>
  5079. <listitem><simpara>
  5080. "interface" defines which local network interface can be used
  5081. to access a given subnet.
  5082. </simpara></listitem>
  5083. <listitem><simpara>
  5084. "interface-id" specifies the content of the interface-id option
  5085. used by relays to identify the interface on the relay to which
  5086. the response packet is sent.
  5087. </simpara></listitem>
  5088. </itemizedlist>
  5089. The two are mutually exclusive: a subnet cannot be both reachable locally
  5090. (direct traffic) and via relays (remote traffic). Specifying both is a
  5091. configuration error and the DHCPv6 server will refuse such a configuration.
  5092. </para>
  5093. <para>
  5094. To specify interface-id with value "vlan123", the following commands can
  5095. be used:
  5096. <screen>
  5097. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5098. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:beef::/48"</userinput>
  5099. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:beef::/48" ]</userinput>
  5100. &gt; <userinput>config set Dhcp6/subnet6[0]/interface-id "vland123"</userinput>
  5101. &gt; <userinput>config commit</userinput>
  5102. </screen>
  5103. </para>
  5104. </section>
  5105. <section id="dhcp6-client-classifier">
  5106. <title>Client Classification in DHCPv6</title>
  5107. <note>
  5108. <para>
  5109. DHCPv6 server has been extended to support limited client classification.
  5110. Although the current capability is modest, it is expected to be expanded
  5111. in the future. It is envisaged that the majority of client classification
  5112. extensions will be using hooks extensions.
  5113. </para>
  5114. </note>
  5115. <para>In certain cases it is useful to differentiate between different types
  5116. of clients and treat them differently. The process of doing classification
  5117. is conducted in two steps. The first step is to assess incoming packet and
  5118. assign it to zero or more classes. This classification is currently simple,
  5119. but is expected to grow in capability soon. Currently the server checks whether
  5120. incoming packet has vendor class option (16). If it has, content
  5121. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  5122. class. For example, modern cable modems will send this option with value
  5123. &quot;docsis3.0&quot; and as a result the packet will belong to class
  5124. &quot;VENDOR_CLASS_docsis3.0&quot;.
  5125. </para>
  5126. <para>It is envisaged that the client classification will be used for changing
  5127. behavior of almost any part of the DHCP engine processing, including assigning
  5128. leases from different pools, assigning different option (or different values of
  5129. the same options) etc. For now, there is only one mechanism that is taking
  5130. advantage of client classification: subnet selection.</para>
  5131. <para>
  5132. Kea can be instructed to limit access to given subnets based on class information.
  5133. This is particularly useful for cases where two types of devices share the
  5134. same link and are expected to be served from two different subnets. The
  5135. primary use case for such a scenario are cable networks. There are two
  5136. classes of devices: cable modem itself, which should be handled a lease
  5137. from subnet A and all other devices behind modems that should get a lease
  5138. from subnet B. That segregation is essential to prevent overly curious
  5139. users from playing with their cable modems. For details on how to set up
  5140. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  5141. </para>
  5142. </section>
  5143. <section id="dhcp6-subnet-class">
  5144. <title>Limiting access to IPv6 subnet to certain classes</title>
  5145. <para>
  5146. In certain cases it beneficial to restrict access to certains subnets
  5147. only to clients that belong to a given subnet. For details on client
  5148. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  5149. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  5150. Let's assume that the server is connected to a network segment that uses
  5151. the 2001:db8:1::/64 prefix. The Administrator of that network has
  5152. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  5153. going to be managed by the Dhcp6 server. Only clients belonging to the
  5154. eRouter1.0 client class are allowed to use that pool. Such a
  5155. configuration can be achieved in the following way:
  5156. <screen>
  5157. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5158. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  5159. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  5160. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "eRouter1.0"</userinput>
  5161. &gt; <userinput>config commit</userinput></screen>
  5162. </para>
  5163. <para>
  5164. Care should be taken with client classification as it is easy to prevent
  5165. clients that do not meet class criteria to be denied any service altogether.
  5166. </para>
  5167. </section>
  5168. </section>
  5169. <section id="dhcp6-serverid">
  5170. <title>Server Identifier in DHCPv6</title>
  5171. <para>The DHCPv6 protocol uses a "server identifier" (also known
  5172. as a DUID) for clients to be able to discriminate between several
  5173. servers present on the same link. There are several types of
  5174. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  5175. possible. This format consists of a link-layer (MAC) address and a
  5176. timestamp. When started for the first time, the DHCPv6 server will
  5177. automatically generate such a DUID and store the chosen value to
  5178. a file. That file is read by the server
  5179. and the contained value used whenever the server is subsequently started.
  5180. </para>
  5181. <para>
  5182. It is unlikely that this parameter should ever need to be changed.
  5183. However, if such a need arises, stop the server, edit the file and restart
  5184. the server. (The file is named b10-dhcp6-serverid and by default is
  5185. stored in the "var" subdirectory of the directory in which BIND 10 is installed.
  5186. This can be changed when BIND 10 is built by using "--localstatedir"
  5187. on the "configure" command line.) The file is a text file that contains
  5188. double digit hexadecimal values
  5189. separated by colons. This format is similar to typical MAC address
  5190. format. Spaces are ignored. No extra characters are allowed in this
  5191. file.
  5192. </para>
  5193. </section>
  5194. <section id="dhcp6-relay-override">
  5195. <title>Using specific relay agent for a subnet</title>
  5196. <para>
  5197. The relay has to have an interface connected to the link on which
  5198. the clients are being configured. Typically the relay has a global IPv6
  5199. address configured on that interface that belongs to the subnet that
  5200. the server will assign addresses from. In such typical case, the
  5201. server is able to use IPv6 address inserted by the relay (in link-addr
  5202. field in RELAY-FORW message) to select appropriate subnet.
  5203. </para>
  5204. <para>
  5205. However, that is not always the case. The relay
  5206. address may not match the subnet in certain deployments. This
  5207. usually means that there is more than one subnet allocated for a given
  5208. link. Two most common examples where this is the case are long lasting
  5209. network renumbering (where both old and new address space is still being
  5210. used) and a cable network. In a cable network both cable modems and the
  5211. devices behind them are physically connected to the same link, yet
  5212. they use distinct addressing. In such case, the DHCPv6 server needs
  5213. additional information (like the value of interface-id option or IPv6
  5214. address inserted in the link-addr field in RELAY-FORW message) to
  5215. properly select an appropriate subnet.
  5216. </para>
  5217. <para>
  5218. The following example assumes that there is a subnet 2001:db8:1::/64
  5219. that is accessible via relay that uses 3000::1 as its IPv6 address.
  5220. The server will be able to select this subnet for any incoming packets
  5221. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  5222. It will also select that subnet for a relay with address 3000::1.
  5223. <screen>
  5224. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5225. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  5226. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::2 - 2001:db8:1::ffff" ]</userinput>
  5227. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  5228. &gt; <userinput>config commit</userinput></screen>
  5229. </para>
  5230. </section>
  5231. <section id="dhcp6-client-class-relay">
  5232. <title>Segregating IPv6 clients in a cable network</title>
  5233. <para>
  5234. In certain cases, it is useful to mix relay address information,
  5235. introduced in <xref linkend="dhcp6-relay-override"/> with client
  5236. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  5237. One specific example is cable network, where typically modems
  5238. get addresses from a different subnet than all devices connected
  5239. behind them.
  5240. </para>
  5241. <para>
  5242. Let's assume that there is one CMTS (Cable Modem Termination System)
  5243. with one CM MAC (a physical link that modems are connected to).
  5244. We want the modems to get addresses from the 3000::/64 subnet,
  5245. while everything connected behind modems should get addresses from
  5246. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  5247. an uses address 3000::1. The following configuration can serve
  5248. that configuration:
  5249. <screen>
  5250. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5251. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "3000::/64"</userinput>
  5252. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "3000::2 - 3000::ffff" ]</userinput>
  5253. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "docsis3.0"</userinput>
  5254. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  5255. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  5256. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:1::/64"</userinput>
  5257. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff" ]</userinput>
  5258. &gt; <userinput>config set Dhcp6/subnet6[1]/relay/ip-address "3000::1"</userinput>
  5259. &gt; <userinput>config commit</userinput></screen>
  5260. </para>
  5261. </section>
  5262. <section id="dhcp6-std">
  5263. <title>Supported Standards</title>
  5264. <para>The following standards and draft standards are currently
  5265. supported:</para>
  5266. <itemizedlist>
  5267. <listitem>
  5268. <simpara><ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>: Supported messages are SOLICIT,
  5269. ADVERTISE, REQUEST, RELEASE, RENEW, and REPLY.</simpara>
  5270. </listitem>
  5271. <listitem>
  5272. <simpara><ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>: Supported option is DNS_SERVERS.</simpara>
  5273. </listitem>
  5274. <listitem>
  5275. <simpara><ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>: Supported option is CLIENT_FQDN.</simpara>
  5276. </listitem>
  5277. </itemizedlist>
  5278. </section>
  5279. <section id="dhcp6-limit">
  5280. <title>DHCPv6 Server Limitations</title>
  5281. <para> These are the current limitations and known problems
  5282. with the DHCPv6 server
  5283. software. Most of them are reflections of the early stage of
  5284. development and should be treated as <quote>not implemented
  5285. yet</quote>, rather than actual limitations.</para>
  5286. <itemizedlist>
  5287. <listitem> <!-- see tickets #3234, #3281 -->
  5288. <para>
  5289. On-line configuration has some limitations. Adding new subnets or
  5290. modifying existing ones work, as is removing the last subnet from
  5291. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  5292. there are 4 subnets configured) will cause issues. The problem is
  5293. caused by simplistic subnet-id assignment. The subnets are always
  5294. numbered, starting from 1. That subnet-id is then used in leases
  5295. that are stored in the lease database. Removing non-last subnet will
  5296. cause the configuration information to mismatch data in the lease
  5297. database. It is possible to manually update subnet-id fields in
  5298. MySQL database, but it is awkward and error prone process. A better
  5299. reconfiguration support is planned.
  5300. </para>
  5301. </listitem>
  5302. <listitem>
  5303. <para>
  5304. On startup, the DHCPv6 server does not get the full configuration from
  5305. BIND 10. To remedy this, after starting BIND 10, modify any parameter
  5306. and commit the changes, e.g.
  5307. <screen>
  5308. &gt; <userinput>config show Dhcp6/renew-timer</userinput>
  5309. Dhcp6/renew-timer 1000 integer (default)
  5310. &gt; <userinput>config set Dhcp6/renew-timer 1001</userinput>
  5311. &gt; <userinput>config commit</userinput></screen>
  5312. </para>
  5313. </listitem>
  5314. <listitem>
  5315. <simpara>Temporary addresses are not supported.</simpara>
  5316. </listitem>
  5317. <listitem>
  5318. <simpara>Prefix delegation is not supported.</simpara>
  5319. </listitem>
  5320. <listitem>
  5321. <simpara>Confirmation (CONFIRM), and duplication report (DECLINE)
  5322. are not yet supported.</simpara>
  5323. </listitem>
  5324. <listitem>
  5325. <simpara>DNS Update is not supported.</simpara>
  5326. </listitem>
  5327. </itemizedlist>
  5328. </section>
  5329. <!--
  5330. <section id="dhcp6-srv-examples">
  5331. <title>Kea DHCPv6 server examples</title>
  5332. <para>
  5333. This section provides easy to use example. Each example can be read
  5334. separately. It is not intended to be read sequentially as there will
  5335. be many repetitions between examples. They are expected to serve as
  5336. easy to use copy-paste solutions to many common deployments.
  5337. </para>
  5338. @todo: add simple configuration for direct clients
  5339. @todo: add configuration for relayed clients
  5340. @todo: add client classification example
  5341. </section> -->
  5342. </chapter>
  5343. <chapter id="libdhcp">
  5344. <title>libdhcp++ library</title>
  5345. <para>
  5346. libdhcp++ is a common library written in C++ that handles
  5347. many DHCP-related tasks, including:
  5348. <itemizedlist>
  5349. <listitem>
  5350. <simpara>DHCPv4 and DHCPv6 packets parsing, manipulation and assembly</simpara>
  5351. </listitem>
  5352. <listitem>
  5353. <simpara>Option parsing, manipulation and assembly</simpara>
  5354. </listitem>
  5355. <listitem>
  5356. <simpara>Network interface detection</simpara>
  5357. </listitem>
  5358. <listitem>
  5359. <simpara>Socket operations such as creation, data transmission and reception and socket closing.</simpara>
  5360. </listitem>
  5361. </itemizedlist>
  5362. </para>
  5363. <para>
  5364. While this library is currently used by BIND 10 DHCP, it is designed to
  5365. be a portable, universal library, useful for any kind of DHCP-related software.
  5366. </para>
  5367. <!-- TODO: point to doxygen docs -->
  5368. <section id="iface-detect">
  5369. <title>Interface detection and Socket handling</title>
  5370. <para>Both the DHCPv4 and DHCPv6 components share network
  5371. interface detection routines. Interface detection is
  5372. currently supported on Linux, all BSD family (FreeBSD, NetBSD,
  5373. OpenBSD), Mac OS X and Solaris 11 systems.</para>
  5374. <para>DHCPv4 requires special raw socket processing to send and receive
  5375. packets from hosts that do not have IPv4 address assigned yet. Support
  5376. for this operation is implemented on Linux only, so it is likely that
  5377. DHCPv4 component will not work in certain cases on systems other than
  5378. Linux.</para>
  5379. </section>
  5380. <!--
  5381. <section id="packet-handling">
  5382. <title>DHCPv4/DHCPv6 packet handling</title>
  5383. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  5384. </section>
  5385. -->
  5386. </chapter>
  5387. <chapter id="statistics">
  5388. <title>Statistics</title>
  5389. <para>
  5390. The <command>b10-stats</command> process is started by
  5391. <command>b10-init</command>.
  5392. It periodically collects statistics data from various modules
  5393. and aggregates it.
  5394. <!-- TODO -->
  5395. </para>
  5396. <para>
  5397. This stats daemon provides commands to identify if it is
  5398. running, show specified or all statistics data, and show specified
  5399. or all statistics data schema.
  5400. For example, using <command>bindctl</command>:
  5401. <screen>
  5402. &gt; <userinput>Stats show</userinput>
  5403. {
  5404. "Auth": {
  5405. "opcode.iquery": 0,
  5406. "opcode.notify": 10,
  5407. "opcode.query": 869617,
  5408. ...
  5409. "queries.tcp": 1749,
  5410. "queries.udp": 867868
  5411. },
  5412. "Init": {
  5413. "boot_time": "2011-01-20T16:59:03Z"
  5414. },
  5415. "Stats": {
  5416. "boot_time": "2011-01-20T16:59:05Z",
  5417. "last_update_time": "2011-01-20T17:04:05Z",
  5418. "lname": "4d3869d9_a@jreed.example.net",
  5419. "report_time": "2011-01-20T17:04:06Z",
  5420. "timestamp": 1295543046.823504
  5421. }
  5422. }
  5423. </screen>
  5424. </para>
  5425. </chapter>
  5426. <chapter id="logging">
  5427. <title>Logging</title>
  5428. <section>
  5429. <title>Logging configuration</title>
  5430. <para>
  5431. The logging system in BIND 10 is configured through the
  5432. Logging module. All BIND 10 modules will look at the
  5433. configuration in Logging to see what should be logged and
  5434. to where.
  5435. <!-- TODO: what is context of Logging module for readers of this guide? -->
  5436. </para>
  5437. <section>
  5438. <title>Loggers</title>
  5439. <para>
  5440. Within BIND 10, a message is logged through a component
  5441. called a "logger". Different parts of BIND 10 log messages
  5442. through different loggers, and each logger can be configured
  5443. independently of one another.
  5444. </para>
  5445. <para>
  5446. In the Logging module, you can specify the configuration
  5447. for zero or more loggers; any that are not specified will
  5448. take appropriate default values.
  5449. </para>
  5450. <para>
  5451. The three most important elements of a logger configuration
  5452. are the <option>name</option> (the component that is
  5453. generating the messages), the <option>severity</option>
  5454. (what to log), and the <option>output_options</option>
  5455. (where to log).
  5456. </para>
  5457. <section>
  5458. <title>name (string)</title>
  5459. <para>
  5460. Each logger in the system has a name, the name being that
  5461. of the component using it to log messages. For instance,
  5462. if you want to configure logging for the resolver module,
  5463. you add an entry for a logger named <quote>Resolver</quote>. This
  5464. configuration will then be used by the loggers in the
  5465. Resolver module, and all the libraries used by it.
  5466. </para>
  5467. <!-- TODO: later we will have a way to know names of all modules
  5468. Right now you can only see what their names are if they are running
  5469. (a simple 'help' without anything else in bindctl for instance).
  5470. -->
  5471. <para>
  5472. If you want to specify logging for one specific library
  5473. within the module, you set the name to
  5474. <replaceable>module.library</replaceable>. For example, the
  5475. logger used by the nameserver address store component
  5476. has the full name of <quote>Resolver.nsas</quote>. If
  5477. there is no entry in Logging for a particular library,
  5478. it will use the configuration given for the module.
  5479. <!-- TODO: how to know these specific names?
  5480. We will either have to document them or tell the administrator to
  5481. specify module-wide logging and see what appears...
  5482. -->
  5483. </para>
  5484. <para>
  5485. <!-- TODO: severity has not been covered yet -->
  5486. To illustrate this, suppose you want the cache library
  5487. to log messages of severity DEBUG, and the rest of the
  5488. resolver code to log messages of severity INFO. To achieve
  5489. this you specify two loggers, one with the name
  5490. <quote>Resolver</quote> and severity INFO, and one with
  5491. the name <quote>Resolver.cache</quote> with severity
  5492. DEBUG. As there are no entries for other libraries (e.g.
  5493. the nsas), they will use the configuration for the module
  5494. (<quote>Resolver</quote>), so giving the desired behavior.
  5495. </para>
  5496. <para>
  5497. One special case is that of a module name of <quote>*</quote>
  5498. (asterisks), which is interpreted as <emphasis>any</emphasis>
  5499. module. You can set global logging options by using this,
  5500. including setting the logging configuration for a library
  5501. that is used by multiple modules (e.g. <quote>*.config</quote>
  5502. specifies the configuration library code in whatever
  5503. module is using it).
  5504. </para>
  5505. <para>
  5506. If there are multiple logger specifications in the
  5507. configuration that might match a particular logger, the
  5508. specification with the more specific logger name takes
  5509. precedence. For example, if there are entries for
  5510. both <quote>*</quote> and <quote>Resolver</quote>, the
  5511. resolver module &mdash; and all libraries it uses &mdash;
  5512. will log messages according to the configuration in the
  5513. second entry (<quote>Resolver</quote>). All other modules
  5514. will use the configuration of the first entry
  5515. (<quote>*</quote>). If there was also a configuration
  5516. entry for <quote>Resolver.cache</quote>, the cache library
  5517. within the resolver would use that in preference to the
  5518. entry for <quote>Resolver</quote>.
  5519. </para>
  5520. <para>
  5521. One final note about the naming. When specifying the
  5522. module name within a logger, use the name of the module
  5523. as specified in <command>bindctl</command>, e.g.
  5524. <quote>Resolver</quote> for the resolver module,
  5525. <quote>Xfrout</quote> for the xfrout module, etc. When
  5526. the message is logged, the message will include the name
  5527. of the logger generating the message, but with the module
  5528. name replaced by the name of the process implementing
  5529. the module (so for example, a message generated by the
  5530. <quote>Auth.cache</quote> logger will appear in the output
  5531. with a logger name of <quote>b10-auth.cache</quote>).
  5532. </para>
  5533. </section>
  5534. <section>
  5535. <title>severity (string)</title>
  5536. <para>
  5537. This specifies the category of messages logged.
  5538. Each message is logged with an associated severity which
  5539. may be one of the following (in descending order of
  5540. severity):
  5541. </para>
  5542. <itemizedlist>
  5543. <listitem>
  5544. <simpara> FATAL </simpara>
  5545. </listitem>
  5546. <listitem>
  5547. <simpara> ERROR </simpara>
  5548. </listitem>
  5549. <listitem>
  5550. <simpara> WARN </simpara>
  5551. </listitem>
  5552. <listitem>
  5553. <simpara> INFO </simpara>
  5554. </listitem>
  5555. <listitem>
  5556. <simpara> DEBUG </simpara>
  5557. </listitem>
  5558. </itemizedlist>
  5559. <para>
  5560. When the severity of a logger is set to one of these
  5561. values, it will only log messages of that severity, and
  5562. the severities above it. The severity may also be set to
  5563. NONE, in which case all messages from that logger are
  5564. inhibited.
  5565. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  5566. </para>
  5567. </section>
  5568. <section>
  5569. <title>output_options (list)</title>
  5570. <para>
  5571. Each logger can have zero or more
  5572. <option>output_options</option>. These specify where log
  5573. messages are sent to. These are explained in detail below.
  5574. </para>
  5575. <para>
  5576. The other options for a logger are:
  5577. </para>
  5578. </section>
  5579. <section>
  5580. <title>debuglevel (integer)</title>
  5581. <para>
  5582. When a logger's severity is set to DEBUG, this value
  5583. specifies what debug messages should be printed. It ranges
  5584. from 0 (least verbose) to 99 (most verbose).
  5585. </para>
  5586. <!-- TODO: complete this sentence:
  5587. The general classification of debug message types is
  5588. TODO; there's a ticket to determine these levels, see #1074
  5589. -->
  5590. <para>
  5591. If severity for the logger is not DEBUG, this value is ignored.
  5592. </para>
  5593. </section>
  5594. <section>
  5595. <title>additive (true or false)</title>
  5596. <para>
  5597. If this is true, the <option>output_options</option> from
  5598. the parent will be used. For example, if there are two
  5599. loggers configured; <quote>Resolver</quote> and
  5600. <quote>Resolver.cache</quote>, and <option>additive</option>
  5601. is true in the second, it will write the log messages
  5602. not only to the destinations specified for
  5603. <quote>Resolver.cache</quote>, but also to the destinations
  5604. as specified in the <option>output_options</option> in
  5605. the logger named <quote>Resolver</quote>.
  5606. <!-- TODO: check this -->
  5607. </para>
  5608. </section>
  5609. </section>
  5610. <section>
  5611. <title>Output Options</title>
  5612. <para>
  5613. The main settings for an output option are the
  5614. <option>destination</option> and a value called
  5615. <option>output</option>, the meaning of which depends on
  5616. the destination that is set.
  5617. </para>
  5618. <section>
  5619. <title>destination (string)</title>
  5620. <para>
  5621. The destination is the type of output. It can be one of:
  5622. </para>
  5623. <itemizedlist>
  5624. <listitem>
  5625. <simpara> console </simpara>
  5626. </listitem>
  5627. <listitem>
  5628. <simpara> file </simpara>
  5629. </listitem>
  5630. <listitem>
  5631. <simpara> syslog </simpara>
  5632. </listitem>
  5633. </itemizedlist>
  5634. </section>
  5635. <section>
  5636. <title>output (string)</title>
  5637. <para>
  5638. Depending on what is set as the output destination, this
  5639. value is interpreted as follows:
  5640. </para>
  5641. <variablelist>
  5642. <varlistentry>
  5643. <term><option>destination</option> is <quote>console</quote></term>
  5644. <listitem>
  5645. <para>
  5646. The value of output must be one of <quote>stdout</quote>
  5647. (messages printed to standard output) or
  5648. <quote>stderr</quote> (messages printed to standard
  5649. error).
  5650. </para>
  5651. <para>
  5652. Note: if output is set to <quote>stderr</quote> and a lot of
  5653. messages are produced in a short time (e.g. if the logging
  5654. level is set to DEBUG), you may occasionally see some messages
  5655. jumbled up together. This is due to a combination of the way
  5656. that messages are written to the screen and the unbuffered
  5657. nature of the standard error stream. If this occurs, it is
  5658. recommended that output be set to <quote>stdout</quote>.
  5659. </para>
  5660. </listitem>
  5661. </varlistentry>
  5662. <varlistentry>
  5663. <term><option>destination</option> is <quote>file</quote></term>
  5664. <listitem>
  5665. <para>
  5666. The value of output is interpreted as a file name;
  5667. log messages will be appended to this file.
  5668. </para>
  5669. </listitem>
  5670. </varlistentry>
  5671. <varlistentry>
  5672. <term><option>destination</option> is <quote>syslog</quote></term>
  5673. <listitem>
  5674. <para>
  5675. The value of output is interpreted as the
  5676. <command>syslog</command> facility (e.g.
  5677. <emphasis>local0</emphasis>) that should be used
  5678. for log messages.
  5679. </para>
  5680. </listitem>
  5681. </varlistentry>
  5682. </variablelist>
  5683. <para>
  5684. The other options for <option>output_options</option> are:
  5685. </para>
  5686. <section>
  5687. <title>flush (true of false)</title>
  5688. <para>
  5689. Flush buffers after each log message. Doing this will
  5690. reduce performance but will ensure that if the program
  5691. terminates abnormally, all messages up to the point of
  5692. termination are output.
  5693. </para>
  5694. </section>
  5695. <section>
  5696. <title>maxsize (integer)</title>
  5697. <para>
  5698. Only relevant when destination is file, this is maximum
  5699. file size of output files in bytes. When the maximum
  5700. size is reached, the file is renamed and a new file opened.
  5701. (For example, a ".1" is appended to the name &mdash;
  5702. if a ".1" file exists, it is renamed ".2",
  5703. etc.)
  5704. </para>
  5705. <para>
  5706. If this is 0, no maximum file size is used.
  5707. </para>
  5708. <note>
  5709. <simpara>
  5710. Due to a limitation of the underlying logging library
  5711. (log4cplus), rolling over the log files (from ".1" to
  5712. ".2", etc) may show odd results: There can be
  5713. multiple small files at the timing of roll over. This
  5714. can happen when multiple BIND 10 processes try to roll
  5715. over the files simultaneously.
  5716. Version 1.1.0 of log4cplus solved this problem, so if
  5717. this or higher version of log4cplus is used to build
  5718. BIND 10, it shouldn't happen. Even for older versions
  5719. it is normally expected to happen rarely unless the log
  5720. messages are produced very frequently by multiple
  5721. different processes.
  5722. </simpara>
  5723. </note>
  5724. </section>
  5725. <section>
  5726. <title>maxver (integer)</title>
  5727. <para>
  5728. Maximum number of old log files to keep around when
  5729. rolling the output file. Only relevant when
  5730. <option>destination</option> is <quote>file</quote>.
  5731. </para>
  5732. </section>
  5733. </section>
  5734. </section>
  5735. <section>
  5736. <title>Example session</title>
  5737. <para>
  5738. In this example we want to set the global logging to
  5739. write to the file <filename>/var/log/my_bind10.log</filename>,
  5740. at severity WARN. We want the authoritative server to
  5741. log at DEBUG with debuglevel 40, to a different file
  5742. (<filename>/tmp/debug_messages</filename>).
  5743. </para>
  5744. <para>
  5745. Start <command>bindctl</command>.
  5746. </para>
  5747. <para>
  5748. <screen>["login success "]
  5749. &gt; <userinput>config show Logging</userinput>
  5750. Logging/loggers [] list
  5751. </screen>
  5752. </para>
  5753. <para>
  5754. By default, no specific loggers are configured, in which
  5755. case the severity defaults to INFO and the output is
  5756. written to stderr.
  5757. </para>
  5758. <para>
  5759. Let's first add a default logger:
  5760. </para>
  5761. <!-- TODO: adding the empty loggers makes no sense -->
  5762. <para>
  5763. <screen>&gt; <userinput>config add Logging/loggers</userinput>
  5764. &gt; <userinput>config show Logging</userinput>
  5765. Logging/loggers/ list (modified)
  5766. </screen>
  5767. </para>
  5768. <para>
  5769. The loggers value line changed to indicate that it is no
  5770. longer an empty list:
  5771. </para>
  5772. <para>
  5773. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  5774. Logging/loggers[0]/name "" string (default)
  5775. Logging/loggers[0]/severity "INFO" string (default)
  5776. Logging/loggers[0]/debuglevel 0 integer (default)
  5777. Logging/loggers[0]/additive false boolean (default)
  5778. Logging/loggers[0]/output_options [] list (default)
  5779. </screen>
  5780. </para>
  5781. <para>
  5782. The name is mandatory, so we must set it. We will also
  5783. change the severity as well. Let's start with the global
  5784. logger.
  5785. </para>
  5786. <para>
  5787. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  5788. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  5789. &gt; <userinput>config show Logging/loggers</userinput>
  5790. Logging/loggers[0]/name "*" string (modified)
  5791. Logging/loggers[0]/severity "WARN" string (modified)
  5792. Logging/loggers[0]/debuglevel 0 integer (default)
  5793. Logging/loggers[0]/additive false boolean (default)
  5794. Logging/loggers[0]/output_options [] list (default)
  5795. </screen>
  5796. </para>
  5797. <para>
  5798. Of course, we need to specify where we want the log
  5799. messages to go, so we add an entry for an output option.
  5800. </para>
  5801. <para>
  5802. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  5803. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  5804. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  5805. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  5806. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  5807. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  5808. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  5809. </screen>
  5810. </para>
  5811. <para>
  5812. These aren't the values we are looking for.
  5813. </para>
  5814. <para>
  5815. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  5816. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log</userinput>
  5817. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  5818. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  5819. </screen>
  5820. </para>
  5821. <para>
  5822. Which would make the entire configuration for this logger
  5823. look like:
  5824. </para>
  5825. <para>
  5826. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  5827. Logging/loggers[0]/name "*" string (modified)
  5828. Logging/loggers[0]/severity "WARN" string (modified)
  5829. Logging/loggers[0]/debuglevel 0 integer (default)
  5830. Logging/loggers[0]/additive false boolean (default)
  5831. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  5832. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  5833. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  5834. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  5835. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  5836. </screen>
  5837. </para>
  5838. <para>
  5839. That looks OK, so let's commit it before we add the
  5840. configuration for the authoritative server's logger.
  5841. </para>
  5842. <para>
  5843. <screen>&gt; <userinput> config commit</userinput></screen>
  5844. </para>
  5845. <para>
  5846. Now that we have set it, and checked each value along
  5847. the way, adding a second entry is quite similar.
  5848. </para>
  5849. <para>
  5850. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  5851. &gt; <userinput> config set Logging/loggers[1]/name Auth</userinput>
  5852. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  5853. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  5854. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  5855. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  5856. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log</userinput>
  5857. &gt; <userinput> config commit</userinput>
  5858. </screen>
  5859. </para>
  5860. <para>
  5861. And that's it. Once we have found whatever it was we
  5862. needed the debug messages for, we can simply remove the
  5863. second logger to let the authoritative server use the
  5864. same settings as the rest.
  5865. </para>
  5866. <para>
  5867. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  5868. &gt; <userinput> config commit</userinput>
  5869. </screen>
  5870. </para>
  5871. <para>
  5872. And every module will now be using the values from the
  5873. logger named <quote>*</quote>.
  5874. </para>
  5875. </section>
  5876. </section>
  5877. <section>
  5878. <title>Logging Message Format</title>
  5879. <para>
  5880. Each message written by BIND 10 to the configured logging
  5881. destinations comprises a number of components that identify
  5882. the origin of the message and, if the message indicates
  5883. a problem, information about the problem that may be
  5884. useful in fixing it.
  5885. </para>
  5886. <para>
  5887. Consider the message below logged to a file:
  5888. <screen>2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  5889. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)</screen>
  5890. </para>
  5891. <para>
  5892. Note: the layout of messages written to the system logging
  5893. file (syslog) may be slightly different. This message has
  5894. been split across two lines here for display reasons; in the
  5895. logging file, it will appear on one line.)
  5896. </para>
  5897. <para>
  5898. The log message comprises a number of components:
  5899. <variablelist>
  5900. <varlistentry>
  5901. <term>2011-06-15 13:48:22.034</term>
  5902. <!-- TODO: timestamp repeated even if using syslog? -->
  5903. <listitem><para>
  5904. The date and time at which the message was generated.
  5905. </para></listitem>
  5906. </varlistentry>
  5907. <varlistentry>
  5908. <term>ERROR</term>
  5909. <listitem><para>
  5910. The severity of the message.
  5911. </para></listitem>
  5912. </varlistentry>
  5913. <varlistentry>
  5914. <term>[b10-resolver.asiolink]</term>
  5915. <listitem><para>
  5916. The source of the message. This comprises two components:
  5917. the BIND 10 process generating the message (in this
  5918. case, <command>b10-resolver</command>) and the module
  5919. within the program from which the message originated
  5920. (which in the example is the asynchronous I/O link
  5921. module, asiolink).
  5922. </para></listitem>
  5923. </varlistentry>
  5924. <varlistentry>
  5925. <term>ASIODNS_OPENSOCK</term>
  5926. <listitem><para>
  5927. The message identification. Every message in BIND 10
  5928. has a unique identification, which can be used as an
  5929. index into the <ulink
  5930. url="bind10-messages.html"><citetitle>BIND 10 Messages
  5931. Manual</citetitle></ulink> (<ulink
  5932. url="http://bind10.isc.org/docs/bind10-messages.html"
  5933. />) from which more information can be obtained.
  5934. </para></listitem>
  5935. </varlistentry>
  5936. <varlistentry>
  5937. <term>error 111 opening TCP socket to 127.0.0.1(53)</term>
  5938. <listitem><para>
  5939. A brief description of the cause of the problem.
  5940. Within this text, information relating to the condition
  5941. that caused the message to be logged will be included.
  5942. In this example, error number 111 (an operating
  5943. system-specific error number) was encountered when
  5944. trying to open a TCP connection to port 53 on the
  5945. local system (address 127.0.0.1). The next step
  5946. would be to find out the reason for the failure by
  5947. consulting your system's documentation to identify
  5948. what error number 111 means.
  5949. </para></listitem>
  5950. </varlistentry>
  5951. </variablelist>
  5952. </para>
  5953. </section>
  5954. </chapter>
  5955. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  5956. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  5957. <!-- <index> <title>Index</title> </index> -->
  5958. </book>
  5959. <!--
  5960. TODO:
  5961. Overview
  5962. Getting BIND 10 Installed
  5963. Basics
  5964. Dependencies
  5965. Optional
  5966. Advanced
  5967. How Does Everything Work Together?
  5968. Need Help?
  5969. -->