bind10-guide.xml 36 KB

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