bind10-guide.xml 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2014;" >
  5. <!ENTITY % version SYSTEM "version.ent">
  6. %version;
  7. ]>
  8. <book>
  9. <?xml-stylesheet href="bind10-guide.css" type="text/css"?>
  10. <bookinfo>
  11. <title>BIND 10 Guide</title>
  12. <subtitle>Administrator Reference for BIND 10</subtitle>
  13. <copyright>
  14. <year>2010</year><holder>Internet Systems Consortium, Inc.</holder>
  15. </copyright>
  16. <abstract>
  17. <para>BIND 10 is a Domain Name System (DNS) suite managed by
  18. Internet Systems Consortium (ISC). It includes DNS libraries
  19. and modular components for controlling authoritative and
  20. recursive DNS servers.
  21. </para>
  22. <para>
  23. This is the reference guide for BIND 10 version &__VERSION__;.
  24. The most up-to-date version of this document, along with
  25. other documents for BIND 10, can be found at <ulink
  26. url="http://bind10.isc.org/docs"/>. </para> </abstract>
  27. <releaseinfo>This is the reference guide for BIND 10 version
  28. &__VERSION__;.</releaseinfo>
  29. </bookinfo>
  30. <chapter id="intro">
  31. <title>Introduction</title>
  32. <para>
  33. BIND is the popular implementation of a DNS server, developer
  34. interfaces, and DNS tools.
  35. BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++ and Python
  36. and provides a modular environment for serving and maintaining DNS.
  37. </para>
  38. <note>
  39. <para>
  40. This guide covers the experimental prototype of
  41. BIND 10 version &__VERSION__;.
  42. </para>
  43. </note>
  44. <note>
  45. <para>
  46. BIND 10 provides a EDNS0- and DNSSEC-capable
  47. authoritative DNS server and a forwarding DNS server.
  48. </para>
  49. </note>
  50. <section>
  51. <title>Supported Platforms</title>
  52. <para>
  53. BIND 10 builds have been tested on Debian GNU/Linux 5,
  54. Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7 and 8, and CentOS
  55. Linux 5.3.
  56. It has been tested on Sparc, i386, and amd64 hardware
  57. platforms.
  58. It is planned for BIND 10 to build, install and run on
  59. Windows and standard Unix-type platforms.
  60. </para>
  61. </section>
  62. <section>
  63. <title>Required Software</title>
  64. <para>
  65. BIND 10 requires Python 3.1. Later versions may work, but Python
  66. 3.1 is the minimum version which will work.
  67. </para>
  68. <note><para>
  69. For this development prototype release, the only supported
  70. data source backend is SQLite3. The authoritative server
  71. requires SQLite 3.3.9 or newer.
  72. The <command>b10-xfrin</command>, <command>b10-xfrout</command>,
  73. and <command>b10-zonemgr</command> modules require the
  74. libpython3 library and the Python _sqlite3.so module.
  75. </para></note>
  76. <!-- TODO: this will change ... -->
  77. <!-- TODO: list where to get these from -->
  78. <note>
  79. <para>
  80. Some operating systems do not provide these dependencies
  81. in their default installation nor standard packages
  82. collections.
  83. You may need to install them separately.
  84. </para>
  85. </note>
  86. </section>
  87. <section id="starting_stopping">
  88. <title>Starting and Stopping the Server</title>
  89. <para>
  90. BIND 10 is modular. Part of this modularity is
  91. accomplished using multiple cooperating processes which, together,
  92. provide the server functionality. This is a change from
  93. the previous generation of BIND software, which used a
  94. single process.
  95. </para>
  96. <para>
  97. At first, running many different processes may seem confusing.
  98. However, these processes are started, stopped, and maintained
  99. by a single command, <command>bind10</command>.
  100. This command starts a master process which will start other
  101. processes as needed.
  102. The processes started by the <command>bind10</command>
  103. command have names starting with "b10-", including:
  104. </para>
  105. <para>
  106. <itemizedlist>
  107. <listitem>
  108. <simpara>
  109. <command>b10-msgq</command> &mdash;
  110. Message bus daemon.
  111. This process coordinates communication between all of the other
  112. BIND 10 processes.
  113. </simpara>
  114. </listitem>
  115. <listitem>
  116. <simpara>
  117. <command>b10-auth</command> &mdash;
  118. Authoritative DNS server.
  119. This process serves DNS requests.
  120. </simpara>
  121. </listitem>
  122. <listitem>
  123. <simpara>
  124. <command>b10-cfgmgr</command> &mdash;
  125. Configuration manager.
  126. This process maintains all of the configuration for BIND 10.
  127. </simpara>
  128. </listitem>
  129. <listitem>
  130. <simpara>
  131. <command>b10-cmdctl</command> &mdash;
  132. Command and control service.
  133. This process allows external control of the BIND 10 system.
  134. </simpara>
  135. </listitem>
  136. <listitem>
  137. <simpara>
  138. <command>b10-resolver</command> &mdash;
  139. Recursive name server.
  140. This process handles incoming queries.
  141. <!-- TODO: -->
  142. </simpara>
  143. </listitem>
  144. <listitem>
  145. <simpara>
  146. <command>b10-stats</command> &mdash;
  147. Statistics collection daemon.
  148. This process collects and reports statistics data.
  149. </simpara>
  150. </listitem>
  151. <listitem>
  152. <simpara>
  153. <command>b10-xfrin</command> &mdash;
  154. Incoming zone transfer service.
  155. This process is used to transfer a new copy
  156. of a zone into BIND 10, when acting as a secondary server.
  157. </simpara>
  158. </listitem>
  159. <listitem>
  160. <simpara>
  161. <command>b10-xfrout</command> &mdash;
  162. Outgoing zone transfer service.
  163. This process is used to handle transfer requests to
  164. send a local zone to a remote secondary server,
  165. when acting as a master server.
  166. </simpara>
  167. </listitem>
  168. <listitem>
  169. <simpara>
  170. <command>b10-zonemgr</command> &mdash;
  171. Secondary manager.
  172. This process keeps track of timers and other
  173. necessary information for BIND 10 to act as a slave server.
  174. </simpara>
  175. </listitem>
  176. </itemizedlist>
  177. </para>
  178. <para>
  179. These are ran automatically by <command>bind10</command>
  180. and do not need to be run manually.
  181. </para>
  182. </section>
  183. <section id="managing_once_running">
  184. <title>Managing BIND 10</title>
  185. <para>
  186. Once BIND 10 is running, a few commands are used to interact
  187. directly with the system:
  188. <itemizedlist>
  189. <listitem>
  190. <simpara>
  191. <command>bindctl</command> &mdash;
  192. interactive administration interface.
  193. This is a command-line tool which allows an administrator
  194. to control BIND 10.
  195. </simpara>
  196. </listitem>
  197. <listitem>
  198. <simpara>
  199. <command>b10-loadzone</command> &mdash;
  200. zone file loader.
  201. This tool will load standard masterfile-format zone files into
  202. BIND 10.
  203. </simpara>
  204. </listitem>
  205. <listitem>
  206. <simpara>
  207. <command>b10-cmdctl-usermgr</command> &mdash;
  208. user access control.
  209. This tool allows an administrator to authorize additional users
  210. to manage BIND 10.
  211. </simpara>
  212. </listitem>
  213. <!-- TODO usermgr -->
  214. </itemizedlist>
  215. </para>
  216. </section>
  217. <para>
  218. The tools and modules are covered in full detail in this guide.
  219. <!-- TODO point to these -->
  220. In addition, manual pages are also provided in the default installation.
  221. </para>
  222. <!--
  223. bin/
  224. bindctl*
  225. host*
  226. lib/
  227. libauth
  228. libdns
  229. libexceptions
  230. python3.1/site-packages/isc/{cc,config}
  231. sbin/
  232. bind10
  233. share/
  234. share/bind10/
  235. auth.spec
  236. b10-cmdctl.pem
  237. bob.spec
  238. passwd.csv
  239. man/
  240. var/
  241. bind10/b10-config.db
  242. -->
  243. <para>
  244. BIND 10 also provides libraries and programmer interfaces
  245. for C++ and Python for the message bus, configuration backend,
  246. and, of course, DNS. These include detailed developer
  247. documentation and code examples.
  248. <!-- TODO point to this -->
  249. </para>
  250. </chapter>
  251. <chapter id="installation">
  252. <title>Installation</title>
  253. <section>
  254. <title>Building Requirements</title>
  255. <note>
  256. <simpara>
  257. Some operating systems have split their distribution packages into
  258. a run-time and a development package. You will need to install
  259. the development package versions, which include header files and
  260. libraries, to build BIND 10 from source code.
  261. </simpara>
  262. </note>
  263. <para>
  264. Building from source code requires the Boost
  265. build-time headers. At least Boost version 1.35 is required.
  266. <!-- TODO: we don't check for this version -->
  267. <!-- NOTE: jreed has tested with 1.34, 1.38, and 1.41. -->
  268. </para>
  269. <para>
  270. The Python Library and Python _sqlite3 module are required to
  271. enable the Xfrout and Xfrin support.
  272. </para>
  273. <note><simpara>
  274. The Python related libraries and modules need to be built
  275. for Python 3.1.
  276. </simpara></note>
  277. <para>
  278. Building BIND 10 also requires a C++ compiler and
  279. standard development headers, make, and pkg-config.
  280. BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
  281. 4.1.3, 4.2.1, 4.3.2, and 4.4.1.
  282. </para>
  283. </section>
  284. <section id="quickstart">
  285. <title>Quick start</title>
  286. <note>
  287. <simpara>
  288. This quickly covers the standard steps for installing
  289. and deploying BIND 10 as an authoritative name server using
  290. its defaults. For troubleshooting, full customizations and further
  291. details, see the respective chapters in the BIND 10 guide.
  292. </simpara>
  293. </note>
  294. <note>
  295. <simpara>
  296. The development prototype of the b10-auth server listens on
  297. 0.0.0.0 (all interfaces) port 5300. (This is not the standard
  298. domain service port.)
  299. </simpara>
  300. </note>
  301. <para>
  302. To quickly get started with BIND 10, follow these steps.
  303. </para>
  304. <orderedlist>
  305. <listitem>
  306. <simpara>
  307. Install required build dependencies.
  308. </simpara>
  309. </listitem>
  310. <listitem>
  311. <simpara>
  312. Download the BIND 10 source tar file from
  313. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  314. </simpara>
  315. </listitem>
  316. <listitem>
  317. <para>Extract the tar file:
  318. <screen>$ <userinput>gzcat bind10-<replaceable>VERSION</replaceable>.tar.gz | tar -xvf -</userinput></screen>
  319. </para>
  320. </listitem>
  321. <listitem>
  322. <para>Go into the source and run configure:
  323. <screen>$ <userinput>cd bind10-<replaceable>VERSION</replaceable></userinput>
  324. $ <userinput>./configure</userinput></screen>
  325. </para>
  326. </listitem>
  327. <listitem>
  328. <para>Build it:
  329. <screen>$ <userinput>make</userinput></screen>
  330. </para>
  331. </listitem>
  332. <listitem>
  333. <para>Install it (to default /usr/local):
  334. <screen>$ <userinput>make install</userinput></screen>
  335. </para>
  336. </listitem>
  337. <listitem>
  338. <para>Start the server:
  339. <screen>$ <userinput>/usr/local/sbin/bind10</userinput></screen>
  340. </para>
  341. </listitem>
  342. <listitem>
  343. <para>Test it; for example:
  344. <screen>$ <userinput>dig @127.0.0.1 -p 5300 -c CH -t TXT authors.bind</userinput></screen>
  345. </para>
  346. </listitem>
  347. <listitem>
  348. <para>Load desired zone file(s), for example:
  349. <screen>$ <userinput>b10-loadzone <replaceable>your.zone.example.org</replaceable></userinput></screen>
  350. </para>
  351. </listitem>
  352. <listitem>
  353. <simpara>
  354. Test the new zone.
  355. </simpara>
  356. </listitem>
  357. </orderedlist>
  358. </section>
  359. <section id="install">
  360. <title>Installation from source</title>
  361. <para>
  362. BIND 10 is open source software written in C++ and Python.
  363. It is freely available in source code form from ISC via
  364. the Git code revision control system or as a downloadable
  365. tar file. It may also be available in pre-compiled ready-to-use
  366. packages from operating system vendors.
  367. </para>
  368. <section>
  369. <title>Download Tar File</title>
  370. <para>
  371. Downloading a release tar file is the recommended method to
  372. obtain the source code.
  373. </para>
  374. <para>
  375. The BIND 10 releases are available as tar file downloads from
  376. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  377. Periodic development snapshots may also be available.
  378. </para>
  379. <!-- TODO -->
  380. </section>
  381. <section>
  382. <title>Retrieve from Git</title>
  383. <para>
  384. Downloading this "bleeding edge" code is recommended only for
  385. developers or advanced users. Using development code in a production
  386. environment is not recommended.
  387. </para>
  388. <note>
  389. <para>
  390. When using source code retrieved via Git additional
  391. software will be required: automake (v1.11 or newer),
  392. libtoolize, and autoconf (2.59 or newer).
  393. These may need to be installed.
  394. </para>
  395. </note>
  396. <para>
  397. The latest development code, including temporary experiments
  398. and un-reviewed code, is available via the BIND 10 code revision
  399. control system. This is powered by Git and all the BIND 10
  400. development is public.
  401. The leading development is done in the <quote>master</quote>.
  402. </para>
  403. <para>
  404. The code can be checked out from
  405. <filename>git://bind10.isc.org/bind10</filename>;
  406. for example:
  407. <screen>$ <userinput>git clone git://bind10.isc.org/bind10</userinput></screen>
  408. </para>
  409. <para>
  410. When checking out the code from
  411. the code version control system, it doesn't include the
  412. generated configure script, Makefile.in files, nor the
  413. related configure files.
  414. They can be created by running <command>autoreconf</command>
  415. with the <option>--install</option> switch.
  416. This will run <command>autoconf</command>,
  417. <command>aclocal</command>,
  418. <command>libtoolize</command>,
  419. <command>autoheader</command>,
  420. <command>automake</command>,
  421. and related commands.
  422. </para>
  423. </section>
  424. <section>
  425. <title>Configure before the build</title>
  426. <para>
  427. BIND 10 uses the GNU Build System to discover build environment
  428. details.
  429. To generate the makefiles using the defaults, simply run:
  430. <screen>$ <userinput>./configure</userinput></screen>
  431. </para>
  432. <para>
  433. Run <command>./configure</command> with the <option>--help</option>
  434. switch to view the different options. The commonly-used options are:
  435. <variablelist>
  436. <varlistentry>
  437. <term>--prefix</term>
  438. <listitem>
  439. <simpara>Define the the installation location (the
  440. default is <filename>/usr/local/</filename>).
  441. </simpara>
  442. </listitem>
  443. </varlistentry>
  444. <varlistentry>
  445. <term>--with-boost-include</term>
  446. <listitem>
  447. <simpara>Define the path to find the Boost headers.
  448. </simpara>
  449. </listitem>
  450. </varlistentry>
  451. <varlistentry>
  452. <term>--with-pythonpath</term>
  453. <listitem>
  454. <simpara>Define the path to Python 3.1 if it is not in the
  455. standard execution path.
  456. </simpara>
  457. </listitem>
  458. </varlistentry>
  459. <varlistentry>
  460. <term>--with-gtest</term>
  461. <listitem>
  462. <simpara>Enable building the C++ Unit Tests using the
  463. Google Tests framework. Optionally this can define the
  464. path to the gtest header files and library.
  465. </simpara>
  466. </listitem>
  467. </varlistentry>
  468. </variablelist>
  469. </para>
  470. <!-- TODO: lcov -->
  471. <para>
  472. For example, the following configures it to
  473. find the Boost headers, find the
  474. Python interpreter, and sets the installation location:
  475. <screen>$ <userinput>./configure \
  476. --with-boost-include=/usr/pkg/include \
  477. --with-pythonpath=/usr/pkg/bin/python3.1 \
  478. --prefix=/opt/bind10</userinput></screen>
  479. </para>
  480. <para>
  481. If the configure fails, it may be due to missing or old
  482. dependencies.
  483. </para>
  484. </section>
  485. <section>
  486. <title>Build</title>
  487. <para>
  488. After the configure step is complete, to build the executables
  489. from the C++ code and prepare the Python scripts, run:
  490. <screen>$ <userinput>make</userinput></screen>
  491. </para>
  492. </section>
  493. <section>
  494. <title>Install</title>
  495. <para>
  496. To install the BIND 10 executables, support files,
  497. and documentation, run:
  498. <screen>$ <userinput>make install</userinput></screen>
  499. </para>
  500. <note>
  501. <para>The install step may require superuser privileges.</para>
  502. </note>
  503. </section>
  504. <!-- TODO: tests -->
  505. <section>
  506. <title>Install Hierarchy</title>
  507. <para>
  508. The following is the layout of the complete BIND 10 installation:
  509. <itemizedlist>
  510. <listitem>
  511. <simpara>
  512. <filename>bin/</filename> &mdash;
  513. general tools and diagnostic clients.
  514. </simpara>
  515. </listitem>
  516. <listitem>
  517. <simpara>
  518. <filename>etc/bind10-devel/</filename> &mdash;
  519. configuration files.
  520. </simpara>
  521. </listitem>
  522. <listitem>
  523. <simpara>
  524. <filename>lib/</filename> &mdash;
  525. libraries and python modules.
  526. </simpara>
  527. </listitem>
  528. <listitem>
  529. <simpara>
  530. <filename>libexec/bind10-devel/</filename> &mdash;
  531. executables that a user wouldn't normally run directly and
  532. are not run independently.
  533. These are the BIND 10 modules which are daemons started by
  534. the <command>bind10</command> tool.
  535. </simpara>
  536. </listitem>
  537. <listitem>
  538. <simpara>
  539. <filename>sbin/</filename> &mdash;
  540. commands used by the system administrator.
  541. </simpara>
  542. </listitem>
  543. <listitem>
  544. <simpara>
  545. <filename>share/bind10-devel/</filename> &mdash;
  546. configuration specifications.
  547. </simpara>
  548. </listitem>
  549. <listitem>
  550. <simpara>
  551. <filename>share/man/</filename> &mdash;
  552. manual pages (online documentation).
  553. </simpara>
  554. </listitem>
  555. <listitem>
  556. <simpara>
  557. <filename>var/bind10-devel/</filename> &mdash;
  558. data source and configuration databases.
  559. </simpara>
  560. </listitem>
  561. </itemizedlist>
  562. </para>
  563. </section>
  564. </section>
  565. <!--
  566. <section id="install.troubleshooting">
  567. <title>Troubleshooting</title>
  568. <para>
  569. </para>
  570. </section>
  571. -->
  572. </chapter>
  573. <chapter id="bind10">
  574. <title>Starting BIND10 with <command>bind10</command></title>
  575. <para>
  576. BIND 10 provides the <command>bind10</command> command which
  577. starts up the required processes.
  578. <command>bind10</command>
  579. will also restart processes that exit unexpectedly.
  580. This is the only command needed to start the BIND 10 system.
  581. </para>
  582. <para>
  583. After starting the <command>b10-msgq</command> communications channel,
  584. <command>bind10</command> connects to it,
  585. runs the configuration manager, and reads its own configuration.
  586. Then it starts the other modules.
  587. </para>
  588. <para>
  589. The <command>b10-msgq</command> and <command>b10-cfgmgr</command>
  590. services make up the core. The <command>b10-msgq</command> daemon
  591. provides the communication channel between every part of the system.
  592. The <command>b10-cfgmgr</command> daemon is always needed by every
  593. module, if only to send information about themselves somewhere,
  594. but more importantly to ask about their own settings, and
  595. about other modules.
  596. The <command>bind10</command> master process will also start up
  597. <command>b10-cmdctl</command> for admins to communicate with the
  598. system, <command>b10-auth</command> for authoritative DNS service or
  599. <command>b10-resolver</command> for recursive name service,
  600. <command>b10-stats</command> for statistics collection,
  601. <command>b10-xfrin</command> for inbound DNS zone transfers,
  602. <command>b10-xfrout</command> for outbound DNS zone transfers,
  603. and <command>b10-zonemgr</command> for secondary service.
  604. </para>
  605. <section id="start">
  606. <title>Starting BIND 10</title>
  607. <para>
  608. To start the BIND 10 service, simply run <command>bind10</command>.
  609. Run it with the <option>--verbose</option> switch to
  610. get additional debugging or diagnostic output.
  611. </para>
  612. <!-- TODO: note it doesn't go into background -->
  613. </section>
  614. </chapter>
  615. <chapter id="msgq">
  616. <title>Command channel</title>
  617. <para>
  618. The BIND 10 components use the <command>b10-msgq</command>
  619. message routing daemon to communicate with other BIND 10 components.
  620. The <command>b10-msgq</command> implements what is called the
  621. <quote>Command Channel</quote>.
  622. Processes intercommunicate by sending messages on the command
  623. channel.
  624. Example messages include shutdown, get configurations, and set
  625. configurations.
  626. This Command Channel is not used for DNS message passing.
  627. It is used only to control and monitor the BIND 10 system.
  628. </para>
  629. <para>
  630. Administrators do not communicate directly with the
  631. <command>b10-msgq</command> daemon.
  632. By default, BIND 10 uses port 9912 for the
  633. <command>b10-msgq</command> service.
  634. It listens on 127.0.0.1.
  635. </para>
  636. <!-- TODO: this is broken, see Trac #111
  637. <para>
  638. To select an alternate port for the <command>b10-msgq</command> to
  639. use, run <command>bind10</command> specifying the option:
  640. <screen> $ <userinput>bind10 -TODO-msgq-port 9912</userinput></screen>
  641. </para>
  642. -->
  643. <!-- TODO: upcoming plans:
  644. Unix domain sockets
  645. -->
  646. </chapter>
  647. <chapter id="cfgmgr">
  648. <title>Configuration manager</title>
  649. <para>
  650. The configuration manager, <command>b10-cfgmgr</command>,
  651. handles all BIND 10 system configuration. It provides
  652. persistent storage for configuration, and notifies running
  653. modules of configuration changes.
  654. </para>
  655. <para>
  656. The <command>b10-auth</command> and <command>b10-xfrin</command>
  657. daemons and other components receive their configurations
  658. from the configuration manager over the <command>b10-msgq</command>
  659. command channel.
  660. </para>
  661. <para>The administrator doesn't connect to it directly, but
  662. uses a user interface to communicate with the configuration
  663. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  664. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  665. </para>
  666. <!-- TODO -->
  667. <note>
  668. <para>
  669. The development prototype release only provides the
  670. <command>bindctl</command> as a user interface to
  671. <command>b10-cmdctl</command>.
  672. Upcoming releases will provide another interactive command-line
  673. interface and a web-based interface.
  674. </para>
  675. </note>
  676. <para>
  677. The <command>b10-cfgmgr</command> daemon can send all
  678. specifications and all current settings to the
  679. <command>bindctl</command> client (via
  680. <command>b10-cmdctl</command>).
  681. </para>
  682. <para>
  683. <command>b10-cfgmgr</command> relays configurations received
  684. from <command>b10-cmdctl</command> to the appropriate modules.
  685. </para>
  686. <!-- TODO:
  687. Configuration settings for itself are defined as ConfigManager.
  688. TODO: show examples
  689. -->
  690. <!-- TODO:
  691. config changes are actually commands to cfgmgr
  692. -->
  693. <!-- TODO: what about run time config to change this? -->
  694. <!-- jelte: > config set cfgmgr/config_database <file> -->
  695. <!-- TODO: what about command line switch to change this? -->
  696. <para>
  697. The stored configuration file is at
  698. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  699. (The full path is what was defined at build configure time for
  700. <option>--localstatedir</option>.
  701. The default is <filename>/usr/local/var/</filename>.)
  702. The format is loosely based on JSON and is directly parseable
  703. python, but this may change in a future version.
  704. This configuration data file is not manually edited by the
  705. administrator.
  706. </para>
  707. <!--
  708. Well the specfiles have a more fixed format (they must contain specific
  709. stuff), but those are also directly parseable python structures (and
  710. 'coincidentally', our data::element string representation is the same)
  711. loosely based on json, tweaked to be directly parseable in python, but a
  712. subset of that.
  713. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  714. nope, spec files are written by module developers, and db should be done
  715. through bindctl and friends
  716. -->
  717. <para>
  718. The configuration manager does not have any command line arguments.
  719. Normally it is not started manually, but is automatically
  720. started using the <command>bind10</command> master process
  721. (as covered in <xref linkend="bind10"/>).
  722. </para>
  723. <!-- TODO: upcoming plans:
  724. configuration for configuration manager itself. And perhaps we might
  725. change the messaging protocol, but an admin should never see any of that
  726. -->
  727. <!-- TODO: show examples, test this -->
  728. <!--
  729. , so an admin can simply run bindctl,
  730. do config show, and it shows all modules; config show >module> shows all
  731. options for that module
  732. -->
  733. </chapter>
  734. <chapter id="cmdctl">
  735. <title>Remote control daemon</title>
  736. <para>
  737. <command>b10-cmdctl</command> is the gateway between
  738. administrators and the BIND 10 system.
  739. It is a HTTPS server that uses standard HTTP Digest
  740. Authentication for username and password validation.
  741. It provides a REST-ful interface for accessing and controlling
  742. BIND 10.
  743. </para>
  744. <!-- TODO: copy examples from wiki, try with wget -->
  745. <para>
  746. When <command>b10-cmdctl</command> starts, it firsts
  747. asks <command>b10-cfgmgr</command> about what modules are
  748. running and what their configuration is (over the
  749. <command>b10-msgq</command> channel). Then it will start listening
  750. on HTTPS for clients &mdash; the user interface &mdash; such
  751. as <command>bindctl</command>.
  752. </para>
  753. <para>
  754. <command>b10-cmdctl</command> directly sends commands
  755. (received from the user interface) to the specified component.
  756. Configuration changes are actually commands to
  757. <command>b10-cfgmgr</command> so are sent there.
  758. </para>
  759. <!--
  760. TODO:
  761. "For bindctl to list a module's available configurations and
  762. available commands, it communicates over the cmdctl REST interface.
  763. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  764. asks the module for its specification and also cfgmgr looks in its
  765. own configuration database for current values."
  766. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  767. GET, but rather requests it once and then listens in for updates,
  768. but you might wanna check with likun
  769. -->
  770. <!-- TODO: replace /usr/local -->
  771. <!-- TODO: permissions -->
  772. <para>The HTTPS server requires a private key,
  773. such as a RSA PRIVATE KEY.
  774. The default location is at
  775. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  776. (A sample key is at
  777. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  778. It also uses a certificate located at
  779. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  780. (A sample certificate is at
  781. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  782. This may be a self-signed certificate or purchased from a
  783. certification authority.
  784. </para>
  785. <note><para>
  786. The HTTPS server doesn't support a certificate request from a
  787. client (at this time).
  788. <!-- TODO: maybe allow request from server side -->
  789. The <command>b10-cmdctl</command> daemon does not provide a
  790. public service. If any client wants to control BIND 10, then
  791. a certificate needs to be first received from the BIND 10
  792. administrator.
  793. The BIND 10 installation provides a sample PEM bundle that matches
  794. the sample key and certificate.
  795. </para></note>
  796. <!-- TODO: cross-ref -->
  797. <!-- TODO
  798. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  799. but that is a single file, maybethis should go back to that format?
  800. -->
  801. <!--
  802. <para>
  803. (08:20:56) shane: It is in theory possible to run without cmdctl.
  804. (08:21:02) shane: I think we discussed this.
  805. </para>
  806. -->
  807. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  808. <para>
  809. The <command>b10-cmdctl</command> daemon also requires
  810. the user account file located at
  811. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  812. This comma-delimited file lists the accounts with a user name,
  813. hashed password, and salt.
  814. (A sample file is at
  815. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  816. It contains the user named <quote>root</quote> with the password
  817. <quote>bind10</quote>.)
  818. </para>
  819. <para>
  820. The administrator may create a user account with the
  821. <command>b10-cmdctl-usermgr</command> tool.
  822. </para>
  823. <!-- TODO: show example -->
  824. <!-- TODO: does cmdctl need to be restarted to change cert or key
  825. or accounts database -->
  826. <para>
  827. By default the HTTPS server listens on the localhost port 8080.
  828. The port can be set by using the <option>--port</option> command line option.
  829. The address to listen on can be set using the <option>--address</option> command
  830. line argument.
  831. Each HTTPS connection is stateless and timesout in 1200 seconds
  832. by default. This can be
  833. redefined by using the <option>--idle-timeout</option> command line argument.
  834. </para>
  835. <section id="cmdctl.spec">
  836. <title>Configuration specification for b10-cmdctl</title>
  837. <para>
  838. The configuration items for <command>b10-cmdctl</command> are:
  839. key_file
  840. cert_file
  841. accounts_file
  842. </para>
  843. <!-- TODO -->
  844. <para>
  845. The control commands are:
  846. print_settings
  847. shutdown
  848. </para>
  849. <!-- TODO -->
  850. </section>
  851. <!--
  852. TODO
  853. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  854. (12:21:33) jinmei: btw
  855. -->
  856. </chapter>
  857. <chapter id="bindctl">
  858. <title>Control and configure user interface</title>
  859. <note><para>
  860. For this development prototype release, <command>bindctl</command>
  861. is the only user interface. It is expected that upcoming
  862. releases will provide another interactive command-line
  863. interface and a web-based interface for controlling and
  864. configuring BIND 10.
  865. </para></note>
  866. <para>
  867. The <command>bindctl</command> tool provides an interactive
  868. prompt for configuring, controlling, and querying the BIND 10
  869. components.
  870. It communicates directly with a REST-ful interface over HTTPS
  871. provided by <command>b10-cmdctl</command>. It doesn't
  872. communicate to any other components directly.
  873. </para>
  874. <!-- TODO: explain and show interface -->
  875. <para>
  876. Configuration changes are actually commands to
  877. <command>b10-cfgmgr</command>. So when <command>bindctl</command>
  878. sends a configuration, it is sent to <command>b10-cmdctl</command>
  879. (over a HTTPS connection); then <command>b10-cmdctl</command>
  880. sends the command (over a <command>b10-msgq</command> command
  881. channel) to <command>b10-cfgmgr</command> which then stores
  882. the details and relays (over a <command>b10-msgq</command> command
  883. channel) the configuration on to the specified module.
  884. </para>
  885. <para>
  886. </para>
  887. </chapter>
  888. <chapter id="authserver">
  889. <title>Authoritative Server</title>
  890. <para>
  891. The <command>b10-auth</command> is the authoritative DNS server.
  892. It supports EDNS0 and DNSSEC. It supports IPv6.
  893. Normally it is started by the <command>bind10</command> master
  894. process.
  895. </para>
  896. <note><simpara>
  897. This development prototype release listens on all interfaces
  898. and the non-standard port 5300.
  899. </simpara></note>
  900. <section>
  901. <title>Server Configurations</title>
  902. <!-- TODO: offers command line options but not used
  903. since we used bind10 -->
  904. <para>
  905. <command>b10-auth</command> is configured via the
  906. <command>b10-cfgmgr</command> configuration manager.
  907. The module name is <quote>Auth</quote>.
  908. The configuration data item is:
  909. <variablelist>
  910. <varlistentry>
  911. <term>database_file</term>
  912. <listitem>
  913. <simpara>This is an optional string to define the path to find
  914. the SQLite3 database file.
  915. <!-- TODO: -->
  916. Note: Later the DNS server will use various data source backends.
  917. This may be a temporary setting until then.
  918. </simpara>
  919. </listitem>
  920. </varlistentry>
  921. </variablelist>
  922. </para>
  923. <para>
  924. The configuration command is:
  925. <variablelist>
  926. <varlistentry>
  927. <term>shutdown</term>
  928. <listitem>
  929. <simpara>Stop the authoritative DNS server.
  930. </simpara>
  931. <!-- TODO: what happens when this is sent, will bind10 restart? -->
  932. </listitem>
  933. </varlistentry>
  934. </variablelist>
  935. </para>
  936. <!-- TODO: examples of setting or running above? -->
  937. </section>
  938. <section>
  939. <title>Data Source Backends</title>
  940. <note><para>
  941. For the development prototype release, <command>b10-auth</command>
  942. only supports the SQLite3 data source backend.
  943. Upcoming versions will be able to use multiple different
  944. data sources, such as MySQL, Berkeley DB, or in-memory DB.
  945. </para></note>
  946. <para>
  947. By default, the SQLite3 backend uses the data file located at
  948. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  949. (The full path is what was defined at build configure time for
  950. <option>--localstatedir</option>.
  951. The default is <filename>/usr/local/var/</filename>.)
  952. This data file location may be changed by defining the
  953. <quote>database_file</quote> configuration.
  954. </para>
  955. </section>
  956. <section>
  957. <title>Loading Master Zones Files</title>
  958. <para>
  959. RFC 1035 style DNS master zone files may imported
  960. into a BIND 10 data source by using the
  961. <command>b10-loadzone</command> utility.
  962. </para>
  963. <para>
  964. <command>b10-loadzone</command> supports the following
  965. special directives (control entries):
  966. <variablelist>
  967. <varlistentry>
  968. <term>$INCLUDE</term>
  969. <listitem>
  970. <simpara>Loads an additional zone file. This may be recursive.
  971. </simpara>
  972. </listitem>
  973. </varlistentry>
  974. <varlistentry>
  975. <term>$ORIGIN</term>
  976. <listitem>
  977. <simpara>Defines the relative domain name.
  978. </simpara>
  979. </listitem>
  980. </varlistentry>
  981. <varlistentry>
  982. <term>$TTL</term>
  983. <listitem>
  984. <simpara>Defines the time-to-live value used for following
  985. records that don't include a TTL.
  986. </simpara>
  987. </listitem>
  988. </varlistentry>
  989. </variablelist>
  990. </para>
  991. <para>
  992. The <option>-o</option> argument may be used to define the
  993. default origin for loaded zone file records.
  994. </para>
  995. <note>
  996. <para>
  997. In the development prototype release, only the SQLite3 back
  998. end is used.
  999. By default, it stores the zone data in
  1000. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  1001. unless the <option>-d</option> switch is used to set the
  1002. database filename.
  1003. Multiple zones are stored in a single SQLite3 zone database.
  1004. </para>
  1005. </note>
  1006. <para>
  1007. If you reload a zone already existing in the database,
  1008. all records from that prior zone disappear and a whole new set
  1009. appears.
  1010. </para>
  1011. <!--TODO: permissions for xfrin or loadzone to create the file -->
  1012. </section>
  1013. <!--
  1014. TODO
  1015. <section>
  1016. <title>Troubleshooting</title>
  1017. <para>
  1018. </para>
  1019. </section>
  1020. -->
  1021. </chapter>
  1022. <chapter id="xfrin">
  1023. <title>Incoming Zone Transfers</title>
  1024. <para>
  1025. The <command>b10-xfrin</command> process is started by
  1026. <command>bind10</command>.
  1027. It can be manually triggered to request an AXFR zone
  1028. transfer. When received, it is stored in the BIND 10
  1029. data store, and its records can be served by
  1030. <command>b10-auth</command>.
  1031. In combination with <command>b10-zonemgr</command> (for
  1032. automated SOA checks), this allows the BIND 10 server to
  1033. provide <quote>secondary</quote> service.
  1034. </para>
  1035. <note><simpara>
  1036. The current development release of BIND 10 only supports
  1037. AXFR. (IXFR is not supported.)
  1038. </simpara></note>
  1039. <para>
  1040. To manually trigger a zone transfer to retrieve a remote zone,
  1041. you may use the <command>bindctl</command> utility.
  1042. For example, at the <command>bindctl</command> prompt run:
  1043. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  1044. </para>
  1045. </chapter>
  1046. <chapter id="xfrout">
  1047. <title>Outbound Zone Transfers</title>
  1048. <para>
  1049. The <command>b10-xfrout</command> process is started by
  1050. <command>bind10</command>.
  1051. When the <command>b10-auth</command> authoritative DNS server
  1052. receives an AXFR request, <command>b10-xfrout</command>
  1053. sends the zone.
  1054. This is used to provide master DNS service to share zones
  1055. to secondary name servers.
  1056. The <command>b10-xfrout</command> is also used to send
  1057. NOTIFY messages to slaves.
  1058. </para>
  1059. <note><simpara>
  1060. The current development release of BIND 10 only supports
  1061. AXFR. (IXFR is not supported.)
  1062. Access control is not yet provided.
  1063. </simpara></note>
  1064. <!--
  1065. TODO:
  1066. xfrout section:
  1067. auth servers checks for AXFR query
  1068. sends the XFR query to the xfrout module
  1069. uses /tmp/auth_xfrout_conn which is a socket
  1070. what is XfroutClient xfr_client??
  1071. /tmp/auth_xfrout_conn is not removed
  1072. -->
  1073. </chapter>
  1074. <chapter id="zonemgr">
  1075. <title>Secondary Manager</title>
  1076. <para>
  1077. The <command>b10-zonemgr</command> process is started by
  1078. <command>bind10</command>.
  1079. It keeps track of SOA refresh, retry, and expire timers
  1080. and other details for BIND 10 to perform as a slave.
  1081. When the <command>b10-auth</command> authoritative DNS server
  1082. receives a NOTIFY message, <command>b10-zonemgr</command>
  1083. may tell <command>b10-xfrin</command> to do a refresh
  1084. to start an inbound zone transfer.
  1085. The secondary manager resets its counters when a new zone is
  1086. transferred in.
  1087. </para>
  1088. <note><simpara>
  1089. Access control (such as allowing notifies) is not yet provided.
  1090. The primary/secondary service is not yet complete.
  1091. </simpara></note>
  1092. <!-- TODO: lots to describe for zonemgr -->
  1093. </chapter>
  1094. <chapter id="resolverserver">
  1095. <title>Recursive Name Server</title>
  1096. <para>
  1097. The <command>b10-resolver</command> process is started by
  1098. <command>bind10</command>.
  1099. <!-- TODO
  1100. It provides a resolver so DNS clients can ask it to do recursion
  1101. and it will return answers.
  1102. -->
  1103. </para>
  1104. <note><simpara>
  1105. The current version only provides a forwarding DNS server.
  1106. It does not cache and does not iterate to find answers.
  1107. It simply forwards the query on to another full resolver.
  1108. </simpara></note>
  1109. <para>
  1110. The main <command>bind10</command> process can be configured
  1111. to select to run either the authoritative or resolver.
  1112. By default, it starts the authoritative service.
  1113. <!-- TODO: later both -->
  1114. You may change this using <command>bindctl</command>, for example:
  1115. <screen>
  1116. &gt; <userinput>config set Boss/start_auth false</userinput>
  1117. &gt; <userinput>config set Boss/start_resolver true</userinput>
  1118. &gt; <userinput>config commit</userinput>
  1119. </screen>
  1120. </para>
  1121. <!-- TODO: -->
  1122. <note><simpara>
  1123. In the current version, the master <command>bind10</command>
  1124. process must be stopped and restarted to start up the resolver.
  1125. </simpara></note>
  1126. <para>
  1127. Then the upstream address and port must be configured to
  1128. forward queries to, such as:
  1129. <screen>
  1130. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  1131. &gt; <userinput>config commit</userinput>
  1132. </screen>
  1133. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  1134. full resolver.)
  1135. </para>
  1136. <para>
  1137. The resolver also needs to be configured to listen on an address
  1138. and port:
  1139. <screen>
  1140. &gt; <userinput>config set Resolver/listen_on [{ "address": "127.0.0.1", "port": 53 }]</userinput>
  1141. &gt; <userinput>config commit</userinput>
  1142. </screen>
  1143. </para>
  1144. <!-- TODO: later the above will have some defaults -->
  1145. <!-- TODO: later try this
  1146. > config set Resolver/forward_addresses[0]/address "192.168.8.8"
  1147. > config set Resolver/forward_addresses[0]/port 53
  1148. then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1149. > config set Resolver/forward_addresses[0]/address "1.2.3.4"
  1150. -->
  1151. </chapter>
  1152. <chapter id="statistics">
  1153. <title>Statistics</title>
  1154. <para>
  1155. The <command>b10-stats</command> process is started by
  1156. <command>bind10</command>.
  1157. It periodically collects statistics data from various modules
  1158. and aggregates it.
  1159. <!-- TODO -->
  1160. </para>
  1161. <para>
  1162. This stats daemon provides commands to identify if it is running,
  1163. show specified or all statistics data, set values, remove data,
  1164. and reset data.
  1165. For example, using <command>bindctl</command>:
  1166. <screen>
  1167. &gt; <userinput>Stats show</userinput>
  1168. {
  1169. "auth.queries.tcp": 1749,
  1170. "auth.queries.udp": 867868,
  1171. "bind10.boot_time": "2011-01-20T16:59:03Z",
  1172. "report_time": "2011-01-20T17:04:06Z",
  1173. "stats.boot_time": "2011-01-20T16:59:05Z",
  1174. "stats.last_update_time": "2011-01-20T17:04:05Z",
  1175. "stats.lname": "4d3869d9_a@jreed.example.net",
  1176. "stats.start_time": "2011-01-20T16:59:05Z",
  1177. "stats.timestamp": 1295543046.823504
  1178. }
  1179. </screen>
  1180. </para>
  1181. </chapter>
  1182. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  1183. <!-- <index> <title>Index</title> </index> -->
  1184. </book>
  1185. <!--
  1186. TODO:
  1187. Overview
  1188. Getting BIND 10 Installed
  1189. Basics
  1190. Dependencies
  1191. Optional
  1192. Advanced
  1193. How Does Everything Work Together?
  1194. Need Help?
  1195. -->