bind10-guide.txt 70 KB

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