userguide.xml 36 KB

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