bind10-guide.xml 44 KB

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