bind10-guide.xml 252 KB

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