bind10-guide.xml 44 KB

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