bind10-guide.txt 67 KB

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