bind10-guide.txt 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201
  1. BIND 10 Guide
  2. Administrator Reference for BIND 10
  3. This is the reference guide for BIND 10 version 20110809.
  4. Copyright (c) 2010-2011 Internet Systems Consortium, Inc.
  5. Abstract
  6. BIND 10 is a Domain Name System (DNS) suite managed by Internet Systems
  7. Consortium (ISC). It includes DNS libraries and modular components for
  8. controlling authoritative and recursive DNS servers.
  9. This is the reference guide for BIND 10 version 20110809. The most
  10. up-to-date version of this document (in PDF, HTML, and plain text
  11. formats), along with other documents for BIND 10, can be found at
  12. http://bind10.isc.org/docs.
  13. --------------------------------------------------------------------------
  14. Table of Contents
  15. 1. Introduction
  16. Supported Platforms
  17. Required Software
  18. Starting and Stopping the Server
  19. Managing BIND 10
  20. 2. Installation
  21. Building Requirements
  22. Quick start
  23. Installation from source
  24. Download Tar File
  25. Retrieve from Git
  26. Configure before the build
  27. Build
  28. Install
  29. Install Hierarchy
  30. 3. Starting BIND10 with bind10
  31. Starting BIND 10
  32. 4. Command channel
  33. 5. Configuration manager
  34. 6. Remote control daemon
  35. Configuration specification for b10-cmdctl
  36. 7. Control and configure user interface
  37. 8. Authoritative Server
  38. Server Configurations
  39. Data Source Backends
  40. Loading Master Zones Files
  41. 9. Incoming Zone Transfers
  42. Configuration for Incoming Zone Transfers
  43. Enabling IXFR
  44. Trigger an Incoming Zone Transfer Manually
  45. 10. Outbound Zone Transfers
  46. 11. Secondary Manager
  47. 12. Recursive Name Server
  48. Access Control
  49. Forwarding
  50. 13. Statistics
  51. 14. Logging
  52. Logging configuration
  53. Loggers
  54. Output Options
  55. Example session
  56. Logging Message Format
  57. Chapter 1. Introduction
  58. Table of Contents
  59. Supported Platforms
  60. Required Software
  61. Starting and Stopping the Server
  62. Managing BIND 10
  63. BIND is the popular implementation of a DNS server, developer interfaces,
  64. and DNS tools. BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++
  65. and Python and provides a modular environment for serving and maintaining
  66. DNS.
  67. Note
  68. This guide covers the experimental prototype of BIND 10 version 20110809.
  69. Note
  70. BIND 10 provides a EDNS0- and DNSSEC-capable authoritative DNS server and
  71. a caching recursive name server which also provides forwarding.
  72. Supported Platforms
  73. BIND 10 builds have been tested on Debian GNU/Linux 5, Ubuntu 9.10, NetBSD
  74. 5, Solaris 10, FreeBSD 7 and 8, and CentOS Linux 5.3. It has been tested
  75. on Sparc, i386, and amd64 hardware platforms. It is planned for BIND 10 to
  76. build, install and run on Windows and standard Unix-type platforms.
  77. Required Software
  78. BIND 10 requires Python 3.1. Later versions may work, but Python 3.1 is
  79. the minimum version which will work.
  80. BIND 10 uses the Botan crypto library for C++. It requires at least Botan
  81. version 1.8.
  82. BIND 10 uses the log4cplus C++ logging library. It requires at least
  83. log4cplus version 1.0.3.
  84. The authoritative server requires SQLite 3.3.9 or newer. The b10-xfrin,
  85. b10-xfrout, and b10-zonemgr modules require the libpython3 library and the
  86. Python _sqlite3.so module.
  87. Note
  88. Some operating systems do not provide these dependencies in their default
  89. installation nor standard packages collections. You may need to install
  90. them separately.
  91. Starting and Stopping the Server
  92. BIND 10 is modular. Part of this modularity is accomplished using multiple
  93. cooperating processes which, together, provide the server functionality.
  94. This is a change from the previous generation of BIND software, which used
  95. a single process.
  96. At first, running many different processes may seem confusing. However,
  97. these processes are started, stopped, and maintained by a single command,
  98. bind10. This command starts a master process which will start other
  99. processes as needed. The processes started by the bind10 command have
  100. names starting with "b10-", including:
  101. o b10-msgq -- Message bus daemon. This process coordinates communication
  102. between all of the other BIND 10 processes.
  103. o b10-auth -- Authoritative DNS server. This process serves DNS
  104. requests.
  105. o b10-cfgmgr -- Configuration manager. This process maintains all of the
  106. configuration for BIND 10.
  107. o b10-cmdctl -- Command and control service. This process allows
  108. external control of the BIND 10 system.
  109. o b10-resolver -- Recursive name server. This process handles incoming
  110. queries.
  111. o b10-stats -- Statistics collection daemon. This process collects and
  112. reports statistics data.
  113. o b10-xfrin -- Incoming zone transfer service. This process is used to
  114. transfer a new copy of a zone into BIND 10, when acting as a secondary
  115. server.
  116. o b10-xfrout -- Outgoing zone transfer service. This process is used to
  117. handle transfer requests to send a local zone to a remote secondary
  118. server, when acting as a master server.
  119. o b10-zonemgr -- Secondary manager. This process keeps track of timers
  120. and other necessary information for BIND 10 to act as a slave server.
  121. These are ran automatically by bind10 and do not need to be run manually.
  122. Managing BIND 10
  123. Once BIND 10 is running, a few commands are used to interact directly with
  124. the system:
  125. o bindctl -- interactive administration interface. This is a
  126. command-line tool which allows an administrator to control BIND 10.
  127. o b10-loadzone -- zone file loader. This tool will load standard
  128. masterfile-format zone files into BIND 10.
  129. o b10-cmdctl-usermgr -- user access control. This tool allows an
  130. administrator to authorize additional users to manage BIND 10.
  131. The tools and modules are covered in full detail in this guide. In
  132. addition, manual pages are also provided in the default installation.
  133. BIND 10 also provides libraries and programmer interfaces for C++ and
  134. Python for the message bus, configuration backend, and, of course, DNS.
  135. These include detailed developer documentation and code examples.
  136. Chapter 2. Installation
  137. Table of Contents
  138. Building Requirements
  139. Quick start
  140. Installation from source
  141. Download Tar File
  142. Retrieve from Git
  143. Configure before the build
  144. Build
  145. Install
  146. Install Hierarchy
  147. Building Requirements
  148. In addition to the run-time requirements, building BIND 10 from source
  149. code requires various development include headers.
  150. Note
  151. Some operating systems have split their distribution packages into a
  152. run-time and a development package. You will need to install the
  153. development package versions, which include header files and libraries, to
  154. build BIND 10 from source code.
  155. Building from source code requires the Boost build-time headers. At least
  156. Boost version 1.35 is required.
  157. To build BIND 10, also install the Botan (at least version 1.8) and the
  158. log4cplus (at least version 1.0.3) development include headers.
  159. The Python Library and Python _sqlite3 module are required to enable the
  160. Xfrout and Xfrin support.
  161. Note
  162. The Python related libraries and modules need to be built for Python 3.1.
  163. Building BIND 10 also requires a C++ compiler and standard development
  164. headers, make, and pkg-config. BIND 10 builds have been tested with GCC
  165. 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++
  166. 5.10.
  167. Quick start
  168. Note
  169. This quickly covers the standard steps for installing and deploying BIND
  170. 10 as an authoritative name server using its defaults. For
  171. troubleshooting, full customizations and further details, see the
  172. respective chapters in the BIND 10 guide.
  173. To quickly get started with BIND 10, follow these steps.
  174. 1. Install required build dependencies.
  175. 2. Download the BIND 10 source tar file from
  176. ftp://ftp.isc.org/isc/bind10/.
  177. 3. Extract the tar file:
  178. $ gzcat bind10-VERSION.tar.gz | tar -xvf -
  179. 4. Go into the source and run configure:
  180. $ cd bind10-VERSION
  181. $ ./configure
  182. 5. Build it:
  183. $ make
  184. 6. Install it (to default /usr/local):
  185. $ make install
  186. 7. Start the server:
  187. $ /usr/local/sbin/bind10
  188. 8. Test it; for example:
  189. $ dig @127.0.0.1 -c CH -t TXT authors.bind
  190. 9. Load desired zone file(s), for example:
  191. $ b10-loadzone your.zone.example.org
  192. 10. Test the new zone.
  193. Installation from source
  194. BIND 10 is open source software written in C++ and Python. It is freely
  195. available in source code form from ISC via the Git code revision control
  196. system or as a downloadable tar file. It may also be available in
  197. pre-compiled ready-to-use packages from operating system vendors.
  198. Download Tar File
  199. Downloading a release tar file is the recommended method to obtain the
  200. source code.
  201. The BIND 10 releases are available as tar file downloads from
  202. ftp://ftp.isc.org/isc/bind10/. Periodic development snapshots may also be
  203. available.
  204. Retrieve from Git
  205. Downloading this "bleeding edge" code is recommended only for developers
  206. or advanced users. Using development code in a production environment is
  207. not recommended.
  208. Note
  209. When using source code retrieved via Git additional software will be
  210. required: automake (v1.11 or newer), libtoolize, and autoconf (2.59 or
  211. newer). These may need to be installed.
  212. The latest development code, including temporary experiments and
  213. un-reviewed code, is available via the BIND 10 code revision control
  214. system. This is powered by Git and all the BIND 10 development is public.
  215. The leading development is done in the "master".
  216. The code can be checked out from git://bind10.isc.org/bind10; for example:
  217. $ git clone git://bind10.isc.org/bind10
  218. When checking out the code from the code version control system, it
  219. doesn't include the generated configure script, Makefile.in files, nor the
  220. related configure files. They can be created by running autoreconf with
  221. the --install switch. This will run autoconf, aclocal, libtoolize,
  222. autoheader, automake, and related commands.
  223. Configure before the build
  224. BIND 10 uses the GNU Build System to discover build environment details.
  225. To generate the makefiles using the defaults, simply run:
  226. $ ./configure
  227. Run ./configure with the --help switch to view the different options. The
  228. commonly-used options are:
  229. --prefix
  230. Define the installation location (the default is /usr/local/).
  231. --with-boost-include
  232. Define the path to find the Boost headers.
  233. --with-pythonpath
  234. Define the path to Python 3.1 if it is not in the standard
  235. execution path.
  236. --with-gtest
  237. Enable building the C++ Unit Tests using the Google Tests
  238. framework. Optionally this can define the path to the gtest header
  239. files and library.
  240. For example, the following configures it to find the Boost headers, find
  241. the Python interpreter, and sets the installation location:
  242. $ ./configure \
  243. --with-boost-include=/usr/pkg/include \
  244. --with-pythonpath=/usr/pkg/bin/python3.1 \
  245. --prefix=/opt/bind10
  246. If the configure fails, it may be due to missing or old dependencies.
  247. Build
  248. After the configure step is complete, to build the executables from the
  249. C++ code and prepare the Python scripts, run:
  250. $ make
  251. Install
  252. To install the BIND 10 executables, support files, and documentation, run:
  253. $ make install
  254. Note
  255. The install step may require superuser privileges.
  256. Install Hierarchy
  257. The following is the layout of the complete BIND 10 installation:
  258. o bin/ -- general tools and diagnostic clients.
  259. o etc/bind10-devel/ -- configuration files.
  260. o lib/ -- libraries and python modules.
  261. o libexec/bind10-devel/ -- executables that a user wouldn't normally run
  262. directly and are not run independently. These are the BIND 10 modules
  263. which are daemons started by the bind10 tool.
  264. o sbin/ -- commands used by the system administrator.
  265. o share/bind10-devel/ -- configuration specifications.
  266. o share/man/ -- manual pages (online documentation).
  267. o var/bind10-devel/ -- data source and configuration databases.
  268. Chapter 3. Starting BIND10 with bind10
  269. Table of Contents
  270. Starting BIND 10
  271. BIND 10 provides the bind10 command which starts up the required
  272. processes. bind10 will also restart processes that exit unexpectedly. This
  273. is the only command needed to start the BIND 10 system.
  274. After starting the b10-msgq communications channel, bind10 connects to it,
  275. runs the configuration manager, and reads its own configuration. Then it
  276. starts the other modules.
  277. The b10-msgq and b10-cfgmgr services make up the core. The b10-msgq daemon
  278. provides the communication channel between every part of the system. The
  279. b10-cfgmgr daemon is always needed by every module, if only to send
  280. information about themselves somewhere, but more importantly to ask about
  281. their own settings, and about other modules. The bind10 master process
  282. will also start up b10-cmdctl for admins to communicate with the system,
  283. b10-auth for authoritative DNS service or b10-resolver for recursive name
  284. service, b10-stats for statistics collection, b10-xfrin for inbound DNS
  285. zone transfers, b10-xfrout for outbound DNS zone transfers, and
  286. b10-zonemgr for secondary service.
  287. Starting BIND 10
  288. To start the BIND 10 service, simply run bind10. Run it with the --verbose
  289. switch to get additional debugging or diagnostic output.
  290. Note
  291. If the setproctitle Python module is detected at start up, the process
  292. names for the Python-based daemons will be renamed to better identify them
  293. instead of just "python". This is not needed on some operating systems.
  294. Chapter 4. Command channel
  295. The BIND 10 components use the b10-msgq message routing daemon to
  296. communicate with other BIND 10 components. The b10-msgq implements what is
  297. called the "Command Channel". Processes intercommunicate by sending
  298. messages on the command channel. Example messages include shutdown, get
  299. configurations, and set configurations. This Command Channel is not used
  300. for DNS message passing. It is used only to control and monitor the BIND
  301. 10 system.
  302. Administrators do not communicate directly with the b10-msgq daemon. By
  303. default, BIND 10 uses port 9912 for the b10-msgq service. It listens on
  304. 127.0.0.1.
  305. Chapter 5. Configuration manager
  306. The configuration manager, b10-cfgmgr, handles all BIND 10 system
  307. configuration. It provides persistent storage for configuration, and
  308. notifies running modules of configuration changes.
  309. The b10-auth and b10-xfrin daemons and other components receive their
  310. configurations from the configuration manager over the b10-msgq command
  311. channel.
  312. The administrator doesn't connect to it directly, but uses a user
  313. interface to communicate with the configuration manager via b10-cmdctl's
  314. REST-ful interface. b10-cmdctl is covered in Chapter 6, Remote control
  315. daemon.
  316. Note
  317. The development prototype release only provides the bindctl as a user
  318. interface to b10-cmdctl. Upcoming releases will provide another
  319. interactive command-line interface and a web-based interface.
  320. The b10-cfgmgr daemon can send all specifications and all current settings
  321. to the bindctl client (via b10-cmdctl).
  322. b10-cfgmgr relays configurations received from b10-cmdctl to the
  323. appropriate modules.
  324. The stored configuration file is at
  325. /usr/local/var/bind10-devel/b10-config.db. (The full path is what was
  326. defined at build configure time for --localstatedir. The default is
  327. /usr/local/var/.) The format is loosely based on JSON and is directly
  328. parseable python, but this may change in a future version. This
  329. configuration data file is not manually edited by the administrator.
  330. The configuration manager does not have any command line arguments.
  331. Normally it is not started manually, but is automatically started using
  332. the bind10 master process (as covered in Chapter 3, Starting BIND10 with
  333. bind10).
  334. Chapter 6. Remote control daemon
  335. Table of Contents
  336. Configuration specification for b10-cmdctl
  337. b10-cmdctl is the gateway between administrators and the BIND 10 system.
  338. It is a HTTPS server that uses standard HTTP Digest Authentication for
  339. username and password validation. It provides a REST-ful interface for
  340. accessing and controlling BIND 10.
  341. When b10-cmdctl starts, it firsts asks b10-cfgmgr about what modules are
  342. running and what their configuration is (over the b10-msgq channel). Then
  343. it will start listening on HTTPS for clients -- the user interface -- such
  344. as bindctl.
  345. b10-cmdctl directly sends commands (received from the user interface) to
  346. the specified component. Configuration changes are actually commands to
  347. b10-cfgmgr so are sent there.
  348. The HTTPS server requires a private key, such as a RSA PRIVATE KEY. The
  349. default location is at /usr/local/etc/bind10-devel/cmdctl-keyfile.pem. (A
  350. sample key is at /usr/local/share/bind10-devel/cmdctl-keyfile.pem.) It
  351. also uses a certificate located at
  352. /usr/local/etc/bind10-devel/cmdctl-certfile.pem. (A sample certificate is
  353. at /usr/local/share/bind10-devel/cmdctl-certfile.pem.) This may be a
  354. self-signed certificate or purchased from a certification authority.
  355. Note
  356. The HTTPS server doesn't support a certificate request from a client (at
  357. this time). The b10-cmdctl daemon does not provide a public service. If
  358. any client wants to control BIND 10, then a certificate needs to be first
  359. received from the BIND 10 administrator. The BIND 10 installation provides
  360. a sample PEM bundle that matches the sample key and certificate.
  361. The b10-cmdctl daemon also requires the user account file located at
  362. /usr/local/etc/bind10-devel/cmdctl-accounts.csv. This comma-delimited file
  363. lists the accounts with a user name, hashed password, and salt. (A sample
  364. file is at /usr/local/share/bind10-devel/cmdctl-accounts.csv. It contains
  365. the user named "root" with the password "bind10".)
  366. The administrator may create a user account with the b10-cmdctl-usermgr
  367. tool.
  368. By default the HTTPS server listens on the localhost port 8080. The port
  369. can be set by using the --port command line option. The address to listen
  370. on can be set using the --address command line argument. Each HTTPS
  371. connection is stateless and timesout in 1200 seconds by default. This can
  372. be redefined by using the --idle-timeout command line argument.
  373. Configuration specification for b10-cmdctl
  374. The configuration items for b10-cmdctl are: key_file cert_file
  375. accounts_file
  376. The control commands are: print_settings shutdown
  377. Chapter 7. Control and configure user interface
  378. Note
  379. For this development prototype release, bindctl is the only user
  380. interface. It is expected that upcoming releases will provide another
  381. interactive command-line interface and a web-based interface for
  382. controlling and configuring BIND 10.
  383. The bindctl tool provides an interactive prompt for configuring,
  384. controlling, and querying the BIND 10 components. It communicates directly
  385. with a REST-ful interface over HTTPS provided by b10-cmdctl. It doesn't
  386. communicate to any other components directly.
  387. Configuration changes are actually commands to b10-cfgmgr. So when bindctl
  388. sends a configuration, it is sent to b10-cmdctl (over a HTTPS connection);
  389. then b10-cmdctl sends the command (over a b10-msgq command channel) to
  390. b10-cfgmgr which then stores the details and relays (over a b10-msgq
  391. command channel) the configuration on to the specified module.
  392. Chapter 8. Authoritative Server
  393. Table of Contents
  394. Server Configurations
  395. Data Source Backends
  396. Loading Master Zones Files
  397. The b10-auth is the authoritative DNS server. It supports EDNS0 and
  398. DNSSEC. It supports IPv6. Normally it is started by the bind10 master
  399. process.
  400. Server Configurations
  401. b10-auth is configured via the b10-cfgmgr configuration manager. The
  402. module name is "Auth". The configuration data item is:
  403. database_file
  404. This is an optional string to define the path to find the SQLite3
  405. database file. Note: Later the DNS server will use various data
  406. source backends. This may be a temporary setting until then.
  407. The configuration command is:
  408. shutdown
  409. Stop the authoritative DNS server.
  410. Data Source Backends
  411. Note
  412. For the development prototype release, b10-auth supports a SQLite3 data
  413. source backend and in-memory data source backend. Upcoming versions will
  414. be able to use multiple different data sources, such as MySQL and Berkeley
  415. DB.
  416. By default, the SQLite3 backend uses the data file located at
  417. /usr/local/var/bind10-devel/zone.sqlite3. (The full path is what was
  418. defined at build configure time for --localstatedir. The default is
  419. /usr/local/var/.) This data file location may be changed by defining the
  420. "database_file" configuration.
  421. Loading Master Zones Files
  422. RFC 1035 style DNS master zone files may imported into a BIND 10 data
  423. source by using the b10-loadzone utility.
  424. b10-loadzone supports the following special directives (control entries):
  425. $INCLUDE
  426. Loads an additional zone file. This may be recursive.
  427. $ORIGIN
  428. Defines the relative domain name.
  429. $TTL
  430. Defines the time-to-live value used for following records that
  431. don't include a TTL.
  432. The -o argument may be used to define the default origin for loaded zone
  433. file records.
  434. Note
  435. In the development prototype release, only the SQLite3 back end is used.
  436. By default, it stores the zone data in
  437. /usr/local/var/bind10-devel/zone.sqlite3 unless the -d switch is used to
  438. set the database filename. Multiple zones are stored in a single SQLite3
  439. zone database.
  440. If you reload a zone already existing in the database, all records from
  441. that prior zone disappear and a whole new set appears.
  442. Chapter 9. Incoming Zone Transfers
  443. Table of Contents
  444. Configuration for Incoming Zone Transfers
  445. Enabling IXFR
  446. Trigger an Incoming Zone Transfer Manually
  447. Incoming zones are transferred using the b10-xfrin process which is
  448. started by bind10. When received, the zone is stored in the corresponding
  449. BIND 10 data source, and its records can be served by b10-auth. In
  450. combination with b10-zonemgr (for automated SOA checks), this allows the
  451. BIND 10 server to provide "secondary" service.
  452. The b10-xfrin process supports both AXFR and IXFR. Due to some
  453. implementation limitations of the current development release, however, it
  454. only tries AXFR by default, and care should be taken to enable IXFR.
  455. Note
  456. In the current development release of BIND 10, incoming zone transfers are
  457. only available for SQLite3-based data sources, that is, they don't work
  458. for an in-memory data source.
  459. Configuration for Incoming Zone Transfers
  460. In practice, you need to specify a list of secondary zones to enable
  461. incoming zone transfers for these zones (you can still trigger a zone
  462. transfer manually, without a prior configuration (see below)).
  463. For example, to enable zone transfers for a zone named "example.com"
  464. (whose master address is assumed to be 2001:db8::53 here), run the
  465. following at the bindctl prompt:
  466. > config add Xfrin/zones
  467. > config set Xfrin/zones[0]/name "example.com"
  468. > config set Xfrin/zones[0]/master_addr "2001:db8::53"
  469. > config commit
  470. (We assume there has been no zone configuration before).
  471. Enabling IXFR
  472. As noted above, b10-xfrin uses AXFR for zone transfers by default. To
  473. enable IXFR for zone transfers for a particular zone, set the use_ixfr
  474. configuration parameter to true. In the above example of configuration
  475. sequence, you'll need to add the following before performing commit:
  476. > config set Xfrin/zones[0]/use_ixfr true
  477. Note
  478. One reason why IXFR is disabled by default in the current release is
  479. because it does not support automatic fallback from IXFR to AXFR when it
  480. encounters a primary server that doesn't support outbound IXFR (and, not
  481. many existing implementations support it). Another, related reason is that
  482. it does not use AXFR even if it has no knowledge about the zone (like at
  483. the very first time the secondary server is set up). IXFR requires the
  484. "current version" of the zone, so obviously it doesn't work in this
  485. situation and AXFR is the only workable choice. The current release of
  486. b10-xfrin does not make this selection automatically. These features will
  487. be implemented in a near future version, at which point we will enable
  488. IXFR by default.
  489. Trigger an Incoming Zone Transfer Manually
  490. To manually trigger a zone transfer to retrieve a remote zone, you may use
  491. the bindctl utility. For example, at the bindctl prompt run:
  492. > Xfrin retransfer zone_name="foo.example.org" master=192.0.2.99
  493. Chapter 10. Outbound Zone Transfers
  494. The b10-xfrout process is started by bind10. When the b10-auth
  495. authoritative DNS server receives an AXFR request, b10-xfrout sends the
  496. zone. This is used to provide master DNS service to share zones to
  497. secondary name servers. The b10-xfrout is also used to send NOTIFY
  498. messages to slaves.
  499. Note
  500. The current development release of BIND 10 only supports AXFR. (IXFR is
  501. not supported.) Access control is not yet provided.
  502. Chapter 11. Secondary Manager
  503. The b10-zonemgr process is started by bind10. It keeps track of SOA
  504. refresh, retry, and expire timers and other details for BIND 10 to perform
  505. as a slave. When the b10-auth authoritative DNS server receives a NOTIFY
  506. message, b10-zonemgr may tell b10-xfrin to do a refresh to start an
  507. inbound zone transfer. The secondary manager resets its counters when a
  508. new zone is transferred in.
  509. Note
  510. Access control (such as allowing notifies) is not yet provided. The
  511. primary/secondary service is not yet complete.
  512. Chapter 12. Recursive Name Server
  513. Table of Contents
  514. Access Control
  515. Forwarding
  516. The b10-resolver process is started by bind10.
  517. The main bind10 process can be configured to select to run either the
  518. authoritative or resolver or both. By default, it starts the authoritative
  519. service. You may change this using bindctl, for example:
  520. > config set Boss/start_auth false
  521. > config set Boss/start_resolver true
  522. > config commit
  523. The master bind10 will stop and start the desired services.
  524. By default, the resolver listens on port 53 for 127.0.0.1 and ::1. The
  525. following example shows how it can be configured to listen on an
  526. additional address (and port):
  527. > config add Resolver/listen_on
  528. > config set Resolver/listen_on[2]/address "192.168.1.1"
  529. > config set Resolver/listen_on[2]/port 53
  530. > config commit
  531. (Replace the "2" as needed; run "config show Resolver/listen_on" if
  532. needed.)
  533. Access Control
  534. By default, the b10-resolver daemon only accepts DNS queries from the
  535. localhost (127.0.0.1 and ::1). The Resolver/query_acl configuration may be
  536. used to reject, drop, or allow specific IPs or networks. This
  537. configuration list is first match.
  538. The configuration's action item may be set to "ACCEPT" to allow the
  539. incoming query, "REJECT" to respond with a DNS REFUSED return code, or
  540. "DROP" to ignore the query without any response (such as a blackhole). For
  541. more information, see the respective debugging messages:
  542. RESOLVER_QUERY_ACCEPTED, RESOLVER_QUERY_REJECTED, and
  543. RESOLVER_QUERY_DROPPED.
  544. The required configuration's from item is set to an IPv4 or IPv6 address,
  545. addresses with an network mask, or to the special lowercase keywords
  546. "any6" (for any IPv6 address) or "any4" (for any IPv4 address).
  547. For example to allow the 192.168.1.0/24 network to use your recursive name
  548. server, at the bindctl prompt run:
  549. > config add Resolver/query_acl
  550. > config set Resolver/query_acl[2]/action "ACCEPT"
  551. > config set Resolver/query_acl[2]/from "192.168.1.0/24"
  552. > config commit
  553. (Replace the "2" as needed; run "config show Resolver/query_acl" if
  554. needed.)
  555. Note
  556. This prototype access control configuration syntax may be changed.
  557. Forwarding
  558. To enable forwarding, the upstream address and port must be configured to
  559. forward queries to, such as:
  560. > config set Resolver/forward_addresses [{ "address": "192.168.1.1", "port": 53 }]
  561. > config commit
  562. (Replace 192.168.1.1 to point to your full resolver.)
  563. Normal iterative name service can be re-enabled by clearing the forwarding
  564. address(es); for example:
  565. > config set Resolver/forward_addresses []
  566. > config commit
  567. Chapter 13. Statistics
  568. The b10-stats process is started by bind10. It periodically collects
  569. statistics data from various modules and aggregates it.
  570. This stats daemon provides commands to identify if it is running, show
  571. specified or all statistics data, show specified or all statistics data
  572. schema, and set specified statistics data. For example, using bindctl:
  573. > Stats show
  574. {
  575. "Auth": {
  576. "queries.tcp": 1749,
  577. "queries.udp": 867868
  578. },
  579. "Boss": {
  580. "boot_time": "2011-01-20T16:59:03Z"
  581. },
  582. "Stats": {
  583. "boot_time": "2011-01-20T16:59:05Z",
  584. "last_update_time": "2011-01-20T17:04:05Z",
  585. "lname": "4d3869d9_a@jreed.example.net",
  586. "report_time": "2011-01-20T17:04:06Z",
  587. "timestamp": 1295543046.823504
  588. }
  589. }
  590. Chapter 14. Logging
  591. Table of Contents
  592. Logging configuration
  593. Loggers
  594. Output Options
  595. Example session
  596. Logging Message Format
  597. Logging configuration
  598. The logging system in BIND 10 is configured through the Logging module.
  599. All BIND 10 modules will look at the configuration in Logging to see what
  600. should be logged and to where.
  601. Loggers
  602. Within BIND 10, a message is logged through a component called a "logger".
  603. Different parts of BIND 10 log messages through different loggers, and
  604. each logger can be configured independently of one another.
  605. In the Logging module, you can specify the configuration for zero or more
  606. loggers; any that are not specified will take appropriate default values..
  607. The three most important elements of a logger configuration are the name
  608. (the component that is generating the messages), the severity (what to
  609. log), and the output_options (where to log).
  610. name (string)
  611. Each logger in the system has a name, the name being that of the component
  612. using it to log messages. For instance, if you want to configure logging
  613. for the resolver module, you add an entry for a logger named "Resolver".
  614. This configuration will then be used by the loggers in the Resolver
  615. module, and all the libraries used by it.
  616. If you want to specify logging for one specific library within the module,
  617. you set the name to module.library. For example, the logger used by the
  618. nameserver address store component has the full name of "Resolver.nsas".
  619. If there is no entry in Logging for a particular library, it will use the
  620. configuration given for the module.
  621. To illustrate this, suppose you want the cache library to log messages of
  622. severity DEBUG, and the rest of the resolver code to log messages of
  623. severity INFO. To achieve this you specify two loggers, one with the name
  624. "Resolver" and severity INFO, and one with the name "Resolver.cache" with
  625. severity DEBUG. As there are no entries for other libraries (e.g. the
  626. nsas), they will use the configuration for the module ("Resolver"), so
  627. giving the desired behavior.
  628. One special case is that of a module name of "*" (asterisks), which is
  629. interpreted as any module. You can set global logging options by using
  630. this, including setting the logging configuration for a library that is
  631. used by multiple modules (e.g. "*.config" specifies the configuration
  632. library code in whatever module is using it).
  633. If there are multiple logger specifications in the configuration that
  634. might match a particular logger, the specification with the more specific
  635. logger name takes precedence. For example, if there are entries for for
  636. both "*" and "Resolver", the resolver module -- and all libraries it uses
  637. -- will log messages according to the configuration in the second entry
  638. ("Resolver"). All other modules will use the configuration of the first
  639. entry ("*"). If there was also a configuration entry for "Resolver.cache",
  640. the cache library within the resolver would use that in preference to the
  641. entry for "Resolver".
  642. One final note about the naming. When specifying the module name within a
  643. logger, use the name of the module as specified in bindctl, e.g.
  644. "Resolver" for the resolver module, "Xfrout" for the xfrout module, etc.
  645. When the message is logged, the message will include the name of the
  646. logger generating the message, but with the module name replaced by the
  647. name of the process implementing the module (so for example, a message
  648. generated by the "Auth.cache" logger will appear in the output with a
  649. logger name of "b10-auth.cache").
  650. severity (string)
  651. This specifies the category of messages logged. Each message is logged
  652. with an associated severity which may be one of the following (in
  653. descending order of severity):
  654. o FATAL
  655. o ERROR
  656. o WARN
  657. o INFO
  658. o DEBUG
  659. When the severity of a logger is set to one of these values, it will only
  660. log messages of that severity, and the severities above it. The severity
  661. may also be set to NONE, in which case all messages from that logger are
  662. inhibited.
  663. output_options (list)
  664. Each logger can have zero or more output_options. These specify where log
  665. messages are sent to. These are explained in detail below.
  666. The other options for a logger are:
  667. debuglevel (integer)
  668. When a logger's severity is set to DEBUG, this value specifies what debug
  669. messages should be printed. It ranges from 0 (least verbose) to 99 (most
  670. verbose).
  671. If severity for the logger is not DEBUG, this value is ignored.
  672. additive (true or false)
  673. If this is true, the output_options from the parent will be used. For
  674. example, if there are two loggers configured; "Resolver" and
  675. "Resolver.cache", and additive is true in the second, it will write the
  676. log messages not only to the destinations specified for "Resolver.cache",
  677. but also to the destinations as specified in the output_options in the
  678. logger named "Resolver".
  679. Output Options
  680. The main settings for an output option are the destination and a value
  681. called output, the meaning of which depends on the destination that is
  682. set.
  683. destination (string)
  684. The destination is the type of output. It can be one of:
  685. o console
  686. o file
  687. o syslog
  688. output (string)
  689. Depending on what is set as the output destination, this value is
  690. interpreted as follows:
  691. destination is "console"
  692. The value of output must be one of "stdout" (messages printed to
  693. standard output) or "stderr" (messages printed to standard error).
  694. destination is "file"
  695. The value of output is interpreted as a file name; log messages
  696. will be appended to this file.
  697. destination is "syslog"
  698. The value of output is interpreted as the syslog facility (e.g.
  699. local0) that should be used for log messages.
  700. The other options for output_options are:
  701. flush (true of false)
  702. Flush buffers after each log message. Doing this will reduce performance
  703. but will ensure that if the program terminates abnormally, all messages up
  704. to the point of termination are output.
  705. maxsize (integer)
  706. Only relevant when destination is file, this is maximum file size of
  707. output files in bytes. When the maximum size is reached, the file is
  708. renamed and a new file opened. (For example, a ".1" is appended to the
  709. name -- if a ".1" file exists, it is renamed ".2", etc.)
  710. If this is 0, no maximum file size is used.
  711. maxver (integer)
  712. Maximum number of old log files to keep around when rolling the output
  713. file. Only relevant when destination is "file".
  714. Example session
  715. In this example we want to set the global logging to write to the file
  716. /var/log/my_bind10.log, at severity WARN. We want the authoritative server
  717. to log at DEBUG with debuglevel 40, to a different file
  718. (/tmp/debug_messages).
  719. Start bindctl.
  720. ["login success "]
  721. > config show Logging
  722. Logging/loggers [] list
  723. By default, no specific loggers are configured, in which case the severity
  724. defaults to INFO and the output is written to stderr.
  725. Let's first add a default logger:
  726. > config add Logging/loggers
  727. > config show Logging
  728. Logging/loggers/ list (modified)
  729. The loggers value line changed to indicate that it is no longer an empty
  730. list:
  731. > config show Logging/loggers
  732. Logging/loggers[0]/name "" string (default)
  733. Logging/loggers[0]/severity "INFO" string (default)
  734. Logging/loggers[0]/debuglevel 0 integer (default)
  735. Logging/loggers[0]/additive false boolean (default)
  736. Logging/loggers[0]/output_options [] list (default)
  737. The name is mandatory, so we must set it. We will also change the severity
  738. as well. Let's start with the global logger.
  739. > config set Logging/loggers[0]/name *
  740. > config set Logging/loggers[0]/severity WARN
  741. > config show Logging/loggers
  742. Logging/loggers[0]/name "*" string (modified)
  743. Logging/loggers[0]/severity "WARN" string (modified)
  744. Logging/loggers[0]/debuglevel 0 integer (default)
  745. Logging/loggers[0]/additive false boolean (default)
  746. Logging/loggers[0]/output_options [] list (default)
  747. Of course, we need to specify where we want the log messages to go, so we
  748. add an entry for an output option.
  749. > config add Logging/loggers[0]/output_options
  750. > config show Logging/loggers[0]/output_options
  751. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  752. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  753. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  754. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  755. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  756. These aren't the values we are looking for.
  757. > config set Logging/loggers[0]/output_options[0]/destination file
  758. > config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log
  759. > config set Logging/loggers[0]/output_options[0]/maxsize 30000
  760. > config set Logging/loggers[0]/output_options[0]/maxver 8
  761. Which would make the entire configuration for this logger look like:
  762. > config show all Logging/loggers
  763. Logging/loggers[0]/name "*" string (modified)
  764. Logging/loggers[0]/severity "WARN" string (modified)
  765. Logging/loggers[0]/debuglevel 0 integer (default)
  766. Logging/loggers[0]/additive false boolean (default)
  767. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  768. Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified)
  769. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  770. Logging/loggers[0]/output_options[0]/maxsize 30000 integer (modified)
  771. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  772. That looks OK, so let's commit it before we add the configuration for the
  773. authoritative server's logger.
  774. > config commit
  775. Now that we have set it, and checked each value along the way, adding a
  776. second entry is quite similar.
  777. > config add Logging/loggers
  778. > config set Logging/loggers[1]/name Auth
  779. > config set Logging/loggers[1]/severity DEBUG
  780. > config set Logging/loggers[1]/debuglevel 40
  781. > config add Logging/loggers[1]/output_options
  782. > config set Logging/loggers[1]/output_options[0]/destination file
  783. > config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log
  784. > config commit
  785. And that's it. Once we have found whatever it was we needed the debug
  786. messages for, we can simply remove the second logger to let the
  787. authoritative server use the same settings as the rest.
  788. > config remove Logging/loggers[1]
  789. > config commit
  790. And every module will now be using the values from the logger named "*".
  791. Logging Message Format
  792. Each message written by BIND 10 to the configured logging destinations
  793. comprises a number of components that identify the origin of the message
  794. and, if the message indicates a problem, information about the problem
  795. that may be useful in fixing it.
  796. Consider the message below logged to a file:
  797. 2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
  798. ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)
  799. Note: the layout of messages written to the system logging file (syslog)
  800. may be slightly different. This message has been split across two lines
  801. here for display reasons; in the logging file, it will appear on one
  802. line.)
  803. The log message comprises a number of components:
  804. 2011-06-15 13:48:22.034
  805. The date and time at which the message was generated.
  806. ERROR
  807. The severity of the message.
  808. [b10-resolver.asiolink]
  809. The source of the message. This comprises two components: the BIND
  810. 10 process generating the message (in this case, b10-resolver) and
  811. the module within the program from which the message originated
  812. (which in the example is the asynchronous I/O link module,
  813. asiolink).
  814. ASIODNS_OPENSOCK
  815. The message identification. Every message in BIND 10 has a unique
  816. identification, which can be used as an index into the BIND 10
  817. Messages Manual (http://bind10.isc.org/docs/bind10-messages.html)
  818. from which more information can be obtained.
  819. error 111 opening TCP socket to 127.0.0.1(53)
  820. A brief description of the cause of the problem. Within this text,
  821. information relating to the condition that caused the message to
  822. be logged will be included. In this example, error number 111 (an
  823. operating system-specific error number) was encountered when
  824. trying to open a TCP connection to port 53 on the local system
  825. (address 127.0.0.1). The next step would be to find out the reason
  826. for the failure by consulting your system's documentation to
  827. identify what error number 111 means.