bind10-guide.xml 37 KB

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