bind10-guide.txt 84 KB

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