userguide.xml 34 KB

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