userguide.xml 36 KB

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