bind10-guide.xml 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446
  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. <para>
  294. To quickly get started with BIND 10, follow these steps.
  295. </para>
  296. <orderedlist>
  297. <listitem>
  298. <simpara>
  299. Install required build dependencies.
  300. </simpara>
  301. </listitem>
  302. <listitem>
  303. <simpara>
  304. Download the BIND 10 source tar file from
  305. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  306. </simpara>
  307. </listitem>
  308. <listitem>
  309. <para>Extract the tar file:
  310. <screen>$ <userinput>gzcat bind10-<replaceable>VERSION</replaceable>.tar.gz | tar -xvf -</userinput></screen>
  311. </para>
  312. </listitem>
  313. <listitem>
  314. <para>Go into the source and run configure:
  315. <screen>$ <userinput>cd bind10-<replaceable>VERSION</replaceable></userinput>
  316. $ <userinput>./configure</userinput></screen>
  317. </para>
  318. </listitem>
  319. <listitem>
  320. <para>Build it:
  321. <screen>$ <userinput>make</userinput></screen>
  322. </para>
  323. </listitem>
  324. <listitem>
  325. <para>Install it (to default /usr/local):
  326. <screen>$ <userinput>make install</userinput></screen>
  327. </para>
  328. </listitem>
  329. <listitem>
  330. <para>Start the server:
  331. <screen>$ <userinput>/usr/local/sbin/bind10</userinput></screen>
  332. </para>
  333. </listitem>
  334. <listitem>
  335. <para>Test it; for example:
  336. <screen>$ <userinput>dig @127.0.0.1 -c CH -t TXT authors.bind</userinput></screen>
  337. </para>
  338. </listitem>
  339. <listitem>
  340. <para>Load desired zone file(s), for example:
  341. <screen>$ <userinput>b10-loadzone <replaceable>your.zone.example.org</replaceable></userinput></screen>
  342. </para>
  343. </listitem>
  344. <listitem>
  345. <simpara>
  346. Test the new zone.
  347. </simpara>
  348. </listitem>
  349. </orderedlist>
  350. </section>
  351. <section id="install">
  352. <title>Installation from source</title>
  353. <para>
  354. BIND 10 is open source software written in C++ and Python.
  355. It is freely available in source code form from ISC via
  356. the Git code revision control system or as a downloadable
  357. tar file. It may also be available in pre-compiled ready-to-use
  358. packages from operating system vendors.
  359. </para>
  360. <section>
  361. <title>Download Tar File</title>
  362. <para>
  363. Downloading a release tar file is the recommended method to
  364. obtain the source code.
  365. </para>
  366. <para>
  367. The BIND 10 releases are available as tar file downloads from
  368. <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  369. Periodic development snapshots may also be available.
  370. </para>
  371. <!-- TODO -->
  372. </section>
  373. <section>
  374. <title>Retrieve from Git</title>
  375. <para>
  376. Downloading this "bleeding edge" code is recommended only for
  377. developers or advanced users. Using development code in a production
  378. environment is not recommended.
  379. </para>
  380. <note>
  381. <para>
  382. When using source code retrieved via Git additional
  383. software will be required: automake (v1.11 or newer),
  384. libtoolize, and autoconf (2.59 or newer).
  385. These may need to be installed.
  386. </para>
  387. </note>
  388. <para>
  389. The latest development code, including temporary experiments
  390. and un-reviewed code, is available via the BIND 10 code revision
  391. control system. This is powered by Git and all the BIND 10
  392. development is public.
  393. The leading development is done in the <quote>master</quote>.
  394. </para>
  395. <para>
  396. The code can be checked out from
  397. <filename>git://bind10.isc.org/bind10</filename>;
  398. for example:
  399. <screen>$ <userinput>git clone git://bind10.isc.org/bind10</userinput></screen>
  400. </para>
  401. <para>
  402. When checking out the code from
  403. the code version control system, it doesn't include the
  404. generated configure script, Makefile.in files, nor the
  405. related configure files.
  406. They can be created by running <command>autoreconf</command>
  407. with the <option>--install</option> switch.
  408. This will run <command>autoconf</command>,
  409. <command>aclocal</command>,
  410. <command>libtoolize</command>,
  411. <command>autoheader</command>,
  412. <command>automake</command>,
  413. and related commands.
  414. </para>
  415. </section>
  416. <section>
  417. <title>Configure before the build</title>
  418. <para>
  419. BIND 10 uses the GNU Build System to discover build environment
  420. details.
  421. To generate the makefiles using the defaults, simply run:
  422. <screen>$ <userinput>./configure</userinput></screen>
  423. </para>
  424. <para>
  425. Run <command>./configure</command> with the <option>--help</option>
  426. switch to view the different options. The commonly-used options are:
  427. <variablelist>
  428. <varlistentry>
  429. <term>--prefix</term>
  430. <listitem>
  431. <simpara>Define the the installation location (the
  432. default is <filename>/usr/local/</filename>).
  433. </simpara>
  434. </listitem>
  435. </varlistentry>
  436. <varlistentry>
  437. <term>--with-boost-include</term>
  438. <listitem>
  439. <simpara>Define the path to find the Boost headers.
  440. </simpara>
  441. </listitem>
  442. </varlistentry>
  443. <varlistentry>
  444. <term>--with-pythonpath</term>
  445. <listitem>
  446. <simpara>Define the path to Python 3.1 if it is not in the
  447. standard execution path.
  448. </simpara>
  449. </listitem>
  450. </varlistentry>
  451. <varlistentry>
  452. <term>--with-gtest</term>
  453. <listitem>
  454. <simpara>Enable building the C++ Unit Tests using the
  455. Google Tests framework. Optionally this can define the
  456. path to the gtest header files and library.
  457. </simpara>
  458. </listitem>
  459. </varlistentry>
  460. </variablelist>
  461. </para>
  462. <!-- TODO: lcov -->
  463. <para>
  464. For example, the following configures it to
  465. find the Boost headers, find the
  466. Python interpreter, and sets the installation location:
  467. <screen>$ <userinput>./configure \
  468. --with-boost-include=/usr/pkg/include \
  469. --with-pythonpath=/usr/pkg/bin/python3.1 \
  470. --prefix=/opt/bind10</userinput></screen>
  471. </para>
  472. <para>
  473. If the configure fails, it may be due to missing or old
  474. dependencies.
  475. </para>
  476. </section>
  477. <section>
  478. <title>Build</title>
  479. <para>
  480. After the configure step is complete, to build the executables
  481. from the C++ code and prepare the Python scripts, run:
  482. <screen>$ <userinput>make</userinput></screen>
  483. </para>
  484. </section>
  485. <section>
  486. <title>Install</title>
  487. <para>
  488. To install the BIND 10 executables, support files,
  489. and documentation, run:
  490. <screen>$ <userinput>make install</userinput></screen>
  491. </para>
  492. <note>
  493. <para>The install step may require superuser privileges.</para>
  494. </note>
  495. </section>
  496. <!-- TODO: tests -->
  497. <section>
  498. <title>Install Hierarchy</title>
  499. <para>
  500. The following is the layout of the complete BIND 10 installation:
  501. <itemizedlist>
  502. <listitem>
  503. <simpara>
  504. <filename>bin/</filename> &mdash;
  505. general tools and diagnostic clients.
  506. </simpara>
  507. </listitem>
  508. <listitem>
  509. <simpara>
  510. <filename>etc/bind10-devel/</filename> &mdash;
  511. configuration files.
  512. </simpara>
  513. </listitem>
  514. <listitem>
  515. <simpara>
  516. <filename>lib/</filename> &mdash;
  517. libraries and python modules.
  518. </simpara>
  519. </listitem>
  520. <listitem>
  521. <simpara>
  522. <filename>libexec/bind10-devel/</filename> &mdash;
  523. executables that a user wouldn't normally run directly and
  524. are not run independently.
  525. These are the BIND 10 modules which are daemons started by
  526. the <command>bind10</command> tool.
  527. </simpara>
  528. </listitem>
  529. <listitem>
  530. <simpara>
  531. <filename>sbin/</filename> &mdash;
  532. commands used by the system administrator.
  533. </simpara>
  534. </listitem>
  535. <listitem>
  536. <simpara>
  537. <filename>share/bind10-devel/</filename> &mdash;
  538. configuration specifications.
  539. </simpara>
  540. </listitem>
  541. <listitem>
  542. <simpara>
  543. <filename>share/man/</filename> &mdash;
  544. manual pages (online documentation).
  545. </simpara>
  546. </listitem>
  547. <listitem>
  548. <simpara>
  549. <filename>var/bind10-devel/</filename> &mdash;
  550. data source and configuration databases.
  551. </simpara>
  552. </listitem>
  553. </itemizedlist>
  554. </para>
  555. </section>
  556. </section>
  557. <!--
  558. <section id="install.troubleshooting">
  559. <title>Troubleshooting</title>
  560. <para>
  561. </para>
  562. </section>
  563. -->
  564. </chapter>
  565. <chapter id="bind10">
  566. <title>Starting BIND10 with <command>bind10</command></title>
  567. <para>
  568. BIND 10 provides the <command>bind10</command> command which
  569. starts up the required processes.
  570. <command>bind10</command>
  571. will also restart processes that exit unexpectedly.
  572. This is the only command needed to start the BIND 10 system.
  573. </para>
  574. <para>
  575. After starting the <command>b10-msgq</command> communications channel,
  576. <command>bind10</command> connects to it,
  577. runs the configuration manager, and reads its own configuration.
  578. Then it starts the other modules.
  579. </para>
  580. <para>
  581. The <command>b10-msgq</command> and <command>b10-cfgmgr</command>
  582. services make up the core. The <command>b10-msgq</command> daemon
  583. provides the communication channel between every part of the system.
  584. The <command>b10-cfgmgr</command> daemon is always needed by every
  585. module, if only to send information about themselves somewhere,
  586. but more importantly to ask about their own settings, and
  587. about other modules.
  588. The <command>bind10</command> master process will also start up
  589. <command>b10-cmdctl</command> for admins to communicate with the
  590. system, <command>b10-auth</command> for authoritative DNS service or
  591. <command>b10-resolver</command> for recursive name service,
  592. <command>b10-stats</command> for statistics collection,
  593. <command>b10-xfrin</command> for inbound DNS zone transfers,
  594. <command>b10-xfrout</command> for outbound DNS zone transfers,
  595. and <command>b10-zonemgr</command> for secondary service.
  596. </para>
  597. <section id="start">
  598. <title>Starting BIND 10</title>
  599. <para>
  600. To start the BIND 10 service, simply run <command>bind10</command>.
  601. Run it with the <option>--verbose</option> switch to
  602. get additional debugging or diagnostic output.
  603. </para>
  604. <!-- TODO: note it doesn't go into background -->
  605. </section>
  606. </chapter>
  607. <chapter id="msgq">
  608. <title>Command channel</title>
  609. <para>
  610. The BIND 10 components use the <command>b10-msgq</command>
  611. message routing daemon to communicate with other BIND 10 components.
  612. The <command>b10-msgq</command> implements what is called the
  613. <quote>Command Channel</quote>.
  614. Processes intercommunicate by sending messages on the command
  615. channel.
  616. Example messages include shutdown, get configurations, and set
  617. configurations.
  618. This Command Channel is not used for DNS message passing.
  619. It is used only to control and monitor the BIND 10 system.
  620. </para>
  621. <para>
  622. Administrators do not communicate directly with the
  623. <command>b10-msgq</command> daemon.
  624. By default, BIND 10 uses port 9912 for the
  625. <command>b10-msgq</command> service.
  626. It listens on 127.0.0.1.
  627. </para>
  628. <!-- TODO: this is broken, see Trac #111
  629. <para>
  630. To select an alternate port for the <command>b10-msgq</command> to
  631. use, run <command>bind10</command> specifying the option:
  632. <screen> $ <userinput>bind10 -TODO-msgq-port 9912</userinput></screen>
  633. </para>
  634. -->
  635. <!-- TODO: upcoming plans:
  636. Unix domain sockets
  637. -->
  638. </chapter>
  639. <chapter id="cfgmgr">
  640. <title>Configuration manager</title>
  641. <para>
  642. The configuration manager, <command>b10-cfgmgr</command>,
  643. handles all BIND 10 system configuration. It provides
  644. persistent storage for configuration, and notifies running
  645. modules of configuration changes.
  646. </para>
  647. <para>
  648. The <command>b10-auth</command> and <command>b10-xfrin</command>
  649. daemons and other components receive their configurations
  650. from the configuration manager over the <command>b10-msgq</command>
  651. command channel.
  652. </para>
  653. <para>The administrator doesn't connect to it directly, but
  654. uses a user interface to communicate with the configuration
  655. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  656. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  657. </para>
  658. <!-- TODO -->
  659. <note>
  660. <para>
  661. The development prototype release only provides the
  662. <command>bindctl</command> as a user interface to
  663. <command>b10-cmdctl</command>.
  664. Upcoming releases will provide another interactive command-line
  665. interface and a web-based interface.
  666. </para>
  667. </note>
  668. <para>
  669. The <command>b10-cfgmgr</command> daemon can send all
  670. specifications and all current settings to the
  671. <command>bindctl</command> client (via
  672. <command>b10-cmdctl</command>).
  673. </para>
  674. <para>
  675. <command>b10-cfgmgr</command> relays configurations received
  676. from <command>b10-cmdctl</command> to the appropriate modules.
  677. </para>
  678. <!-- TODO:
  679. Configuration settings for itself are defined as ConfigManager.
  680. TODO: show examples
  681. -->
  682. <!-- TODO:
  683. config changes are actually commands to cfgmgr
  684. -->
  685. <!-- TODO: what about run time config to change this? -->
  686. <!-- jelte: > config set cfgmgr/config_database <file> -->
  687. <!-- TODO: what about command line switch to change this? -->
  688. <para>
  689. The stored configuration file is at
  690. <filename>/usr/local/var/bind10-devel/b10-config.db</filename>.
  691. (The full path is what was defined at build configure time for
  692. <option>--localstatedir</option>.
  693. The default is <filename>/usr/local/var/</filename>.)
  694. The format is loosely based on JSON and is directly parseable
  695. python, but this may change in a future version.
  696. This configuration data file is not manually edited by the
  697. administrator.
  698. </para>
  699. <!--
  700. Well the specfiles have a more fixed format (they must contain specific
  701. stuff), but those are also directly parseable python structures (and
  702. 'coincidentally', our data::element string representation is the same)
  703. loosely based on json, tweaked to be directly parseable in python, but a
  704. subset of that.
  705. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  706. nope, spec files are written by module developers, and db should be done
  707. through bindctl and friends
  708. -->
  709. <para>
  710. The configuration manager does not have any command line arguments.
  711. Normally it is not started manually, but is automatically
  712. started using the <command>bind10</command> master process
  713. (as covered in <xref linkend="bind10"/>).
  714. </para>
  715. <!-- TODO: upcoming plans:
  716. configuration for configuration manager itself. And perhaps we might
  717. change the messaging protocol, but an admin should never see any of that
  718. -->
  719. <!-- TODO: show examples, test this -->
  720. <!--
  721. , so an admin can simply run bindctl,
  722. do config show, and it shows all modules; config show >module> shows all
  723. options for that module
  724. -->
  725. </chapter>
  726. <chapter id="cmdctl">
  727. <title>Remote control daemon</title>
  728. <para>
  729. <command>b10-cmdctl</command> is the gateway between
  730. administrators and the BIND 10 system.
  731. It is a HTTPS server that uses standard HTTP Digest
  732. Authentication for username and password validation.
  733. It provides a REST-ful interface for accessing and controlling
  734. BIND 10.
  735. </para>
  736. <!-- TODO: copy examples from wiki, try with wget -->
  737. <para>
  738. When <command>b10-cmdctl</command> starts, it firsts
  739. asks <command>b10-cfgmgr</command> about what modules are
  740. running and what their configuration is (over the
  741. <command>b10-msgq</command> channel). Then it will start listening
  742. on HTTPS for clients &mdash; the user interface &mdash; such
  743. as <command>bindctl</command>.
  744. </para>
  745. <para>
  746. <command>b10-cmdctl</command> directly sends commands
  747. (received from the user interface) to the specified component.
  748. Configuration changes are actually commands to
  749. <command>b10-cfgmgr</command> so are sent there.
  750. </para>
  751. <!--
  752. TODO:
  753. "For bindctl to list a module's available configurations and
  754. available commands, it communicates over the cmdctl REST interface.
  755. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  756. asks the module for its specification and also cfgmgr looks in its
  757. own configuration database for current values."
  758. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  759. GET, but rather requests it once and then listens in for updates,
  760. but you might wanna check with likun
  761. -->
  762. <!-- TODO: replace /usr/local -->
  763. <!-- TODO: permissions -->
  764. <para>The HTTPS server requires a private key,
  765. such as a RSA PRIVATE KEY.
  766. The default location is at
  767. <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
  768. (A sample key is at
  769. <filename>/usr/local/share/bind10-devel/cmdctl-keyfile.pem</filename>.)
  770. It also uses a certificate located at
  771. <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
  772. (A sample certificate is at
  773. <filename>/usr/local/share/bind10-devel/cmdctl-certfile.pem</filename>.)
  774. This may be a self-signed certificate or purchased from a
  775. certification authority.
  776. </para>
  777. <note><para>
  778. The HTTPS server doesn't support a certificate request from a
  779. client (at this time).
  780. <!-- TODO: maybe allow request from server side -->
  781. The <command>b10-cmdctl</command> daemon does not provide a
  782. public service. If any client wants to control BIND 10, then
  783. a certificate needs to be first received from the BIND 10
  784. administrator.
  785. The BIND 10 installation provides a sample PEM bundle that matches
  786. the sample key and certificate.
  787. </para></note>
  788. <!-- TODO: cross-ref -->
  789. <!-- TODO
  790. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  791. but that is a single file, maybethis should go back to that format?
  792. -->
  793. <!--
  794. <para>
  795. (08:20:56) shane: It is in theory possible to run without cmdctl.
  796. (08:21:02) shane: I think we discussed this.
  797. </para>
  798. -->
  799. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  800. <para>
  801. The <command>b10-cmdctl</command> daemon also requires
  802. the user account file located at
  803. <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
  804. This comma-delimited file lists the accounts with a user name,
  805. hashed password, and salt.
  806. (A sample file is at
  807. <filename>/usr/local/share/bind10-devel/cmdctl-accounts.csv</filename>.
  808. It contains the user named <quote>root</quote> with the password
  809. <quote>bind10</quote>.)
  810. </para>
  811. <para>
  812. The administrator may create a user account with the
  813. <command>b10-cmdctl-usermgr</command> tool.
  814. </para>
  815. <!-- TODO: show example -->
  816. <!-- TODO: does cmdctl need to be restarted to change cert or key
  817. or accounts database -->
  818. <para>
  819. By default the HTTPS server listens on the localhost port 8080.
  820. The port can be set by using the <option>--port</option> command line option.
  821. The address to listen on can be set using the <option>--address</option> command
  822. line argument.
  823. Each HTTPS connection is stateless and timesout in 1200 seconds
  824. by default. This can be
  825. redefined by using the <option>--idle-timeout</option> command line argument.
  826. </para>
  827. <section id="cmdctl.spec">
  828. <title>Configuration specification for b10-cmdctl</title>
  829. <para>
  830. The configuration items for <command>b10-cmdctl</command> are:
  831. key_file
  832. cert_file
  833. accounts_file
  834. </para>
  835. <!-- TODO -->
  836. <para>
  837. The control commands are:
  838. print_settings
  839. <!-- TODO: remove that -->
  840. shutdown
  841. </para>
  842. <!-- TODO -->
  843. </section>
  844. <!--
  845. TODO
  846. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  847. (12:21:33) jinmei: btw
  848. -->
  849. </chapter>
  850. <chapter id="bindctl">
  851. <title>Control and configure user interface</title>
  852. <note><para>
  853. For this development prototype release, <command>bindctl</command>
  854. is the only user interface. It is expected that upcoming
  855. releases will provide another interactive command-line
  856. interface and a web-based interface for controlling and
  857. configuring BIND 10.
  858. </para></note>
  859. <para>
  860. The <command>bindctl</command> tool provides an interactive
  861. prompt for configuring, controlling, and querying the BIND 10
  862. components.
  863. It communicates directly with a REST-ful interface over HTTPS
  864. provided by <command>b10-cmdctl</command>. It doesn't
  865. communicate to any other components directly.
  866. </para>
  867. <!-- TODO: explain and show interface -->
  868. <para>
  869. Configuration changes are actually commands to
  870. <command>b10-cfgmgr</command>. So when <command>bindctl</command>
  871. sends a configuration, it is sent to <command>b10-cmdctl</command>
  872. (over a HTTPS connection); then <command>b10-cmdctl</command>
  873. sends the command (over a <command>b10-msgq</command> command
  874. channel) to <command>b10-cfgmgr</command> which then stores
  875. the details and relays (over a <command>b10-msgq</command> command
  876. channel) the configuration on to the specified module.
  877. </para>
  878. <para>
  879. </para>
  880. </chapter>
  881. <chapter id="authserver">
  882. <title>Authoritative Server</title>
  883. <para>
  884. The <command>b10-auth</command> is the authoritative DNS server.
  885. It supports EDNS0 and DNSSEC. It supports IPv6.
  886. Normally it is started by the <command>bind10</command> master
  887. process.
  888. </para>
  889. <section>
  890. <title>Server Configurations</title>
  891. <!-- TODO: offers command line options but not used
  892. since we used bind10 -->
  893. <para>
  894. <command>b10-auth</command> is configured via the
  895. <command>b10-cfgmgr</command> configuration manager.
  896. The module name is <quote>Auth</quote>.
  897. The configuration data item is:
  898. <variablelist>
  899. <varlistentry>
  900. <term>database_file</term>
  901. <listitem>
  902. <simpara>This is an optional string to define the path to find
  903. the SQLite3 database file.
  904. <!-- TODO: -->
  905. Note: Later the DNS server will use various data source backends.
  906. This may be a temporary setting until then.
  907. </simpara>
  908. </listitem>
  909. </varlistentry>
  910. </variablelist>
  911. </para>
  912. <para>
  913. The configuration command is:
  914. <variablelist>
  915. <varlistentry>
  916. <term>shutdown</term>
  917. <listitem>
  918. <simpara>Stop the authoritative DNS server.
  919. </simpara>
  920. <!-- TODO: what happens when this is sent, will bind10 restart? -->
  921. </listitem>
  922. </varlistentry>
  923. </variablelist>
  924. </para>
  925. <!-- TODO: examples of setting or running above? -->
  926. </section>
  927. <section>
  928. <title>Data Source Backends</title>
  929. <note><para>
  930. For the development prototype release, <command>b10-auth</command>
  931. supports a SQLite3 data source backend and in-memory data source
  932. backend.
  933. Upcoming versions will be able to use multiple different
  934. data sources, such as MySQL and Berkeley DB.
  935. </para></note>
  936. <para>
  937. By default, the SQLite3 backend uses the data file located at
  938. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
  939. (The full path is what was defined at build configure time for
  940. <option>--localstatedir</option>.
  941. The default is <filename>/usr/local/var/</filename>.)
  942. This data file location may be changed by defining the
  943. <quote>database_file</quote> configuration.
  944. </para>
  945. </section>
  946. <section>
  947. <title>Loading Master Zones Files</title>
  948. <para>
  949. RFC 1035 style DNS master zone files may imported
  950. into a BIND 10 data source by using the
  951. <command>b10-loadzone</command> utility.
  952. </para>
  953. <para>
  954. <command>b10-loadzone</command> supports the following
  955. special directives (control entries):
  956. <variablelist>
  957. <varlistentry>
  958. <term>$INCLUDE</term>
  959. <listitem>
  960. <simpara>Loads an additional zone file. This may be recursive.
  961. </simpara>
  962. </listitem>
  963. </varlistentry>
  964. <varlistentry>
  965. <term>$ORIGIN</term>
  966. <listitem>
  967. <simpara>Defines the relative domain name.
  968. </simpara>
  969. </listitem>
  970. </varlistentry>
  971. <varlistentry>
  972. <term>$TTL</term>
  973. <listitem>
  974. <simpara>Defines the time-to-live value used for following
  975. records that don't include a TTL.
  976. </simpara>
  977. </listitem>
  978. </varlistentry>
  979. </variablelist>
  980. </para>
  981. <para>
  982. The <option>-o</option> argument may be used to define the
  983. default origin for loaded zone file records.
  984. </para>
  985. <note>
  986. <para>
  987. In the development prototype release, only the SQLite3 back
  988. end is used.
  989. By default, it stores the zone data in
  990. <filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
  991. unless the <option>-d</option> switch is used to set the
  992. database filename.
  993. Multiple zones are stored in a single SQLite3 zone database.
  994. </para>
  995. </note>
  996. <para>
  997. If you reload a zone already existing in the database,
  998. all records from that prior zone disappear and a whole new set
  999. appears.
  1000. </para>
  1001. <!--TODO: permissions for xfrin or loadzone to create the file -->
  1002. </section>
  1003. <!--
  1004. TODO
  1005. <section>
  1006. <title>Troubleshooting</title>
  1007. <para>
  1008. </para>
  1009. </section>
  1010. -->
  1011. </chapter>
  1012. <chapter id="xfrin">
  1013. <title>Incoming Zone Transfers</title>
  1014. <para>
  1015. Incoming zones are transferred using the <command>b10-xfrin</command>
  1016. process which is started by <command>bind10</command>.
  1017. When received, the zone is stored in the BIND 10
  1018. data store, and its records can be served by
  1019. <command>b10-auth</command>.
  1020. In combination with <command>b10-zonemgr</command> (for
  1021. automated SOA checks), this allows the BIND 10 server to
  1022. provide <quote>secondary</quote> service.
  1023. </para>
  1024. <note><simpara>
  1025. The current development release of BIND 10 only supports
  1026. AXFR. (IXFR is not supported.)
  1027. <!-- TODO: sqlite3 data source only? -->
  1028. </simpara></note>
  1029. <!-- TODO:
  1030. how to tell bind10 you are a secondary?
  1031. when will it first attempt to check for new zone? (using REFRESH?)
  1032. what if zonemgr is not running?
  1033. what if a NOTIFY is sent?
  1034. -->
  1035. <para>
  1036. To manually trigger a zone transfer to retrieve a remote zone,
  1037. you may use the <command>bindctl</command> utility.
  1038. For example, at the <command>bindctl</command> prompt run:
  1039. <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
  1040. </para>
  1041. <!-- TODO: can that retransfer be used to identify a new zone? -->
  1042. <!-- TODO: what if doesn't exist at that master IP? -->
  1043. </chapter>
  1044. <chapter id="xfrout">
  1045. <title>Outbound Zone Transfers</title>
  1046. <para>
  1047. The <command>b10-xfrout</command> process is started by
  1048. <command>bind10</command>.
  1049. When the <command>b10-auth</command> authoritative DNS server
  1050. receives an AXFR request, <command>b10-xfrout</command>
  1051. sends the zone.
  1052. This is used to provide master DNS service to share zones
  1053. to secondary name servers.
  1054. The <command>b10-xfrout</command> is also used to send
  1055. NOTIFY messages to slaves.
  1056. </para>
  1057. <note><simpara>
  1058. The current development release of BIND 10 only supports
  1059. AXFR. (IXFR is not supported.)
  1060. Access control is not yet provided.
  1061. </simpara></note>
  1062. <!--
  1063. TODO:
  1064. xfrout section:
  1065. auth servers checks for AXFR query
  1066. sends the XFR query to the xfrout module
  1067. uses /tmp/auth_xfrout_conn which is a socket
  1068. what is XfroutClient xfr_client??
  1069. /tmp/auth_xfrout_conn is not removed
  1070. -->
  1071. </chapter>
  1072. <chapter id="zonemgr">
  1073. <title>Secondary Manager</title>
  1074. <para>
  1075. The <command>b10-zonemgr</command> process is started by
  1076. <command>bind10</command>.
  1077. It keeps track of SOA refresh, retry, and expire timers
  1078. and other details for BIND 10 to perform as a slave.
  1079. When the <command>b10-auth</command> authoritative DNS server
  1080. receives a NOTIFY message, <command>b10-zonemgr</command>
  1081. may tell <command>b10-xfrin</command> to do a refresh
  1082. to start an inbound zone transfer.
  1083. The secondary manager resets its counters when a new zone is
  1084. transferred in.
  1085. </para>
  1086. <note><simpara>
  1087. Access control (such as allowing notifies) is not yet provided.
  1088. The primary/secondary service is not yet complete.
  1089. </simpara></note>
  1090. <!-- TODO: lots to describe for zonemgr -->
  1091. </chapter>
  1092. <chapter id="resolverserver">
  1093. <title>Recursive Name Server</title>
  1094. <para>
  1095. The <command>b10-resolver</command> process is started by
  1096. <command>bind10</command>.
  1097. <!-- TODO
  1098. It provides a resolver so DNS clients can ask it to do recursion
  1099. and it will return answers.
  1100. -->
  1101. </para>
  1102. <para>
  1103. The main <command>bind10</command> process can be configured
  1104. to select to run either the authoritative or resolver.
  1105. By default, it starts the authoritative service.
  1106. <!-- TODO: later both -->
  1107. You may change this using <command>bindctl</command>, for example:
  1108. <screen>
  1109. &gt; <userinput>config set Boss/start_auth false</userinput>
  1110. &gt; <userinput>config set Boss/start_resolver true</userinput>
  1111. &gt; <userinput>config commit</userinput>
  1112. </screen>
  1113. </para>
  1114. <para>
  1115. The master <command>bind10</command> will stop and start
  1116. the desired services.
  1117. </para>
  1118. <para>
  1119. The resolver also needs to be configured to listen on an address
  1120. and port:
  1121. <screen>
  1122. &gt; <userinput>config set Resolver/listen_on [{ "address": "127.0.0.1", "port": 53 }]</userinput>
  1123. &gt; <userinput>config commit</userinput>
  1124. </screen>
  1125. </para>
  1126. <!-- TODO: later the above will have some defaults -->
  1127. <section>
  1128. <title>Forwarding</title>
  1129. <para>
  1130. To enable forwarding, the upstream address and port must be
  1131. configured to forward queries to, such as:
  1132. <screen>
  1133. &gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
  1134. &gt; <userinput>config commit</userinput>
  1135. </screen>
  1136. (Replace <replaceable>192.168.1.1</replaceable> to point to your
  1137. full resolver.)
  1138. </para>
  1139. <para>
  1140. Normal iterative name service can be re-enabled by clearing the
  1141. forwarding address(es); for example:
  1142. <screen>
  1143. &gt; <userinput>config set Resolver/forward_addresses []</userinput>
  1144. &gt; <userinput>config commit</userinput>
  1145. </screen>
  1146. </para>
  1147. </section>
  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. -->