bind10-guide.xml 40 KB

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