bind10-guide.xml 39 KB

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