bind10-guide.txt 87 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156
  1. BIND 10 Guide
  2. Administrator Reference for BIND 10
  3. This is the reference guide for BIND 10 version 20120712.
  4. Copyright © 2010-2012 Internet Systems Consortium, Inc.
  5. Abstract
  6. BIND 10 is a framework that features Domain Name System (DNS) suite and
  7. Dynamic Host Configuration Protocol (DHCP) servers with development
  8. managed by Internet Systems Consortium (ISC). It includes DNS libraries,
  9. modular components for controlling authoritative and recursive DNS
  10. servers, and experimental DHCPv4 and DHCPv6 servers.
  11. This is the reference guide for BIND 10 version 20120712. The most
  12. up-to-date version of this document (in PDF, HTML, and plain text
  13. formats), along with other documents for BIND 10, can be found at
  14. http://bind10.isc.org/docs.
  15. --------------------------------------------------------------------------
  16. Table of Contents
  17. Preface
  18. 1. Acknowledgements
  19. 1. Introduction
  20. 1.1. Supported Platforms
  21. 1.2. Required Software at Run-time
  22. 1.3. Starting and Stopping the Server
  23. 1.4. Managing BIND 10
  24. 2. Installation
  25. 2.1. Packages
  26. 2.2. Install Hierarchy
  27. 2.3. Building Requirements
  28. 2.4. Quick start
  29. 2.5. Installation from source
  30. 2.5.1. Download Tar File
  31. 2.5.2. Retrieve from Git
  32. 2.5.3. Configure before the build
  33. 2.5.4. Build
  34. 2.5.5. Install
  35. 3. Starting BIND10 with bind10
  36. 3.1. Starting BIND 10
  37. 3.2. Configuration to start processes
  38. 4. Command channel
  39. 5. Configuration manager
  40. 6. Remote control daemon
  41. 6.1. Configuration specification for b10-cmdctl
  42. 7. Control and configure user interface
  43. 8. Authoritative Server
  44. 8.1. Server Configurations
  45. 8.2. Data Source Backends
  46. 8.2.1. Data source types
  47. 8.2.2. Examples
  48. 8.3. Loading Master Zones Files
  49. 9. Incoming Zone Transfers
  50. 9.1. Configuration for Incoming Zone Transfers
  51. 9.2. Enabling IXFR
  52. 9.3. Secondary Manager
  53. 9.4. Trigger an Incoming Zone Transfer Manually
  54. 9.5. Incoming Transfers with In-memory Datasource
  55. 10. Outbound Zone Transfers
  56. 11. Dynamic DNS Update
  57. 11.1. Enabling Dynamic Update
  58. 11.2. Access Control
  59. 11.3. Miscellaneous Operational Issues
  60. 12. Recursive Name Server
  61. 12.1. Access Control
  62. 12.2. Forwarding
  63. 13. DHCPv4 Server
  64. 13.1. DHCPv4 Server Usage
  65. 13.2. DHCPv4 Server Configuration
  66. 13.3. Supported standards
  67. 13.4. DHCPv4 Server Limitations
  68. 14. DHCPv6 Server
  69. 14.1. DHCPv6 Server Usage
  70. 14.2. DHCPv6 Server Configuration
  71. 14.3. Supported DHCPv6 Standards
  72. 14.4. DHCPv6 Server Limitations
  73. 15. libdhcp++ library
  74. 15.1. Interface detection
  75. 15.2. DHCPv4/DHCPv6 packet handling
  76. 16. Statistics
  77. 17. Logging
  78. 17.1. Logging configuration
  79. 17.1.1. Loggers
  80. 17.1.2. Output Options
  81. 17.1.3. Example session
  82. 17.2. Logging Message Format
  83. List of Tables
  84. 3.1. Special startup components
  85. Preface
  86. Table of Contents
  87. 1. Acknowledgements
  88. 1. Acknowledgements
  89. ISC would like to acknowledge generous support for BIND 10 development of
  90. DHCPv4 and DHCPv6 components provided by Comcast.
  91. Chapter 1. Introduction
  92. Table of Contents
  93. 1.1. Supported Platforms
  94. 1.2. Required Software at Run-time
  95. 1.3. Starting and Stopping the Server
  96. 1.4. Managing BIND 10
  97. BIND is the popular implementation of a DNS server, developer interfaces,
  98. and DNS tools. BIND 10 is a rewrite of BIND 9 and ISC DHCP. BIND 10 is
  99. written in C++ and Python and provides a modular environment for serving,
  100. maintaining, and developing DNS and DHCP. BIND 10 provides a EDNS0- and
  101. DNSSEC-capable authoritative DNS server and a caching recursive name
  102. server which also provides forwarding. It also provides experimental
  103. DHCPv4 and DHCPv6 servers.
  104. This guide covers the experimental prototype of BIND 10 version 20120712.
  105. 1.1. Supported Platforms
  106. BIND 10 builds have been tested on (in no particular order) Debian
  107. GNU/Linux 6 and unstable, Ubuntu 9.10, NetBSD 5, Solaris 10 and 11,
  108. FreeBSD 7 and 8, CentOS Linux 5.3, MacOS 10.6 and 10.7, and OpenBSD 5.1.
  109. It has been tested on Sparc, i386, and amd64 hardware platforms. It is
  110. planned for BIND 10 to build, install and run on Windows and standard
  111. Unix-type platforms.
  112. 1.2. Required Software at Run-time
  113. Running BIND 10 uses various extra software which may not be provided in
  114. some operating systems' default installations nor standard packages
  115. collections. You may need to install this required software separately.
  116. (For the build requirements, also see Section 2.3, “Building
  117. Requirements”.)
  118. BIND 10 requires at least Python 3.1 (http://www.python.org/). It also
  119. works with Python 3.2.
  120. BIND 10 uses the Botan crypto library for C++
  121. (http://botan.randombit.net/). It requires at least Botan version 1.8.
  122. BIND 10 uses the log4cplus C++ logging library
  123. (http://log4cplus.sourceforge.net/). It requires at least log4cplus
  124. version 1.0.3.
  125. The authoritative DNS server uses SQLite3 (http://www.sqlite.org/). It
  126. needs at least SQLite version 3.3.9.
  127. The b10-ddns, b10-xfrin, b10-xfrout, and b10-zonemgr components require
  128. the libpython3 library and the Python _sqlite3.so module (which is
  129. included with Python). Python modules need to be built for the
  130. corresponding Python 3.
  131. 1.3. Starting and Stopping the Server
  132. BIND 10 is modular. Part of this modularity is accomplished using multiple
  133. cooperating processes which, together, provide the server functionality.
  134. This is a change from the previous generation of BIND software, which used
  135. a single process.
  136. At first, running many different processes may seem confusing. However,
  137. these processes are started, stopped, and maintained by a single command,
  138. bind10. This command starts a master process which will start other
  139. processes as needed. The processes started by the bind10 command have
  140. names starting with "b10-", including:
  141. o b10-auth — Authoritative DNS server. This process serves DNS requests.
  142. o b10-cfgmgr — Configuration manager. This process maintains all of the
  143. configuration for BIND 10.
  144. o b10-cmdctl — Command and control service. This process allows external
  145. control of the BIND 10 system.
  146. o b10-ddns — Dynamic DNS update service. This process is used to handle
  147. incoming DNS update requests to allow granted clients to update zones
  148. for which BIND 10 is serving as a primary server.
  149. o b10-msgq — Message bus daemon. This process coordinates communication
  150. between all of the other BIND 10 processes.
  151. o b10-resolver — Recursive name server. This process handles incoming
  152. DNS queries and provides answers from its cache or by recursively
  153. doing remote lookups.
  154. o b10-sockcreator — Socket creator daemon. This process creates sockets
  155. used by network-listening BIND 10 processes.
  156. o b10-stats — Statistics collection daemon. This process collects and
  157. reports statistics data.
  158. o b10-stats-httpd — HTTP server for statistics reporting. This process
  159. reports statistics data in XML format over HTTP.
  160. o b10-xfrin — Incoming zone transfer service. This process is used to
  161. transfer a new copy of a zone into BIND 10, when acting as a secondary
  162. server.
  163. o b10-xfrout — Outgoing zone transfer service. This process is used to
  164. handle transfer requests to send a local zone to a remote secondary
  165. server.
  166. o b10-zonemgr — Secondary zone manager. This process keeps track of
  167. timers and other necessary information for BIND 10 to act as a slave
  168. server.
  169. These are ran by bind10 and do not need to be manually started
  170. independently.
  171. 1.4. Managing BIND 10
  172. Once BIND 10 is running, a few commands are used to interact directly with
  173. the system:
  174. o bindctl — Interactive administration interface. This is a low-level
  175. command-line tool which allows a developer or an experienced
  176. administrator to control BIND 10.
  177. o b10-loadzone — Zone file loader. This tool will load standard
  178. masterfile-format zone files into BIND 10.
  179. o b10-cmdctl-usermgr — User access control. This tool allows an
  180. administrator to authorize additional users to manage BIND 10.
  181. The tools and modules are covered in full detail in this guide. In
  182. addition, manual pages are also provided in the default installation.
  183. BIND 10 also provides libraries and programmer interfaces for C++ and
  184. Python for the message bus, configuration backend, and, of course, DNS.
  185. These include detailed developer documentation and code examples.
  186. Chapter 2. Installation
  187. Table of Contents
  188. 2.1. Packages
  189. 2.2. Install Hierarchy
  190. 2.3. Building Requirements
  191. 2.4. Quick start
  192. 2.5. Installation from source
  193. 2.5.1. Download Tar File
  194. 2.5.2. Retrieve from Git
  195. 2.5.3. Configure before the build
  196. 2.5.4. Build
  197. 2.5.5. Install
  198. 2.1. Packages
  199. Some operating systems or softare package vendors may provide
  200. ready-to-use, pre-built software packages for the BIND 10 suite.
  201. Installing a pre-built package means you do not need to install build-only
  202. prerequisites and do not need to make the software.
  203. FreeBSD ports, NetBSD pkgsrc, and Debian testing package collections
  204. provide all the prerequisite packages.
  205. 2.2. Install Hierarchy
  206. The following is the standard, common layout of the complete BIND 10
  207. installation:
  208. o bin/ — general tools and diagnostic clients.
  209. o etc/bind10-devel/ — configuration files.
  210. o lib/ — libraries and python modules.
  211. o libexec/bind10-devel/ — executables that a user wouldn't normally run
  212. directly and are not run independently. These are the BIND 10 modules
  213. which are daemons started by the bind10 tool.
  214. o sbin/ — commands used by the system administrator.
  215. o share/bind10-devel/ — configuration specifications.
  216. o share/doc/bind10-devel/ — this guide and other supplementary
  217. documentation.
  218. o share/man/ — manual pages (online documentation).
  219. o var/bind10-devel/ — data source and configuration databases.
  220. 2.3. Building Requirements
  221. In addition to the run-time requirements (listed in Section 1.2, “Required
  222. Software at Run-time”), building BIND 10 from source code requires various
  223. development include headers and program development tools.
  224. Note
  225. Some operating systems have split their distribution packages into a
  226. run-time and a development package. You will need to install the
  227. development package versions, which include header files and libraries, to
  228. build BIND 10 from source code.
  229. Building from source code requires the Boost build-time headers
  230. (http://www.boost.org/). At least Boost version 1.35 is required.
  231. To build BIND 10, also install the Botan (at least version 1.8) and the
  232. log4cplus (at least version 1.0.3) development include headers.
  233. Building BIND 10 also requires a C++ compiler and standard development
  234. headers, make, and pkg-config. BIND 10 builds have been tested with GCC
  235. g++ 3.4.3, 4.1.2, 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++
  236. 5.10.
  237. Visit the user-contributed wiki at
  238. http://bind10.isc.org/wiki/SystemSpecificNotes for system-specific
  239. installation tips.
  240. 2.4. Quick start
  241. Note
  242. This quickly covers the standard steps for installing and deploying BIND
  243. 10 as an authoritative name server using its defaults. For
  244. troubleshooting, full customizations and further details, see the
  245. respective chapters in the BIND 10 guide.
  246. To quickly get started with BIND 10, follow these steps.
  247.  1. Install required run-time and build dependencies.
  248.  2. Download the BIND 10 source tar file from
  249. ftp://ftp.isc.org/isc/bind10/.
  250.  3. Extract the tar file:
  251. $ gzcat bind10-VERSION.tar.gz | tar -xvf -
  252.  4. Go into the source and run configure:
  253. $ cd bind10-VERSION
  254. $ ./configure
  255.  5. Build it:
  256. $ make
  257.  6. Install it (to default /usr/local):
  258. $ make install
  259.  7. Start the server:
  260. $ /usr/local/sbin/bind10
  261.  8. Test it; for example:
  262. $ dig @127.0.0.1 -c CH -t TXT authors.bind
  263.  9. Load desired zone file(s), for example:
  264. $ b10-loadzone your.zone.example.org
  265. 10. Test the new zone.
  266. 2.5. Installation from source
  267. BIND 10 is open source software written in C++ and Python. It is freely
  268. available in source code form from ISC as a downloadable tar file or via
  269. BIND 10's Git code revision control service. (It may also be available in
  270. pre-compiled ready-to-use packages from operating system vendors.)
  271. 2.5.1. Download Tar File
  272. Downloading a release tar file is the recommended method to obtain the
  273. source code.
  274. The BIND 10 releases are available as tar file downloads from
  275. ftp://ftp.isc.org/isc/bind10/. Periodic development snapshots may also be
  276. available.
  277. 2.5.2. Retrieve from Git
  278. Downloading this "bleeding edge" code is recommended only for developers
  279. or advanced users. Using development code in a production environment is
  280. not recommended.
  281. Note
  282. When using source code retrieved via Git, additional software will be
  283. required: automake (v1.11 or newer), libtoolize, and autoconf (2.59 or
  284. newer). These may need to be installed.
  285. The latest development code (and temporary experiments and un-reviewed
  286. code) is available via the BIND 10 code revision control system. This is
  287. powered by Git and all the BIND 10 development is public. The leading
  288. development is done in the “master” branch.
  289. The code can be checked out from git://git.bind10.isc.org/bind10; for
  290. example:
  291. $ git clone git://git.bind10.isc.org/bind10
  292. When checking out the code from the code version control system, it
  293. doesn't include the generated configure script, Makefile.in files, nor
  294. their related build files. They can be created by running autoreconf with
  295. the --install switch. This will run autoconf, aclocal, libtoolize,
  296. autoheader, automake, and related commands.
  297. 2.5.3. Configure before the build
  298. BIND 10 uses the GNU Build System to discover build environment details.
  299. To generate the makefiles using the defaults, simply run:
  300. $ ./configure
  301. Run ./configure with the --help switch to view the different options. Some
  302. commonly-used options are:
  303. --prefix
  304. Define the installation location (the default is /usr/local/).
  305. --with-boost-include
  306. Define the path to find the Boost headers.
  307. --with-pythonpath
  308. Define the path to Python 3.1 if it is not in the standard
  309. execution path.
  310. --with-gtest
  311. Enable building the C++ Unit Tests using the Google Tests
  312. framework. Optionally this can define the path to the gtest header
  313. files and library.
  314. For example, the following configures it to find the Boost headers, find
  315. the Python interpreter, and sets the installation location:
  316. $ ./configure \
  317. --with-boost-include=/usr/pkg/include \
  318. --with-pythonpath=/usr/pkg/bin/python3.1 \
  319. --prefix=/opt/bind10
  320. If the configure fails, it may be due to missing or old dependencies.
  321. 2.5.4. Build
  322. After the configure step is complete, to build the executables from the
  323. C++ code and prepare the Python scripts, run:
  324. $ make
  325. 2.5.5. Install
  326. To install the BIND 10 executables, support files, and documentation, run:
  327. $ make install
  328. Note
  329. The install step may require superuser privileges.
  330. Chapter 3. Starting BIND10 with bind10
  331. Table of Contents
  332. 3.1. Starting BIND 10
  333. 3.2. Configuration to start processes
  334. BIND 10 provides the bind10 command which starts up the required
  335. processes. bind10 will also restart some processes that exit unexpectedly.
  336. This is the only command needed to start the BIND 10 system.
  337. After starting the b10-msgq communications channel, bind10 connects to it,
  338. runs the configuration manager, and reads its own configuration. Then it
  339. starts the other modules.
  340. The b10-sockcreator, b10-msgq and b10-cfgmgr services make up the core.
  341. The b10-msgq daemon provides the communication channel between every part
  342. of the system. The b10-cfgmgr daemon is always needed by every module, if
  343. only to send information about themselves somewhere, but more importantly
  344. to ask about their own settings, and about other modules. The
  345. b10-sockcreator daemon helps allocate Internet addresses and ports as
  346. needed for BIND 10 network services.
  347. In its default configuration, the bind10 master process will also start up
  348. b10-cmdctl for administration tools to communicate with the system, and
  349. b10-stats for statistics collection.
  350. 3.1. Starting BIND 10
  351. To start the BIND 10 service, simply run bind10. Run it with the --verbose
  352. switch to get additional debugging or diagnostic output.
  353. Note
  354. If the setproctitle Python module is detected at start up, the process
  355. names for the Python-based daemons will be renamed to better identify them
  356. instead of just “python”. This is not needed on some operating systems.
  357. 3.2. Configuration to start processes
  358. The processes to be used can be configured for bind10 to start, with the
  359. exception of the required b10-sockcreator, b10-msgq and b10-cfgmgr
  360. components. The configuration is in the Boss/components section. Each
  361. element represents one component, which is an abstraction of a process.
  362. To add a process to the set, let's say the resolver (which is not started
  363. by default), you would do this:
  364. > config add Boss/components b10-resolver
  365. > config set Boss/components/b10-resolver/special resolver
  366. > config set Boss/components/b10-resolver/kind needed
  367. > config set Boss/components/b10-resolver/priority 10
  368. > config commit
  369. Now, what it means. We add an entry called “b10-resolver”. It is both a
  370. name used to reference this component in the configuration and the name of
  371. the process to start. Then we set some parameters on how to start it.
  372. The special setting is for components that need some kind of special care
  373. during startup or shutdown. Unless specified, the component is started in
  374. a usual way. This is the list of components that need to be started in a
  375. special way, with the value of special used for them:
  376. Table 3.1. Special startup components
  377. +----------------------------------------------------------------------+
  378. | Component | Special | Description |
  379. |--------------+----------+--------------------------------------------|
  380. | b10-auth | auth | Authoritative DNS server |
  381. |--------------+----------+--------------------------------------------|
  382. | b10-resolver | resolver | DNS resolver |
  383. |--------------+----------+--------------------------------------------|
  384. | b10-cmdctl | cmdctl | Command control (remote control interface) |
  385. +----------------------------------------------------------------------+
  386. The kind specifies how a failure of the component should be handled. If it
  387. is set to “dispensable” (the default unless you set something else), it
  388. will get started again if it fails. If it is set to “needed” and it fails
  389. at startup, the whole bind10 shuts down and exits with an error exit code.
  390. But if it fails some time later, it is just started again. If you set it
  391. to “core”, you indicate that the system is not usable without the
  392. component and if such component fails, the system shuts down no matter
  393. when the failure happened. This is the behaviour of the core components
  394. (the ones you can't turn off), but you can declare any other components as
  395. core as well if you wish (but you can turn these off, they just can't
  396. fail).
  397. The priority defines order in which the components should start. The ones
  398. with higher numbers are started sooner than the ones with lower ones. If
  399. you don't set it, 0 (zero) is used as the priority. Usually, leaving it at
  400. the default is enough.
  401. There are other parameters we didn't use in our example. One of them is
  402. address. It is the address used by the component on the b10-msgq message
  403. bus. The special components already know their address, but the usual ones
  404. don't. The address is by convention the thing after b10-, with the first
  405. letter capitalized (eg. b10-stats would have “Stats” as its address).
  406. The last one is process. It is the name of the process to be started. It
  407. defaults to the name of the component if not set, but you can use this to
  408. override it. (The special components also already know their executable
  409. name.)
  410. Note
  411. The configuration is quite powerful, but that includes a lot of space for
  412. mistakes. You could turn off the b10-cmdctl, but then you couldn't change
  413. it back the usual way, as it would require it to be running (you would
  414. have to find and edit the configuration directly). Also, some modules
  415. might have dependencies: b10-stats-httpd needs b10-stats, b10-xfrout needs
  416. b10-auth to be running, etc.
  417. In short, you should think twice before disabling something here.
  418. It is possible to start some components multiple times (currently b10-auth
  419. and b10-resolver). You might want to do that to gain more performance
  420. (each one uses only single core). Just put multiple entries under
  421. different names, like this, with the same config:
  422. > config add Boss/components b10-resolver-2
  423. > config set Boss/components/b10-resolver-2/special resolver
  424. > config set Boss/components/b10-resolver-2/kind needed
  425. > config commit
  426. However, this is work in progress and the support is not yet complete. For
  427. example, each resolver will have its own cache, each authoritative server
  428. will keep its own copy of in-memory data and there could be problems with
  429. locking the sqlite database, if used. The configuration might be changed
  430. to something more convenient in future. Other components don't expect such
  431. a situation, so it would probably not do what you want. Such support is
  432. yet to be implemented.
  433. Chapter 4. Command channel
  434. The BIND 10 components use the b10-msgq message routing daemon to
  435. communicate with other BIND 10 components. The b10-msgq implements what is
  436. called the “Command Channel”. Processes intercommunicate by sending
  437. messages on the command channel. Example messages include shutdown, get
  438. configurations, and set configurations. This Command Channel is not used
  439. for DNS message passing. It is used only to control and monitor the BIND
  440. 10 system.
  441. Administrators do not communicate directly with the b10-msgq daemon. By
  442. default, BIND 10 uses a UNIX domain socket file named
  443. /usr/local/var/bind10-devel/msg_socket for this interprocess
  444. communication.
  445. Chapter 5. Configuration manager
  446. The configuration manager, b10-cfgmgr, handles all BIND 10 system
  447. configuration. It provides persistent storage for configuration, and
  448. notifies running modules of configuration changes.
  449. The b10-auth and b10-xfrin daemons and other components receive their
  450. configurations from the configuration manager over the b10-msgq command
  451. channel.
  452. The administrator doesn't connect to it directly, but uses a user
  453. interface to communicate with the configuration manager via b10-cmdctl's
  454. REST-ful interface. b10-cmdctl is covered in Chapter 6, Remote control
  455. daemon.
  456. Note
  457. The development prototype release only provides bindctl as a user
  458. interface to b10-cmdctl. Upcoming releases will provide another
  459. interactive command-line interface and a web-based interface.
  460. The b10-cfgmgr daemon can send all specifications and all current settings
  461. to the bindctl client (via b10-cmdctl). b10-cfgmgr relays configurations
  462. received from b10-cmdctl to the appropriate modules.
  463. The stored configuration file is at
  464. /usr/local/var/bind10-devel/b10-config.db. (The directory is what was
  465. defined at build configure time for --localstatedir. The default is
  466. /usr/local/var/.) The format is loosely based on JSON and is directly
  467. parseable python, but this may change in a future version. This
  468. configuration data file is not manually edited by the administrator.
  469. The configuration manager does not have any command line arguments.
  470. Normally it is not started manually, but is automatically started using
  471. the bind10 master process (as covered in Chapter 3, Starting BIND10 with
  472. bind10).
  473. Chapter 6. Remote control daemon
  474. Table of Contents
  475. 6.1. Configuration specification for b10-cmdctl
  476. b10-cmdctl is the gateway between administrators and the BIND 10 system.
  477. It is a HTTPS server that uses standard HTTP Digest Authentication for
  478. username and password validation. It provides a REST-ful interface for
  479. accessing and controlling BIND 10.
  480. When b10-cmdctl starts, it firsts asks b10-cfgmgr about what modules are
  481. running and what their configuration is (over the b10-msgq channel). Then
  482. it will start listening on HTTPS for clients — the user interface — such
  483. as bindctl.
  484. b10-cmdctl directly sends commands (received from the user interface) to
  485. the specified component. Configuration changes are actually commands to
  486. b10-cfgmgr so are sent there.
  487. The HTTPS server requires a private key, such as a RSA PRIVATE KEY. The
  488. default location is at /usr/local/etc/bind10-devel/cmdctl-keyfile.pem. (A
  489. sample key is at /usr/local/share/bind10-devel/cmdctl-keyfile.pem.) It
  490. also uses a certificate located at
  491. /usr/local/etc/bind10-devel/cmdctl-certfile.pem. (A sample certificate is
  492. at /usr/local/share/bind10-devel/cmdctl-certfile.pem.) This may be a
  493. self-signed certificate or purchased from a certification authority.
  494. Note
  495. The HTTPS server doesn't support a certificate request from a client (at
  496. this time). The b10-cmdctl daemon does not provide a public service. If
  497. any client wants to control BIND 10, then a certificate needs to be first
  498. received from the BIND 10 administrator. The BIND 10 installation provides
  499. a sample PEM bundle that matches the sample key and certificate.
  500. The b10-cmdctl daemon also requires the user account file located at
  501. /usr/local/etc/bind10-devel/cmdctl-accounts.csv. This comma-delimited file
  502. lists the accounts with a user name, hashed password, and salt. (A sample
  503. file is at /usr/local/share/bind10-devel/cmdctl-accounts.csv. It contains
  504. the user named “root” with the password “bind10”.)
  505. The administrator may create a user account with the b10-cmdctl-usermgr
  506. tool.
  507. By default the HTTPS server listens on the localhost port 8080. The port
  508. can be set by using the --port command line option. The address to listen
  509. on can be set using the --address command line argument. Each HTTPS
  510. connection is stateless and times out in 1200 seconds by default. This can
  511. be redefined by using the --idle-timeout command line argument.
  512. 6.1. Configuration specification for b10-cmdctl
  513. The configuration items for b10-cmdctl are: accounts_file which defines
  514. the path to the user accounts database (the default is
  515. /usr/local/etc/bind10-devel/cmdctl-accounts.csv); cert_file which defines
  516. the path to the PEM certificate file (the default is
  517. /usr/local/etc/bind10-devel/cmdctl-certfile.pem); and key_file which
  518. defines the path to the PEM private key file (the default is
  519. /usr/local/etc/bind10-devel/cmdctl-keyfile.pem).
  520. Chapter 7. Control and configure user interface
  521. Note
  522. For this development prototype release, bindctl is the only user
  523. interface. It is expected that upcoming releases will provide another
  524. interactive command-line interface and a web-based interface for
  525. controlling and configuring BIND 10.
  526. The bindctl tool provides an interactive prompt for configuring,
  527. controlling, and querying the BIND 10 components. It communicates directly
  528. with a REST-ful interface over HTTPS provided by b10-cmdctl. It doesn't
  529. communicate to any other components directly.
  530. Configuration changes are actually commands to b10-cfgmgr. So when bindctl
  531. sends a configuration, it is sent to b10-cmdctl (over a HTTPS connection);
  532. then b10-cmdctl sends the command (over a b10-msgq command channel) to
  533. b10-cfgmgr which then stores the details and relays (over a b10-msgq
  534. command channel) the configuration on to the specified module.
  535. Chapter 8. Authoritative Server
  536. Table of Contents
  537. 8.1. Server Configurations
  538. 8.2. Data Source Backends
  539. 8.2.1. Data source types
  540. 8.2.2. Examples
  541. 8.3. Loading Master Zones Files
  542. The b10-auth is the authoritative DNS server. It supports EDNS0, DNSSEC,
  543. IPv6, and SQLite3 and in-memory zone data backends. Normally it is started
  544. by the bind10 master process.
  545. 8.1. Server Configurations
  546. b10-auth is configured via the b10-cfgmgr configuration manager. The
  547. module name is “Auth”. The configuration data items are:
  548. database_file
  549. This is an optional string to define the path to find the SQLite3
  550. database file. Note: This may be a temporary setting because the
  551. DNS server can use various data source backends.
  552. datasources
  553. datasources configures data sources. The list items include: type
  554. to define the required data source type (such as “memory”); class
  555. to optionally select the class (it defaults to “IN”); and zones to
  556. define the file path name, the filetype (“sqlite3” to load from a
  557. SQLite3 database file or “text” to load from a master text file),
  558. and the origin (default domain). By default, this is empty.
  559. Note
  560. In this development version, currently this is only used for the
  561. memory data source. Only the IN class is supported at this time.
  562. By default, the memory data source is disabled. Also, currently
  563. the zone file must be canonical such as generated by
  564. named-compilezone -D, or must be an SQLite3 database.
  565. listen_on
  566. listen_on is a list of addresses and ports for b10-auth to listen
  567. on. The list items are the address string and port number. By
  568. default, b10-auth listens on port 53 on the IPv6 (::) and IPv4
  569. (0.0.0.0) wildcard addresses.
  570. Note
  571. The default configuration is currently not appropriate for a
  572. multi-homed host. In case you have multiple public IP addresses,
  573. it is possible the query UDP packet comes through one interface
  574. and the answer goes out through another. The answer will probably
  575. be dropped by the client, as it has a different source address
  576. than the one it sent the query to. The client would fallback on
  577. TCP after several attempts, which works well in this situation,
  578. but is clearly not ideal.
  579. There are plans to solve the problem such that the server handles
  580. it by itself. But until it is actually implemented, it is
  581. recommended to alter the configuration — remove the wildcard
  582. addresses and list all addresses explicitly. Then the server will
  583. answer on the same interface the request came on, preserving the
  584. correct address.
  585. statistics-interval
  586. statistics-interval is the timer interval in seconds for b10-auth
  587. to share its statistics information to b10-stats(8). Statistics
  588. updates can be disabled by setting this to 0. The default is 60.
  589. The configuration commands are:
  590. loadzone
  591. loadzone tells b10-auth to load or reload a zone file. The
  592. arguments include: class which optionally defines the class (it
  593. defaults to “IN”); origin is the domain name of the zone; and
  594. datasrc optionally defines the type of datasource (it defaults to
  595. “memory”).
  596. Note
  597. In this development version, currently this only supports the IN
  598. class and the memory data source.
  599. sendstats
  600. sendstats tells b10-auth to send its statistics data to
  601. b10-stats(8) immediately.
  602. shutdown
  603. Stop the authoritative DNS server. This has an optional pid
  604. argument to select the process ID to stop. (Note that the BIND 10
  605. boss process may restart this service if configured.)
  606. 8.2. Data Source Backends
  607. Bind 10 has the concept of data sources. A data source is a place where
  608. authoritative zone data reside and where they can be served from. This can
  609. be a master file, a database or something completely different.
  610. Once a query arrives, b10-auth goes through a configured list of data
  611. sources and finds the one containing a best matching zone. From the
  612. equally good ones, the first one is taken. This data source is then used
  613. to answer the query.
  614. Note
  615. In the development prototype release, b10-auth can serve data from a
  616. SQLite3 data source backend and from master files. Upcoming versions will
  617. be able to use multiple different data sources, such as MySQL and Berkeley
  618. DB.
  619. The configuration is located in data_sources/classes. Each item there
  620. represents one RR class and a list used to answer queries for that class.
  621. The default contains two classes. The CH class contains a static data
  622. source — one that serves things like “AUTHORS.BIND.”. The IN class
  623. contains single SQLite3 data source with database file located at
  624. /usr/local/var/bind10-devel/zone.sqlite3.
  625. Each data source has several options. The first one is type, which
  626. specifies the type of data source to use. Valid types include the ones
  627. listed below, but bind10 uses dynamically loaded modules for them, so
  628. there may be more in your case. This option is mandatory.
  629. Another option is params. This option is type specific; it holds different
  630. data depending on the type above. Also, depending on the type, it could be
  631. possible to omit it.
  632. There are two options related to the so-called cache. If you enable cache,
  633. zone data from the data source are loaded into memory. Then, when
  634. answering a query, b10-auth looks into the memory only instead of the data
  635. source, which speeds answering up. The first option is cache-enable, a
  636. boolean value turning the cache on and off (off is the default). The
  637. second one, cache-zones, is a list of zone origins to load into in-memory.
  638. Remember that zones in the data source not listed here will not be loaded
  639. and will not be available at all.
  640. 8.2.1. Data source types
  641. As mentioned, the type used by default is “sqlite3”. It has single
  642. configuration option inside params — database_file, which contains the
  643. path to the sqlite3 file containing the data.
  644. Another type is called “MasterFiles”. This one is slightly special. The
  645. data are stored in RFC1034 master files. Because answering directly from
  646. them would be impractical, this type mandates the cache to be enabled.
  647. Also, the list of zones (cache-zones) should be omitted. The params is a
  648. dictionary mapping from zone origins to the files they reside in.
  649. 8.2.2. Examples
  650. As this is one of the more complex configurations of Bind10, we show some
  651. examples. They all assume they start with default configuration.
  652. First, let's disable the static data source (“VERSION.BIND” and friends).
  653. As it is the only data source in the CH class, we can remove the whole
  654. class.
  655. > config remove data_sources/classes CH
  656. > config commit
  657. Another one, let's say our default data source contains zones
  658. “example.org.” and “example.net.”. We want them to be served from memory
  659. to make the answering faster.
  660. > config set data_sources/classes/IN[0]/cache-enable true
  661. > config add data_sources/classes/IN[0]/cache-zones example.org.
  662. > config add data_sources/classes/IN[0]/cache-zones example.net.
  663. > config commit
  664. Now every time the zone in the data source is changed by the operator,
  665. Bind10 needs to be told to reload it, by
  666. > Auth loadzone example.org
  667. You don't need to do this when the zone is modified by XfrIn, it does so
  668. automatically.
  669. Now, the last example is when there are master files we want to serve in
  670. addition to whatever is inside the sqlite3 database.
  671. > config add data_sources/classes/IN
  672. > config set data_sources/classes/IN[1]/type MasterFiles
  673. > config set data_sources/classes/IN[1]/cache-enable true
  674. > config set data_sources/classes/IN[1]/params { "example.org": "/path/to/example.org", "example.com": "/path/to/example.com" }
  675. > config commit
  676. Initially, a map value has to be set, but this value may be an empty map.
  677. After that, key/value pairs can be added with 'config add' and keys can be
  678. removed with 'config remove'. The initial value may be an empty map, but
  679. it has to be set before zones are added or removed.
  680. > config set data_sources/classes/IN[1]/params {}
  681. > config add data_sources/classes/IN[1]/params another.example.org /path/to/another.example.org
  682. > config add data_sources/classes/IN[1]/params another.example.com /path/to/another.example.com
  683. > config remove data_sources/classes/IN[1]/params another.example.org
  684. bindctl. To reload a zone, you the same command as above.
  685. Note
  686. There's also Auth/database_file configuration variable, pointing to a
  687. sqlite3 database file. This is no longer used by b10-auth, but it is left
  688. in place for now, since other modules use it. Once b10-xfrin, b10-xfrout
  689. and b10-ddns are ported to the new configuration, this will disappear. But
  690. for now, make sure that if you use any of these modules, the new and old
  691. configuration correspond. The defaults are consistent, so unless you
  692. tweaked either the new or the old configuration, you're good.
  693. 8.3. Loading Master Zones Files
  694. RFC 1035 style DNS master zone files may imported into a BIND 10 SQLite3
  695. data source by using the b10-loadzone utility.
  696. b10-loadzone supports the following special directives (control entries):
  697. $INCLUDE
  698. Loads an additional zone file. This may be recursive.
  699. $ORIGIN
  700. Defines the relative domain name.
  701. $TTL
  702. Defines the time-to-live value used for following records that
  703. don't include a TTL.
  704. The -o argument may be used to define the default origin for loaded zone
  705. file records.
  706. Note
  707. In the development prototype release, only the SQLite3 back end is used by
  708. b10-loadzone. By default, it stores the zone data in
  709. /usr/local/var/bind10-devel/zone.sqlite3 unless the -d switch is used to
  710. set the database filename. Multiple zones are stored in a single SQLite3
  711. zone database.
  712. If you reload a zone already existing in the database, all records from
  713. that prior zone disappear and a whole new set appears.
  714. Chapter 9. Incoming Zone Transfers
  715. Table of Contents
  716. 9.1. Configuration for Incoming Zone Transfers
  717. 9.2. Enabling IXFR
  718. 9.3. Secondary Manager
  719. 9.4. Trigger an Incoming Zone Transfer Manually
  720. 9.5. Incoming Transfers with In-memory Datasource
  721. Incoming zones are transferred using the b10-xfrin process which is
  722. started by bind10. When received, the zone is stored in the corresponding
  723. BIND 10 data source, and its records can be served by b10-auth. In
  724. combination with b10-zonemgr (for automated SOA checks), this allows the
  725. BIND 10 server to provide secondary service.
  726. The b10-xfrin process supports both AXFR and IXFR. Due to some
  727. implementation limitations of the current development release, however, it
  728. only tries AXFR by default, and care should be taken to enable IXFR.
  729. 9.1. Configuration for Incoming Zone Transfers
  730. In practice, you need to specify a list of secondary zones to enable
  731. incoming zone transfers for these zones (you can still trigger a zone
  732. transfer manually, without a prior configuration (see below)).
  733. For example, to enable zone transfers for a zone named "example.com"
  734. (whose master address is assumed to be 2001:db8::53 here), run the
  735. following at the bindctl prompt:
  736. > config add Xfrin/zones
  737. > config set Xfrin/zones[0]/name "example.com"
  738. > config set Xfrin/zones[0]/master_addr "2001:db8::53"
  739. > config commit
  740. (We assume there has been no zone configuration before).
  741. 9.2. Enabling IXFR
  742. As noted above, b10-xfrin uses AXFR for zone transfers by default. To
  743. enable IXFR for zone transfers for a particular zone, set the use_ixfr
  744. configuration parameter to true. In the above example of configuration
  745. sequence, you'll need to add the following before performing commit:
  746. > config set Xfrin/zones[0]/use_ixfr true
  747. Note
  748. One reason why IXFR is disabled by default in the current release is
  749. because it does not support automatic fallback from IXFR to AXFR when it
  750. encounters a primary server that doesn't support outbound IXFR (and, not
  751. many existing implementations support it). Another, related reason is that
  752. it does not use AXFR even if it has no knowledge about the zone (like at
  753. the very first time the secondary server is set up). IXFR requires the
  754. "current version" of the zone, so obviously it doesn't work in this
  755. situation and AXFR is the only workable choice. The current release of
  756. b10-xfrin does not make this selection automatically. These features will
  757. be implemented in a near future version, at which point we will enable
  758. IXFR by default.
  759. 9.3. Secondary Manager
  760. The b10-zonemgr process is started by bind10. It keeps track of SOA
  761. refresh, retry, and expire timers and other details for BIND 10 to perform
  762. as a slave. When the b10-auth authoritative DNS server receives a NOTIFY
  763. message, b10-zonemgr may tell b10-xfrin to do a refresh to start an
  764. inbound zone transfer. The secondary manager resets its counters when a
  765. new zone is transferred in.
  766. Note
  767. Access control (such as allowing notifies) is not yet provided. The
  768. primary/secondary service is not yet complete.
  769. The following example shows using bindctl to configure the server to be a
  770. secondary for the example zone:
  771. > config add Zonemgr/secondary_zones
  772. > config set Zonemgr/secondary_zones[0]/name "example.com"
  773. > config commit
  774. If the zone does not exist in the data source already (i.e. no SOA record
  775. for it), b10-zonemgr will automatically tell b10-xfrin to transfer the
  776. zone in.
  777. 9.4. Trigger an Incoming Zone Transfer Manually
  778. To manually trigger a zone transfer to retrieve a remote zone, you may use
  779. the bindctl utility. For example, at the bindctl prompt run:
  780. > Xfrin retransfer zone_name="foo.example.org" master=192.0.2.99
  781. 9.5. Incoming Transfers with In-memory Datasource
  782. In the case of an incoming zone transfer, the received zone is first
  783. stored in the corresponding BIND 10 datasource. In case the secondary zone
  784. is served by an in-memory datasource with an SQLite3 backend, b10-auth is
  785. automatically sent a loadzone command to reload the corresponding zone
  786. into memory from the backend.
  787. The administrator doesn't have to do anything for b10-auth to serve the
  788. new version of the zone, except for the configuration such as the one
  789. described in Section 8.2, “Data Source Backends”.
  790. Chapter 10. Outbound Zone Transfers
  791. The b10-xfrout process is started by bind10. When the b10-auth
  792. authoritative DNS server receives an AXFR or IXFR request, b10-auth
  793. internally forwards the request to b10-xfrout, which handles the rest of
  794. this request processing. This is used to provide primary DNS service to
  795. share zones to secondary name servers. The b10-xfrout is also used to send
  796. NOTIFY messages to secondary servers.
  797. A global or per zone transfer_acl configuration can be used to control
  798. accessibility of the outbound zone transfer service. By default,
  799. b10-xfrout allows any clients to perform zone transfers for any zones:
  800. > config show Xfrout/transfer_acl
  801. Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)
  802. You can change this to, for example, rejecting all transfer requests by
  803. default while allowing requests for the transfer of zone "example.com"
  804. from 192.0.2.1 and 2001:db8::1 as follows:
  805. > config set Xfrout/transfer_acl[0] {"action": "REJECT"}
  806. > config add Xfrout/zone_config
  807. > config set Xfrout/zone_config[0]/origin "example.com"
  808. > config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1"},
  809. {"action": "ACCEPT", "from": "2001:db8::1"}]
  810. > config commit
  811. Note
  812. In the above example the lines for transfer_acl were divided for
  813. readability. In the actual input it must be in a single line.
  814. If you want to require TSIG in access control, a system wide TSIG "key
  815. ring" must be configured. For example, to change the previous example to
  816. allowing requests from 192.0.2.1 signed by a TSIG with a key name of
  817. "key.example", you'll need to do this:
  818. > config set tsig_keys/keys ["key.example:<base64-key>"]
  819. > config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]
  820. > config commit
  821. Both b10-xfrout and b10-auth will use the system wide keyring to check
  822. TSIGs in the incoming messages and to sign responses.
  823. Note
  824. The way to specify zone specific configuration (ACLs, etc) is likely to be
  825. changed.
  826. Chapter 11. Dynamic DNS Update
  827. Table of Contents
  828. 11.1. Enabling Dynamic Update
  829. 11.2. Access Control
  830. 11.3. Miscellaneous Operational Issues
  831. BIND 10 supports the server side of the Dynamic DNS Update (DDNS) protocol
  832. as defined in RFC 2136. This service is provided by the b10-ddns
  833. component, which is started by the bind10 process if configured so.
  834. When the b10-auth authoritative DNS server receives an UPDATE request, it
  835. internally forwards the request to b10-ddns, which handles the rest of
  836. this request processing. When the processing is completed, b10-ddns will
  837. send a response to the client as specified in RFC 2136 (NOERROR for
  838. successful update, REFUSED if rejected due to ACL check, etc). If the zone
  839. has been changed as a result, it will internally notify b10-xfrout so that
  840. other secondary servers will be notified via the DNS NOTIFY protocol. In
  841. addition, if b10-auth serves the updated zone (as described in
  842. Section 8.2, “Data Source Backends”), b10-ddns will also notify b10-auth
  843. so that b10-auth will re-cache the updated zone content if necessary.
  844. The b10-ddns component supports requests over both UDP and TCP, and both
  845. IPv6 and IPv4; for TCP requests, however, it terminates the TCP connection
  846. immediately after each single request has been processed. Clients cannot
  847. reuse the same TCP connection for multiple requests. (This is a current
  848. implementation limitation of b10-ddns. While RFC 2136 doesn't specify
  849. anything about such reuse of TCP connection, there is no reason for
  850. disallowing it as RFC 1035 generally allows multiple requests sent over a
  851. single TCP connection. BIND 9 supports such reuse.)
  852. As of this writing b10-ddns does not support update forwarding for
  853. secondary zones. If it receives an update request for a secondary zone, it
  854. will immediately return a “not implemented” response.
  855. Note
  856. For feature completeness, update forwarding should be eventually
  857. supported. But currently it's considered a lower priority task and there
  858. is no specific plan of implementing this feature.
  859. 11.1. Enabling Dynamic Update
  860. First off, it must be made sure that a few components on which b10-ddns
  861. depends are configured to run, which are b10-auth and b10-zonemgr. In
  862. addition, b10-xfrout should also be configured to run; otherwise the
  863. notification after an update (see above) will fail with a timeout,
  864. suspending the DDNS service while b10-ddns waits for the response (see the
  865. description of the DDNS_UPDATE_NOTIFY_FAIL log message for further
  866. details). If BIND 10 is already configured to provide authoritative DNS
  867. service they should normally be configured to run already.
  868. Second, for the obvious reason dynamic update requires that the underlying
  869. data source storing the zone data be writable. In the current
  870. implementation this means the zone must be stored in an SQLite3-based data
  871. source. Also, in this development version, the b10-ddns component
  872. configures itself with the data source referring to the database_file
  873. configuration parameter of b10-auth. So this information must be
  874. configured correctly before starting b10-ddns.
  875. Note
  876. The way to configure data sources is now being revised. Configuration on
  877. the data source for DDNS will be very likely to be changed in a backward
  878. incompatible manner in a near future version.
  879. In general, if something goes wrong regarding the dependency described
  880. above, b10-ddns will log the related event at the warning or error level.
  881. It's advisable to check the log message when you first enable DDNS or if
  882. it doesn't work as you expect to see if there's any warning or error log
  883. message.
  884. Next, to enable the DDNS service, b10-ddns needs to be explicitly
  885. configured to run. It can be done by using the bindctl utility. For
  886. example:
  887. > config add Boss/components b10-ddns
  888. > config set Boss/components/b10-ddns/address DDNS
  889. > config set Boss/components/b10-ddns/kind dispensable
  890. > config commit
  891. Note
  892. In theory kind could be omitted because "dispensable" is its default. But
  893. there's some peculiar behavior (which should be a bug and should be fixed
  894. eventually; see Trac ticket #2064) with bindctl and you'll still need to
  895. specify that explicitly. Likewise, address may look unnecessary because
  896. b10-ddns would start and work without specifying it. But for it to
  897. shutdown gracefully this parameter should also be specified.
  898. 11.2. Access Control
  899. By default, b10-ddns rejects any update requests from any clients by
  900. returning a REFUSED response. To allow updates to take effect, an access
  901. control rule (called update ACL) with a policy allowing updates must
  902. explicitly be configured. Update ACL must be configured per zone basis in
  903. the zones configuration parameter of b10-ddns. This is a list of per-zone
  904. configurations regarding DDNS. Each list element consists of the following
  905. parameters:
  906. origin
  907. The zone's origin name
  908. class
  909. The RR class of the zone (normally “IN”, and in that case can be
  910. omitted in configuration)
  911. update_acl
  912. List of access control rules (ACL) for the zone
  913. The syntax of the ACL is the same as ACLs for other components. Specific
  914. examples are given below.
  915. In general, an update ACL rule that allows an update request should be
  916. configured with a TSIG key. This is an example update ACL that allows
  917. updates to the zone named “example.org” (of default RR class “IN”) from
  918. clients that send requests signed with a TSIG whose key name is
  919. "key.example.org" (and refuses all others):
  920. > config add DDNS/zones
  921. > config set DDNS/zones[0]/origin example.org
  922. > config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "key.example.org"}
  923. > config commit
  924. The TSIG key must be configured system wide (see Chapter 10, Outbound Zone
  925. Transfers.)
  926. Multiple rules can be specified in the ACL, and an ACL rule can consist of
  927. multiple constraints, such as a combination of IP address and TSIG. The
  928. following configuration sequence will add a new rule to the ACL created in
  929. the above example. This additional rule allows update requests sent from a
  930. client using TSIG key name of "key.example" (different from the key used
  931. in the previous example) and has an IPv6 address of ::1.
  932. > config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "from": "::1", "key": "key.example"}
  933. > config show DDNS/zones[0]/update_acl
  934. DDNS/zones[0]/update_acl[0] {"action": "ACCEPT", "key": "key.example.org"} any (modified)
  935. DDNS/zones[0]/update_acl[1] {"action": "ACCEPT", "from": "::1", "key": "key.example"} any (modified)
  936. > config commit
  937. (Note the "add" in the first line. Before this sequence, we have had only
  938. entry in zones[0]/update_acl. The add command with a value (rule) adds a
  939. new entry and sets it to the given rule. Due to a limitation of the
  940. current implementation, it doesn't work if you first try to just add a new
  941. entry and then set it to a given rule.)
  942. Note
  943. The b10-ddns component accepts an ACL rule that just allows updates from a
  944. specific IP address (i.e., without requiring TSIG), but this is highly
  945. discouraged (remember that requests can be made over UDP and spoofing the
  946. source address of a UDP packet is often pretty easy). Unless you know what
  947. you are doing and that you can accept its consequence, any update ACL rule
  948. that allows updates should have a TSIG key in its constraints.
  949. The ACL rules will be checked in the listed order, and the first matching
  950. one will apply. If none of the rules matches, the default rule will apply,
  951. which is rejecting any requests in the case of b10-ddns.
  952. Other actions than "ACCEPT", namely "REJECT" and "DROP", can be used, too.
  953. See Chapter 12, Recursive Name Server about their effects.
  954. Currently update ACL can only control updates per zone basis; it's not
  955. possible to specify access control with higher granularity such as for
  956. particular domain names or specific types of RRs.
  957. Note
  958. Contrary to what RFC 2136 (literally) specifies, b10-ddns checks the
  959. update ACL before checking the prerequisites of the update request. This
  960. is a deliberate implementation decision. This counter intuitive
  961. specification has been repeatedly discussed among implementers and in the
  962. IETF, and it is now widely agreed that it does not make sense to strictly
  963. follow that part of RFC. One known specific bad result of following the
  964. RFC is that it could leak information about which name or record exists or
  965. does not exist in the zone as a result of prerequisite checks even if a
  966. zone is somehow configured to reject normal queries from arbitrary
  967. clients. There have been other troubles that could have been avoided if
  968. the ACL could be checked before the prerequisite check.
  969. 11.3. Miscellaneous Operational Issues
  970. Unlike BIND 9, BIND 10 currently does not support automatic re-signing of
  971. DNSSEC-signed zone when it's updated via DDNS. It could be possible to
  972. re-sign the updated zone afterwards or make sure the update request also
  973. updates related DNSSEC records, but that will be pretty error-prone
  974. operation. In general, it's not advisable to allow DDNS for a signed zone
  975. at this moment.
  976. Also unlike BIND 9, it's currently not possible to “freeze” a zone
  977. temporarily in order to suspend DDNS while you manually update the zone.
  978. If you need to make manual updates to a dynamic zone, you'll need to
  979. temporarily reject any updates to the zone via the update ACLs.
  980. Dynamic updates are only applicable to primary zones. In order to avoid
  981. updating secondary zones via DDNS requests, b10-ddns refers to the
  982. “secondary_zones” configuration of b10-zonemgr. Zones listed in
  983. “secondary_zones” will never be updated via DDNS regardless of the update
  984. ACL configuration; b10-ddns will return a NOTAUTH (server not
  985. authoritative for the zone) response. If you have a "conceptual" secondary
  986. zone whose content is a copy of some external source but is not updated
  987. via the standard zone transfers and therefore not listed in
  988. “secondary_zones”, be careful not to allow DDNS for the zone; it would be
  989. quite likely to lead to inconsistent state between different servers.
  990. Normally this should not be a problem because the default update ACL
  991. rejects any update requests, but you may want to take an extra care about
  992. the configuration if you have such type of secondary zones.
  993. The difference of two versions of a zone, before and after a DDNS
  994. transaction, is automatically recorded in the underlying data source, and
  995. can be retrieved in the form of outbound IXFR. This is done automatically;
  996. it does not require specific configuration to make this possible.
  997. Chapter 12. Recursive Name Server
  998. Table of Contents
  999. 12.1. Access Control
  1000. 12.2. Forwarding
  1001. The b10-resolver process is started by bind10.
  1002. The main bind10 process can be configured to select to run either the
  1003. authoritative or resolver or both. By default, it doesn't start either
  1004. one. You may change this using bindctl, for example:
  1005. > config add Boss/components b10-resolver
  1006. > config set Boss/components/b10-resolver/special resolver
  1007. > config set Boss/components/b10-resolver/kind needed
  1008. > config set Boss/components/b10-resolver/priority 10
  1009. > config commit
  1010. The master bind10 will stop and start the desired services.
  1011. By default, the resolver listens on port 53 for 127.0.0.1 and ::1. The
  1012. following example shows how it can be configured to listen on an
  1013. additional address (and port):
  1014. > config add Resolver/listen_on
  1015. > config set Resolver/listen_on[2]/address "192.168.1.1"
  1016. > config set Resolver/listen_on[2]/port 53
  1017. > config commit
  1018. (Replace the “2” as needed; run “config show Resolver/listen_on” if
  1019. needed.)
  1020. 12.1. Access Control
  1021. By default, the b10-resolver daemon only accepts DNS queries from the
  1022. localhost (127.0.0.1 and ::1). The Resolver/query_acl configuration may be
  1023. used to reject, drop, or allow specific IPs or networks. This
  1024. configuration list is first match.
  1025. The configuration's action item may be set to “ACCEPT” to allow the
  1026. incoming query, “REJECT” to respond with a DNS REFUSED return code, or
  1027. “DROP” to ignore the query without any response (such as a blackhole). For
  1028. more information, see the respective debugging messages:
  1029. RESOLVER_QUERY_ACCEPTED, RESOLVER_QUERY_REJECTED, and
  1030. RESOLVER_QUERY_DROPPED.
  1031. The required configuration's from item is set to an IPv4 or IPv6 address,
  1032. addresses with an network mask, or to the special lowercase keywords
  1033. “any6” (for any IPv6 address) or “any4” (for any IPv4 address).
  1034. For example to allow the 192.168.1.0/24 network to use your recursive name
  1035. server, at the bindctl prompt run:
  1036. > config add Resolver/query_acl
  1037. > config set Resolver/query_acl[2]/action "ACCEPT"
  1038. > config set Resolver/query_acl[2]/from "192.168.1.0/24"
  1039. > config commit
  1040. (Replace the “2” as needed; run “config show Resolver/query_acl” if
  1041. needed.)
  1042. Note
  1043. This prototype access control configuration syntax may be changed.
  1044. 12.2. Forwarding
  1045. To enable forwarding, the upstream address and port must be configured to
  1046. forward queries to, such as:
  1047. > config set Resolver/forward_addresses [{ "address": "192.168.1.1", "port": 53 }]
  1048. > config commit
  1049. (Replace 192.168.1.1 to point to your full resolver.)
  1050. Normal iterative name service can be re-enabled by clearing the forwarding
  1051. address(es); for example:
  1052. > config set Resolver/forward_addresses []
  1053. > config commit
  1054. Chapter 13. DHCPv4 Server
  1055. Table of Contents
  1056. 13.1. DHCPv4 Server Usage
  1057. 13.2. DHCPv4 Server Configuration
  1058. 13.3. Supported standards
  1059. 13.4. DHCPv4 Server Limitations
  1060. Dynamic Host Configuration Protocol for IPv4 (DHCP or DHCPv4) and Dynamic
  1061. Host Configuration Protocol for IPv6 (DHCPv6) are protocols that allow one
  1062. node (server) to provision configuration parameters to many hosts and
  1063. devices (clients). To ease deployment in larger networks, additional nodes
  1064. (relays) may be deployed that facilitate communication between servers and
  1065. clients. Even though principles of both DHCPv4 and DHCPv6 are somewhat
  1066. similar, these are two radically different protocols. BIND10 offers server
  1067. implementations for both DHCPv4 and DHCPv6. This chapter is about DHCP for
  1068. IPv4. For a description of the DHCPv6 server, see Chapter 14, DHCPv6
  1069. Server.
  1070. The DHCPv4 server component is currently under intense development. You
  1071. may want to check out BIND10 DHCP (Kea) wiki and recent posts on BIND10
  1072. developers mailing list.
  1073. The DHCPv4 and DHCPv6 components in BIND10 architecture are internally
  1074. code named “Kea”.
  1075. Note
  1076. As of December 2011, both DHCPv4 and DHCPv6 components are skeleton
  1077. servers. That means that while they are capable of performing DHCP
  1078. configuration, they are not fully functional yet. In particular, neither
  1079. has functional lease databases. This means that they will assign the same,
  1080. fixed, hardcoded addresses to any client that will ask. See Section 13.4,
  1081. “DHCPv4 Server Limitations” and Section 14.4, “DHCPv6 Server Limitations”
  1082. for detailed description.
  1083. 13.1. DHCPv4 Server Usage
  1084. BIND10 provides the DHCPv4 server component since December 2011. It is a
  1085. skeleton server and can be described as an early prototype that is not
  1086. fully functional yet. It is mature enough to conduct first tests in lab
  1087. environment, but it has significant limitations. See Section 13.4, “DHCPv4
  1088. Server Limitations” for details.
  1089. b10-dhcp4 is a BIND10 component and is being run under BIND10 framework.
  1090. To add a DHCPv4 process to the set of running BIND10 services, you can use
  1091. following commands in bindctl:
  1092. > config add Boss/components b10-dhcp4
  1093. > config set Boss/components/b10-dhcp4/kind dispensable
  1094. > config commit
  1095. To shutdown running b10-dhcp4, please use the following command:
  1096. > Dhcp4 shutdown
  1097. or
  1098. > config remove Boss/components b10-dhcp4
  1099. > config commit
  1100. During start-up the server will detect available network interfaces and
  1101. will attempt to open UDP sockets on all interfaces that are up, running,
  1102. are not loopback, and have IPv4 address assigned. The server will then
  1103. listen to incoming traffic. Currently supported client messages are
  1104. DISCOVER and REQUEST. The server will respond to them with OFFER and ACK,
  1105. respectively. Since the DHCPv4 server opens privileged ports, it requires
  1106. root access. Make sure you run this daemon as root.
  1107. 13.2. DHCPv4 Server Configuration
  1108. The DHCPv4 server does not have a lease database implemented yet nor any
  1109. support for configuration, so every time the same set of configuration
  1110. options (including the same fixed address) will be assigned every time.
  1111. At this stage of development, the only way to alter the server
  1112. configuration is to tweak its source code. To do so, please edit
  1113. src/bin/dhcp4/dhcp4_srv.cc file and modify following parameters and
  1114. recompile:
  1115. const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
  1116. const std::string HARDCODED_NETMASK = "255.255.255.0";
  1117. const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds
  1118. const std::string HARDCODED_GATEWAY = "192.0.2.1";
  1119. const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
  1120. const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
  1121. const std::string HARDCODED_SERVER_ID = "192.0.2.1";
  1122. Lease database and configuration support is planned for 2012.
  1123. 13.3. Supported standards
  1124. The following standards and draft standards are currently supported:
  1125. o RFC2131: Supported messages are DISCOVER, OFFER, REQUEST, and ACK.
  1126. o RFC2132: Supported options are: PAD (0), END(255), Message Type(53),
  1127. DHCP Server Identifier (54), Domain Name (15), DNS Servers (6), IP
  1128. Address Lease Time (51), Subnet mask (1), and Routers (3).
  1129. 13.4. DHCPv4 Server Limitations
  1130. These are the current limitations of the DHCPv4 server software. Most of
  1131. them are reflections of the early stage of development and should be
  1132. treated as “not implemented yet”, rather than actual limitations.
  1133. o During initial IPv4 node configuration, the server is expected to send
  1134. packets to a node that does not have IPv4 address assigned yet. The
  1135. server requires certain tricks (or hacks) to transmit such packets.
  1136. This is not implemented yet, therefore DHCPv4 server supports relayed
  1137. traffic only (that is, normal point to point communication).
  1138. o b10-dhcp4 provides a single, fixed, hardcoded lease to any client that
  1139. asks. There is no lease manager implemented. If two clients request
  1140. addresses, they will both get the same fixed address.
  1141. o b10-dhcp4 does not support any configuration mechanisms yet. The whole
  1142. configuration is currently hardcoded. The only way to tweak
  1143. configuration is to directly modify source code. See see Section 13.2,
  1144. “DHCPv4 Server Configuration” for details.
  1145. o Upon start, the server will open sockets on all interfaces that are
  1146. not loopback, are up and running and have IPv4 address.
  1147. o PRL (Parameter Request List, a list of options requested by a client)
  1148. is currently ignored and server assigns DNS SERVER and DOMAIN NAME
  1149. options.
  1150. o b10-dhcp4 does not support BOOTP. That is a design choice. This
  1151. limitation is permanent. If you have legacy nodes that can't use DHCP
  1152. and require BOOTP support, please use latest version of ISC DHCP
  1153. http://www.isc.org/software/dhcp.
  1154. o Interface detection is currently working on Linux only. See
  1155. Section 15.1, “Interface detection” for details.
  1156. o b10-dhcp4 does not verify that assigned address is unused. According
  1157. to RFC2131, the allocating server should verify that address is no
  1158. used by sending ICMP echo request.
  1159. o Address renewal (RENEW), rebinding (REBIND), confirmation (CONFIRM),
  1160. duplication report (DECLINE) and release (RELEASE) are not supported
  1161. yet.
  1162. o DNS Update is not supported yet.
  1163. o -v (verbose) command line option is currently the default, and cannot
  1164. be disabled.
  1165. Chapter 14. DHCPv6 Server
  1166. Table of Contents
  1167. 14.1. DHCPv6 Server Usage
  1168. 14.2. DHCPv6 Server Configuration
  1169. 14.3. Supported DHCPv6 Standards
  1170. 14.4. DHCPv6 Server Limitations
  1171. Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is specified in
  1172. RFC3315. BIND10 provides DHCPv6 server implementation that is described in
  1173. this chapter. For a description of the DHCPv4 server implementation, see
  1174. Chapter 13, DHCPv4 Server.
  1175. The DHCPv6 server component is currently under intense development. You
  1176. may want to check out BIND10 DHCP (Kea) wiki and recent posts on BIND10
  1177. developers mailing list.
  1178. The DHCPv4 and DHCPv6 components in BIND10 architecture are internally
  1179. code named “Kea”.
  1180. Note
  1181. As of December 2011, both DHCPv4 and DHCPv6 components are skeleton
  1182. servers. That means that while they are capable of performing DHCP
  1183. configuration, they are not fully functional yet. In particular, neither
  1184. has functional lease databases. This means that they will assign the same,
  1185. fixed, hardcoded addresses to any client that will ask. See Section 13.4,
  1186. “DHCPv4 Server Limitations” and Section 14.4, “DHCPv6 Server Limitations”
  1187. for detailed description.
  1188. 14.1. DHCPv6 Server Usage
  1189. BIND10 provides the DHCPv6 server component since September 2011. It is a
  1190. skeleton server and can be described as an early prototype that is not
  1191. fully functional yet. It is mature enough to conduct first tests in lab
  1192. environment, but it has significant limitations. See Section 14.4, “DHCPv6
  1193. Server Limitations” for details.
  1194. b10-dhcp6 is a BIND10 component and is being run under BIND10 framework.
  1195. To add a DHCPv6 process to the set of running BIND10 services, you can use
  1196. following commands in bindctl:
  1197. > config add Boss/components b10-dhcp6
  1198. > config set Boss/components/b10-dhcp6/kind dispensable
  1199. > config commit
  1200. To shutdown running b10-dhcp6, please use the following command:
  1201. > Dhcp6 shutdown
  1202. or
  1203. > config remove Boss/components b10-dhcp6
  1204. > config commit
  1205. During start-up the server will detect available network interfaces and
  1206. will attempt to open UDP sockets on all interfaces that are up, running,
  1207. are not loopback, are multicast-capable, and have IPv6 address assigned.
  1208. The server will then listen to incoming traffic. Currently supported
  1209. client messages are SOLICIT and REQUEST. The server will respond to them
  1210. with ADVERTISE and REPLY, respectively. Since the DHCPv6 server opens
  1211. privileged ports, it requires root access. Make sure you run this daemon
  1212. as root.
  1213. 14.2. DHCPv6 Server Configuration
  1214. The DHCPv6 server does not have lease database implemented yet or any
  1215. support for configuration, so every time the same set of configuration
  1216. options (including the same fixed address) will be assigned every time.
  1217. At this stage of development, the only way to alter server configuration
  1218. is to tweak its source code. To do so, please edit
  1219. src/bin/dhcp6/dhcp6_srv.cc file, modify the following parameters and
  1220. recompile:
  1221. const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
  1222. const uint32_t HARDCODED_T1 = 1500; // in seconds
  1223. const uint32_t HARDCODED_T2 = 2600; // in seconds
  1224. const uint32_t HARDCODED_PREFERRED_LIFETIME = 3600; // in seconds
  1225. const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds
  1226. const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";
  1227. Lease database and configuration support is planned for 2012.
  1228. 14.3. Supported DHCPv6 Standards
  1229. The following standards and draft standards are currently supported:
  1230. o RFC3315: Supported messages are SOLICIT, ADVERTISE, REQUEST, and
  1231. REPLY. Supported options are SERVER_ID, CLIENT_ID, IA_NA, and
  1232. IAADDRESS.
  1233. o RFC3646: Supported option is DNS_SERVERS.
  1234. 14.4. DHCPv6 Server Limitations
  1235. These are the current limitations of the DHCPv6 server software. Most of
  1236. them are reflections of the early stage of development and should be
  1237. treated as “not implemented yet”, rather than actual limitations.
  1238. o Relayed traffic is not supported.
  1239. o b10-dhcp6 provides a single, fixed, hardcoded lease to any client that
  1240. asks. There is no lease manager implemented. If two clients request
  1241. addresses, they will both get the same fixed address.
  1242. o b10-dhcp6 does not support any configuration mechanisms yet. The whole
  1243. configuration is currently hardcoded. The only way to tweak
  1244. configuration is to directly modify source code. See see Section 14.2,
  1245. “DHCPv6 Server Configuration” for details.
  1246. o Upon start, the server will open sockets on all interfaces that are
  1247. not loopback, are up, running and are multicast capable and have IPv6
  1248. address. Support for multiple interfaces is not coded in reception
  1249. routines yet, so if you are running this code on a machine that has
  1250. many interfaces and b10-dhcp6 happens to listen on wrong interface,
  1251. the easiest way to work around this problem is to turn down other
  1252. interfaces. This limitation will be fixed shortly.
  1253. o ORO (Option Request Option, a list of options requested by a client)
  1254. is currently ignored and server assigns DNS SERVER option.
  1255. o Temporary addresses are not supported yet.
  1256. o Prefix delegation is not supported yet.
  1257. o Address renewal (RENEW), rebinding (REBIND), confirmation (CONFIRM),
  1258. duplication report (DECLINE) and release (RELEASE) are not supported
  1259. yet.
  1260. o DNS Update is not supported yet.
  1261. o Interface detection is currently working on Linux only. See
  1262. Section 15.1, “Interface detection” for details.
  1263. o -v (verbose) command line option is currently the default, and cannot
  1264. be disabled.
  1265. Chapter 15. libdhcp++ library
  1266. Table of Contents
  1267. 15.1. Interface detection
  1268. 15.2. DHCPv4/DHCPv6 packet handling
  1269. libdhcp++ is a common library written in C++ that handles many
  1270. DHCP-related tasks, like DHCPv4 and DHCPv6 packets parsing, manipulation
  1271. and assembly, option parsing, manipulation and assembly, network interface
  1272. detection and socket operations, like socket creations, data transmission
  1273. and reception and socket closing.
  1274. While this library is currently used by b10-dhcp4 and b10-dhcp6 only, it
  1275. is designed to be portable, universal library useful for any kind of
  1276. DHCP-related software.
  1277. 15.1. Interface detection
  1278. Both DHCPv4 and DHCPv6 components share network interface detection
  1279. routines. Interface detection is currently only supported on Linux
  1280. systems.
  1281. For non-Linux systems, there is currently stub implementation provided.
  1282. Interface manager detects loopback interfaces only as their name (lo or
  1283. lo0) can be easily predicted. Please contact BIND10 development team if
  1284. you are interested in running DHCP components on systems other than Linux.
  1285. 15.2. DHCPv4/DHCPv6 packet handling
  1286. TODO: Describe packet handling here, with pointers to wiki
  1287. Chapter 16. Statistics
  1288. The b10-stats process is started by bind10. It periodically collects
  1289. statistics data from various modules and aggregates it.
  1290. This stats daemon provides commands to identify if it is running, show
  1291. specified or all statistics data, and show specified or all statistics data
  1292. schema. For example, using bindctl:
  1293. > Stats show
  1294. {
  1295. "Auth": {
  1296. "opcode.iquery": 0,
  1297. "opcode.notify": 10,
  1298. "opcode.query": 869617,
  1299. ...
  1300. "queries.tcp": 1749,
  1301. "queries.udp": 867868
  1302. },
  1303. "Boss": {
  1304. "boot_time": "2011-01-20T16:59:03Z"
  1305. },
  1306. "Stats": {
  1307. "boot_time": "2011-01-20T16:59:05Z",
  1308. "last_update_time": "2011-01-20T17:04:05Z",
  1309. "lname": "4d3869d9_a@jreed.example.net",
  1310. "report_time": "2011-01-20T17:04:06Z",
  1311. "timestamp": 1295543046.823504
  1312. }
  1313. }
  1314. Chapter 17. Logging
  1315. Table of Contents
  1316. 17.1. Logging configuration
  1317. 17.1.1. Loggers
  1318. 17.1.2. Output Options
  1319. 17.1.3. Example session
  1320. 17.2. Logging Message Format
  1321. 17.1. Logging configuration
  1322. The logging system in BIND 10 is configured through the Logging module.
  1323. All BIND 10 modules will look at the configuration in Logging to see what
  1324. should be logged and to where.
  1325. 17.1.1. Loggers
  1326. Within BIND 10, a message is logged through a component called a "logger".
  1327. Different parts of BIND 10 log messages through different loggers, and
  1328. each logger can be configured independently of one another.
  1329. In the Logging module, you can specify the configuration for zero or more
  1330. loggers; any that are not specified will take appropriate default values.
  1331. The three most important elements of a logger configuration are the name
  1332. (the component that is generating the messages), the severity (what to
  1333. log), and the output_options (where to log).
  1334. 17.1.1.1. name (string)
  1335. Each logger in the system has a name, the name being that of the component
  1336. using it to log messages. For instance, if you want to configure logging
  1337. for the resolver module, you add an entry for a logger named “Resolver”.
  1338. This configuration will then be used by the loggers in the Resolver
  1339. module, and all the libraries used by it.
  1340. If you want to specify logging for one specific library within the module,
  1341. you set the name to module.library. For example, the logger used by the
  1342. nameserver address store component has the full name of “Resolver.nsas”.
  1343. If there is no entry in Logging for a particular library, it will use the
  1344. configuration given for the module.
  1345. To illustrate this, suppose you want the cache library to log messages of
  1346. severity DEBUG, and the rest of the resolver code to log messages of
  1347. severity INFO. To achieve this you specify two loggers, one with the name
  1348. “Resolver” and severity INFO, and one with the name “Resolver.cache” with
  1349. severity DEBUG. As there are no entries for other libraries (e.g. the
  1350. nsas), they will use the configuration for the module (“Resolver”), so
  1351. giving the desired behavior.
  1352. One special case is that of a module name of “*” (asterisks), which is
  1353. interpreted as any module. You can set global logging options by using
  1354. this, including setting the logging configuration for a library that is
  1355. used by multiple modules (e.g. “*.config” specifies the configuration
  1356. library code in whatever module is using it).
  1357. If there are multiple logger specifications in the configuration that
  1358. might match a particular logger, the specification with the more specific
  1359. logger name takes precedence. For example, if there are entries for for
  1360. both “*” and “Resolver”, the resolver module — and all libraries it uses —
  1361. will log messages according to the configuration in the second entry
  1362. (“Resolver”). All other modules will use the configuration of the first
  1363. entry (“*”). If there was also a configuration entry for “Resolver.cache”,
  1364. the cache library within the resolver would use that in preference to the
  1365. entry for “Resolver”.
  1366. One final note about the naming. When specifying the module name within a
  1367. logger, use the name of the module as specified in bindctl, e.g.
  1368. “Resolver” for the resolver module, “Xfrout” for the xfrout module, etc.
  1369. When the message is logged, the message will include the name of the
  1370. logger generating the message, but with the module name replaced by the
  1371. name of the process implementing the module (so for example, a message
  1372. generated by the “Auth.cache” logger will appear in the output with a
  1373. logger name of “b10-auth.cache”).
  1374. 17.1.1.2. severity (string)
  1375. This specifies the category of messages logged. Each message is logged
  1376. with an associated severity which may be one of the following (in
  1377. descending order of severity):
  1378. o FATAL
  1379. o ERROR
  1380. o WARN
  1381. o INFO
  1382. o DEBUG
  1383. When the severity of a logger is set to one of these values, it will only
  1384. log messages of that severity, and the severities above it. The severity
  1385. may also be set to NONE, in which case all messages from that logger are
  1386. inhibited.
  1387. 17.1.1.3. output_options (list)
  1388. Each logger can have zero or more output_options. These specify where log
  1389. messages are sent to. These are explained in detail below.
  1390. The other options for a logger are:
  1391. 17.1.1.4. debuglevel (integer)
  1392. When a logger's severity is set to DEBUG, this value specifies what debug
  1393. messages should be printed. It ranges from 0 (least verbose) to 99 (most
  1394. verbose).
  1395. If severity for the logger is not DEBUG, this value is ignored.
  1396. 17.1.1.5. additive (true or false)
  1397. If this is true, the output_options from the parent will be used. For
  1398. example, if there are two loggers configured; “Resolver” and
  1399. “Resolver.cache”, and additive is true in the second, it will write the
  1400. log messages not only to the destinations specified for “Resolver.cache”,
  1401. but also to the destinations as specified in the output_options in the
  1402. logger named “Resolver”.
  1403. 17.1.2. Output Options
  1404. The main settings for an output option are the destination and a value
  1405. called output, the meaning of which depends on the destination that is
  1406. set.
  1407. 17.1.2.1. destination (string)
  1408. The destination is the type of output. It can be one of:
  1409. o console
  1410. o file
  1411. o syslog
  1412. 17.1.2.2. output (string)
  1413. Depending on what is set as the output destination, this value is
  1414. interpreted as follows:
  1415. destination is “console”
  1416. The value of output must be one of “stdout” (messages printed to
  1417. standard output) or “stderr” (messages printed to standard error).
  1418. Note: if output is set to “stderr” and a lot of messages are
  1419. produced in a short time (e.g. if the logging level is set to
  1420. DEBUG), you may occasionally see some messages jumbled up
  1421. together. This is due to a combination of the way that messages
  1422. are written to the screen and the unbuffered nature of the
  1423. standard error stream. If this occurs, it is recommended that
  1424. output be set to “stdout”.
  1425. destination is “file”
  1426. The value of output is interpreted as a file name; log messages
  1427. will be appended to this file.
  1428. destination is “syslog”
  1429. The value of output is interpreted as the syslog facility (e.g.
  1430. local0) that should be used for log messages.
  1431. The other options for output_options are:
  1432. 17.1.2.2.1. flush (true of false)
  1433. Flush buffers after each log message. Doing this will reduce performance
  1434. but will ensure that if the program terminates abnormally, all messages up
  1435. to the point of termination are output.
  1436. 17.1.2.2.2. maxsize (integer)
  1437. Only relevant when destination is file, this is maximum file size of
  1438. output files in bytes. When the maximum size is reached, the file is
  1439. renamed and a new file opened. (For example, a ".1" is appended to the
  1440. name — if a ".1" file exists, it is renamed ".2", etc.)
  1441. If this is 0, no maximum file size is used.
  1442. 17.1.2.2.3. maxver (integer)
  1443. Maximum number of old log files to keep around when rolling the output
  1444. file. Only relevant when destination is “file”.
  1445. 17.1.3. Example session
  1446. In this example we want to set the global logging to write to the file
  1447. /var/log/my_bind10.log, at severity WARN. We want the authoritative server
  1448. to log at DEBUG with debuglevel 40, to a different file
  1449. (/tmp/debug_messages).
  1450. Start bindctl.
  1451. ["login success "]
  1452. > config show Logging
  1453. Logging/loggers [] list
  1454. By default, no specific loggers are configured, in which case the severity
  1455. defaults to INFO and the output is written to stderr.
  1456. Let's first add a default logger:
  1457. > config add Logging/loggers
  1458. > config show Logging
  1459. Logging/loggers/ list (modified)
  1460. The loggers value line changed to indicate that it is no longer an empty
  1461. list:
  1462. > config show Logging/loggers
  1463. Logging/loggers[0]/name "" string (default)
  1464. Logging/loggers[0]/severity "INFO" string (default)
  1465. Logging/loggers[0]/debuglevel 0 integer (default)
  1466. Logging/loggers[0]/additive false boolean (default)
  1467. Logging/loggers[0]/output_options [] list (default)
  1468. The name is mandatory, so we must set it. We will also change the severity
  1469. as well. Let's start with the global logger.
  1470. > config set Logging/loggers[0]/name *
  1471. > config set Logging/loggers[0]/severity WARN
  1472. > config show Logging/loggers
  1473. Logging/loggers[0]/name "*" string (modified)
  1474. Logging/loggers[0]/severity "WARN" string (modified)
  1475. Logging/loggers[0]/debuglevel 0 integer (default)
  1476. Logging/loggers[0]/additive false boolean (default)
  1477. Logging/loggers[0]/output_options [] list (default)
  1478. Of course, we need to specify where we want the log messages to go, so we
  1479. add an entry for an output option.
  1480. > config add Logging/loggers[0]/output_options
  1481. > config show Logging/loggers[0]/output_options
  1482. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  1483. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  1484. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1485. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  1486. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  1487. These aren't the values we are looking for.
  1488. > config set Logging/loggers[0]/output_options[0]/destination file
  1489. > config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log
  1490. > config set Logging/loggers[0]/output_options[0]/maxsize 204800
  1491. > config set Logging/loggers[0]/output_options[0]/maxver 8
  1492. Which would make the entire configuration for this logger look like:
  1493. > config show all Logging/loggers
  1494. Logging/loggers[0]/name "*" string (modified)
  1495. Logging/loggers[0]/severity "WARN" string (modified)
  1496. Logging/loggers[0]/debuglevel 0 integer (default)
  1497. Logging/loggers[0]/additive false boolean (default)
  1498. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  1499. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  1500. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  1501. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  1502. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  1503. That looks OK, so let's commit it before we add the configuration for the
  1504. authoritative server's logger.
  1505. > config commit
  1506. Now that we have set it, and checked each value along the way, adding a
  1507. second entry is quite similar.
  1508. > config add Logging/loggers
  1509. > config set Logging/loggers[1]/name Auth
  1510. > config set Logging/loggers[1]/severity DEBUG
  1511. > config set Logging/loggers[1]/debuglevel 40
  1512. > config add Logging/loggers[1]/output_options
  1513. > config set Logging/loggers[1]/output_options[0]/destination file
  1514. > config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log
  1515. > config commit
  1516. And that's it. Once we have found whatever it was we needed the debug
  1517. messages for, we can simply remove the second logger to let the
  1518. authoritative server use the same settings as the rest.
  1519. > config remove Logging/loggers[1]
  1520. > config commit
  1521. And every module will now be using the values from the logger named “*”.
  1522. 17.2. Logging Message Format
  1523. Each message written by BIND 10 to the configured logging destinations
  1524. comprises a number of components that identify the origin of the message
  1525. and, if the message indicates a problem, information about the problem
  1526. that may be useful in fixing it.
  1527. Consider the message below logged to a file:
  1528. 2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  1529. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)
  1530. Note: the layout of messages written to the system logging file (syslog)
  1531. may be slightly different. This message has been split across two lines
  1532. here for display reasons; in the logging file, it will appear on one
  1533. line.)
  1534. The log message comprises a number of components:
  1535. 2011-06-15 13:48:22.034
  1536. The date and time at which the message was generated.
  1537. ERROR
  1538. The severity of the message.
  1539. [b10-resolver.asiolink]
  1540. The source of the message. This comprises two components: the BIND
  1541. 10 process generating the message (in this case, b10-resolver) and
  1542. the module within the program from which the message originated
  1543. (which in the example is the asynchronous I/O link module,
  1544. asiolink).
  1545. ASIODNS_OPENSOCK
  1546. The message identification. Every message in BIND 10 has a unique
  1547. identification, which can be used as an index into the BIND 10
  1548. Messages Manual (http://bind10.isc.org/docs/bind10-messages.html)
  1549. from which more information can be obtained.
  1550. error 111 opening TCP socket to 127.0.0.1(53)
  1551. A brief description of the cause of the problem. Within this text,
  1552. information relating to the condition that caused the message to
  1553. be logged will be included. In this example, error number 111 (an
  1554. operating system-specific error number) was encountered when
  1555. trying to open a TCP connection to port 53 on the local system
  1556. (address 127.0.0.1). The next step would be to find out the reason
  1557. for the failure by consulting your system's documentation to
  1558. identify what error number 111 means.