bind10-guide.txt 66 KB

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