bind10-guide.txt 84 KB

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