bind10-guide.txt 83 KB

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