bind10-guide.xml 259 KB

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