source: server/major/bind.xml@ 40399b1

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 40399b1 was 40399b1, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

Update to bind-9.8.1-P1.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8973 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 21.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6 <!ENTITY bind-download-http "http://gd.tuwien.ac.at/infosys/servers/isc/bind9/&bind-version;/bind-&bind-version;.tar.gz">
7 <!ENTITY bind-download-ftp "ftp://ftp.isc.org/isc/bind9/&bind-version;/bind-&bind-version;.tar.gz">
8 <!ENTITY bind-md5sum "afa41f8203d50bedad65071f9b6f96d7">
9 <!ENTITY bind-size "8.1 MB">
10 <!ENTITY bind-buildsize "260 MB">
11 <!ENTITY bind-time "1.7 SBU (additional 13 minutes, processor independent, to run the complete test suite)">
12]>
13
14<sect1 id="bind" xreflabel="BIND-&bind-version;">
15 <?dbhtml filename="bind.html"?>
16
17 <sect1info>
18 <othername>$LastChangedBy$</othername>
19 <date>$Date$</date>
20 </sect1info>
21
22 <title>BIND-&bind-version;</title>
23
24 <indexterm zone="bind">
25 <primary sortas="a-BIND">BIND</primary>
26 </indexterm>
27
28 <sect2 role="package">
29 <title>Introduction to BIND</title>
30
31 <para>The <application>BIND</application> package provides a DNS server
32 and client utilities. If you are only interested in the utilities, refer
33 to the <xref linkend="bind-utils"/>.</para>
34
35 &lfs70_checked;
36
37 <bridgehead renderas="sect3">Package Information</bridgehead>
38 <itemizedlist spacing="compact">
39 <listitem>
40 <para>Download (HTTP): <ulink url="&bind-download-http;"/></para>
41 </listitem>
42 <listitem>
43 <para>Download (FTP): <ulink url="&bind-download-ftp;"/></para>
44 </listitem>
45 <listitem>
46 <para>Download MD5 sum: &bind-md5sum;</para>
47 </listitem>
48 <listitem>
49 <para>Download size: &bind-size;</para>
50 </listitem>
51 <listitem>
52 <para>Estimated disk space required: &bind-buildsize;</para>
53 </listitem>
54 <listitem>
55 <para>Estimated build time: &bind-time;</para>
56 </listitem>
57 </itemizedlist>
58
59 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
60 <itemizedlist spacing='compact'>
61 <listitem>
62 <para>Optional patch (if net-tools is not installed):
63 <ulink url="&patch-root;/bind-&bind-version;-use_iproute2-1.patch"/></para>
64 </listitem>
65 </itemizedlist>
66
67 <bridgehead renderas="sect3">BIND Dependencies</bridgehead>
68
69 <bridgehead renderas="sect4">Optional</bridgehead>
70 <para role="optional"><xref linkend="openssl"/></para>
71
72 <bridgehead renderas="sect4">Optional (to run the test suite)</bridgehead>
73 <para role="optional"><xref linkend="perl-net-dns"/> and
74 <xref linkend="net-tools"/> (you may omit net-tools by using the optional
75 patch to utilize iproute2, but the IPv6 tests will fail)</para>
76
77 <bridgehead renderas="sect4">Optional (to rebuild documentation)</bridgehead>
78 <para role="optional"><xref linkend="tetex"/> or
79 <xref linkend="texlive"/>, and
80 <xref linkend="libxslt"/></para>
81
82 <para condition="html" role="usernotes">User Notes:
83 <ulink url="&blfs-wiki;/bind"/></para>
84
85 </sect2>
86
87 <sect2 role="installation">
88 <title>Installation of BIND</title>
89
90 <para>If you have chosen not to install net-tools, apply the iproute2
91 patch with the following command:</para>
92
93<screen><userinput>patch -Np1 -i ../bind-&bind-version;-use_iproute2-1.patch</userinput></screen>
94
95 <para>Install <application>BIND</application> by running the
96 following commands:</para>
97
98<screen><userinput>./configure --prefix=/usr \
99 --sysconfdir=/etc \
100 --localstatedir=/var \
101 --mandir=/usr/share/man \
102 --enable-threads \
103 --with-libtool &amp;&amp;
104make</userinput></screen>
105
106 <para>Issue the following commands to run the complete suite of tests.
107 First, as the <systemitem class="username">root</systemitem> user, set up
108 some test interfaces:</para>
109
110<screen role="root"><userinput>bin/tests/system/ifconfig.sh up</userinput></screen>
111
112 <para>Now run the test suite as an unprivileged user:</para>
113
114<screen><userinput>make check 2&gt;&amp;1 | tee check.log</userinput></screen>
115
116 <para>Again as <systemitem class="username">root</systemitem>, clean up the
117 test interfaces:</para>
118
119<screen role="root"><userinput>bin/tests/system/ifconfig.sh down</userinput></screen>
120
121 <para>Issue the following command to check that all 148 tests
122 ran successfully:</para>
123
124<screen><userinput>grep "R:PASS" check.log | wc -l</userinput></screen>
125
126 <para>Finally, install the package as the <systemitem
127 class="username">root</systemitem> user:</para>
128
129<screen role="root"><userinput>make install &amp;&amp;
130chmod 755 /usr/lib/lib{bind9,isc{,cc,cfg},lwres,dns}.so.*.?.? &amp;&amp;
131
132cd doc &amp;&amp;
133install -v -d -m755 /usr/share/doc/bind-&bind-version;/{arm,draft,misc,rfc} &amp;&amp;
134install -v -m644 arm/*.html \
135 /usr/share/doc/bind-&bind-version;/arm &amp;&amp;
136install -v -m644 draft/*.txt \
137 /usr/share/doc/bind-&bind-version;/draft &amp;&amp;
138install -v -m644 rfc/* \
139 /usr/share/doc/bind-&bind-version;/rfc &amp;&amp;
140install -v -m644 \
141 misc/{dnssec,ipv6,migrat*,options,rfc-compliance,roadmap,sdb} \
142 /usr/share/doc/bind-&bind-version;/misc</userinput></screen>
143
144 </sect2>
145
146 <sect2 role="commands">
147 <title>Command Explanations</title>
148
149 <para><parameter>--sysconfdir=/etc</parameter>: This parameter forces
150 <application>BIND</application> to look for configuration
151 files in <filename class='directory'>/etc</filename> instead of
152 <filename class='directory'>/usr/etc</filename>.</para>
153
154 <para><parameter>--enable-threads</parameter>: This parameter enables
155 multi-threading capability.</para>
156
157 <para><parameter>--with-libtool</parameter>: This parameter forces the
158 building of dynamic libraries and links the installed binaries to these
159 libraries.</para>
160
161 <para><command>chmod 755
162 /usr/lib/{lib{bind9,isc{,cc,cfg},lwres,dns}.so.*.?.?}</command>:
163 Enable the execute bit to prevent a warning when using
164 <command>ldd</command> to check library dependencies.</para>
165
166 <para><command>cd doc; install ...</command>: These commands install
167 additional package documentation. Omit any or all of these commands if
168 desired.</para>
169
170 </sect2>
171
172 <sect2 role="configuration">
173 <title>Configuring BIND</title>
174
175 <sect3 id="bind-config">
176 <title>Config files</title>
177
178 <para><filename>named.conf</filename>,
179 <filename>root.hints</filename>,
180 <filename>127.0.0</filename>,
181 <filename>rndc.conf</filename> and
182 <filename>resolv.conf</filename></para>
183
184 <indexterm zone="bind bind-config">
185 <primary sortas="e-etc-named.conf">/etc/named.conf</primary>
186 </indexterm>
187
188 <indexterm zone="bind bind-config">
189 <primary sortas="e-etc-rndc.conf">/etc/rndc.conf</primary>
190 </indexterm>
191
192 <indexterm zone="bind bind-config">
193 <primary sortas="e-etc-resolv.conf">/etc/resolv.conf</primary>
194 </indexterm>
195
196 <indexterm zone="bind bind-config">
197 <primary sortas="e-etc-namedb-root.hints">/etc/namedb/root.hints</primary>
198 </indexterm>
199
200 <indexterm zone="bind bind-config">
201 <primary sortas="e-etc-namedb-pz-127.0.0.0">/etc/namedb/pz/127.0.0.0</primary>
202 </indexterm>
203
204 </sect3>
205
206 <sect3>
207 <title>Configuration Information</title>
208
209 <para><application>BIND</application> will be configured to run in a
210 <command>chroot</command> jail as an unprivileged user (<systemitem
211 class="username">named</systemitem>). This configuration is more secure
212 in that a DNS compromise can only affect a few files in the <systemitem
213 class="username">named</systemitem> user's <envar>HOME</envar>
214 directory.</para>
215
216 <para>Create the unprivileged user and group <systemitem
217 class="username">named</systemitem>:</para>
218
219<screen role="root"><userinput>groupadd -g 20 named &amp;&amp;
220useradd -c "BIND Owner" -g named -s /bin/false -u 20 named &amp;&amp;
221install -d -m770 -o named -g named /srv/named</userinput></screen>
222
223 <para>Set up some files, directories and devices needed by
224 <application>BIND</application>:</para>
225
226<screen role="root"><userinput>cd /srv/named &amp;&amp;
227mkdir -p dev etc/namedb/slave var/run &amp;&amp;
228mknod /srv/named/dev/null c 1 3 &amp;&amp;
229mknod /srv/named/dev/random c 1 8 &amp;&amp;
230chmod 666 /srv/named/dev/{null,random} &amp;&amp;
231mkdir /srv/named/etc/namedb/pz &amp;&amp;
232cp /etc/localtime /srv/named/etc</userinput></screen>
233
234 <para>Then, generate a key for use in the <filename>named.conf</filename>
235 and <filename>rdnc.conf</filename> files using the
236 <command>rndc-confgen</command> command:</para>
237
238<screen role="root"><userinput>rndc-confgen -r /dev/urandom -b 512 | \
239 grep -m 1 "secret" | cut -d '"' -f 2</userinput></screen>
240
241 <para>Create the <filename>named.conf</filename> file from which
242 <command>named</command> will read the location of zone files, root
243 name servers and secure DNS keys:</para>
244
245<screen role="root"><?dbfo keep-together="auto"?><userinput>cat &gt; /srv/named/etc/named.conf &lt;&lt; "EOF"
246<literal> options {
247 directory "/etc/namedb";
248 pid-file "/var/run/named.pid";
249 statistics-file "/var/run/named.stats";
250
251 };
252 controls {
253 inet 127.0.0.1 allow { localhost; } keys { rndc_key; };
254 };
255 key "rndc_key" {
256 algorithm hmac-md5;
257 secret "<replaceable>&lt;Insert secret from rndc-confgen's output here&gt;</replaceable>";
258 };
259 zone "." {
260 type hint;
261 file "root.hints";
262 };
263 zone "0.0.127.in-addr.arpa" {
264 type master;
265 file "pz/127.0.0";
266 };
267
268// Bind 9 now logs by default through syslog (except debug).
269// These are the default logging rules.
270
271logging {
272 category default { default_syslog; default_debug; };
273 category unmatched { null; };
274
275 channel default_syslog {
276 syslog daemon; // send to syslog's daemon
277 // facility
278 severity info; // only send priority info
279 // and higher
280 };
281
282 channel default_debug {
283 file "named.run"; // write to named.run in
284 // the working directory
285 // Note: stderr is used instead
286 // of "named.run"
287 // if the server is started
288 // with the '-f' option.
289 severity dynamic; // log at the server's
290 // current debug level
291 };
292
293 channel default_stderr {
294 stderr; // writes to stderr
295 severity info; // only send priority info
296 // and higher
297 };
298
299 channel null {
300 null; // toss anything sent to
301 // this channel
302 };
303};</literal>
304
305EOF</userinput></screen>
306
307 <para>Create the <filename>rndc.conf</filename> file with the following
308 commands:</para>
309
310<screen role="root"><userinput>cat &gt; /etc/rndc.conf &lt;&lt; "EOF"
311<literal>key rndc_key {
312algorithm "hmac-md5";
313 secret
314 "<replaceable>&lt;Insert secret from rndc-confgen's output here&gt;</replaceable>";
315 };
316options {
317 default-server localhost;
318 default-key rndc_key;
319};</literal>
320EOF</userinput></screen>
321
322 <para>The <filename>rndc.conf</filename> file contains information for
323 controlling <command>named</command> operations with the
324 <command>rndc</command> utility.</para>
325
326 <para>Create a zone file with the following contents:</para>
327
328<screen role="root"><userinput>cat &gt; /srv/named/etc/namedb/pz/127.0.0 &lt;&lt; "EOF"
329<literal>$TTL 3D
330@ IN SOA ns.local.domain. hostmaster.local.domain. (
331 1 ; Serial
332 8H ; Refresh
333 2H ; Retry
334 4W ; Expire
335 1D) ; Minimum TTL
336 NS ns.local.domain.
3371 PTR localhost.</literal>
338EOF</userinput></screen>
339
340 <para>Create the <filename>root.hints</filename> file with the following
341 commands:</para>
342
343 <note>
344 <para>Caution must be used to ensure there are no leading spaces in
345 this file.</para>
346 </note>
347
348<screen role="root"><userinput>cat &gt; /srv/named/etc/namedb/root.hints &lt;&lt; "EOF"
349<literal>. 6D IN NS A.ROOT-SERVERS.NET.
350. 6D IN NS B.ROOT-SERVERS.NET.
351. 6D IN NS C.ROOT-SERVERS.NET.
352. 6D IN NS D.ROOT-SERVERS.NET.
353. 6D IN NS E.ROOT-SERVERS.NET.
354. 6D IN NS F.ROOT-SERVERS.NET.
355. 6D IN NS G.ROOT-SERVERS.NET.
356. 6D IN NS H.ROOT-SERVERS.NET.
357. 6D IN NS I.ROOT-SERVERS.NET.
358. 6D IN NS J.ROOT-SERVERS.NET.
359. 6D IN NS K.ROOT-SERVERS.NET.
360. 6D IN NS L.ROOT-SERVERS.NET.
361. 6D IN NS M.ROOT-SERVERS.NET.
362A.ROOT-SERVERS.NET. 6D IN A 198.41.0.4
363B.ROOT-SERVERS.NET. 6D IN A 192.228.79.201
364C.ROOT-SERVERS.NET. 6D IN A 192.33.4.12
365D.ROOT-SERVERS.NET. 6D IN A 128.8.10.90
366E.ROOT-SERVERS.NET. 6D IN A 192.203.230.10
367F.ROOT-SERVERS.NET. 6D IN A 192.5.5.241
368G.ROOT-SERVERS.NET. 6D IN A 192.112.36.4
369H.ROOT-SERVERS.NET. 6D IN A 128.63.2.53
370I.ROOT-SERVERS.NET. 6D IN A 192.36.148.17
371J.ROOT-SERVERS.NET. 6D IN A 192.58.128.30
372K.ROOT-SERVERS.NET. 6D IN A 193.0.14.129
373L.ROOT-SERVERS.NET. 6D IN A 199.7.83.42
374M.ROOT-SERVERS.NET. 6D IN A 202.12.27.33</literal>
375EOF</userinput></screen>
376
377 <para>The <filename>root.hints</filename> file is a list of root
378 name servers. This file must be updated periodically with the
379 <command>dig</command> utility. A current copy of root.hints can be
380 obtained from <ulink url="ftp://rs.internic.net/domain/named.root" />.
381 Consult the <ulink url="http://www.bind9.net/Bv9ARM.html">BIND 9
382 Administrator Reference Manual</ulink> for details.</para>
383
384 <para>Create or modify <filename>resolv.conf</filename> to use the new
385 name server with the following commands:</para>
386
387 <note>
388 <para>Replace <replaceable>&lt;yourdomain.com&gt;</replaceable> with
389 your own valid domain name.</para>
390 </note>
391
392<screen role="root"><userinput>cp /etc/resolv.conf /etc/resolv.conf.bak &amp;&amp;
393cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
394<literal>search <replaceable>&lt;yourdomain.com&gt;</replaceable>
395nameserver 127.0.0.1</literal>
396EOF</userinput></screen>
397
398 <para>Set permissions on the <command>chroot</command> jail with the
399 following command:</para>
400
401<screen role="root"><userinput>chown -R named.named /srv/named</userinput></screen>
402
403 </sect3>
404
405 <sect3 id="bind-init">
406 <title>Boot Script</title>
407
408 <para>To start the DNS server at boot, install the
409 <filename>/etc/rc.d/init.d/bind</filename> init script included
410 in the <xref linkend="bootscripts"/> package.</para>
411
412 <indexterm zone="bind bind-init">
413 <primary sortas="f-bind">bind</primary>
414 </indexterm>
415
416<screen role="root"><userinput>make install-bind</userinput></screen>
417
418 <para>Now start <application>BIND</application> with
419 the new boot script:</para>
420
421<screen role="root"><userinput>/etc/rc.d/init.d/bind start</userinput></screen>
422
423 </sect3>
424
425 <sect3>
426 <title>Testing BIND</title>
427
428 <para>Test out the new <application>BIND</application> 9 installation.
429 First query the local host address with <command>dig</command>:</para>
430
431<screen><userinput>dig -x 127.0.0.1</userinput></screen>
432
433 <para>Now try an external name lookup, taking note of the speed
434 difference in repeated lookups due to the caching. Run the
435 <command>dig</command> command twice on the same address:</para>
436
437<screen><userinput>dig www.&lfs-domainname; &amp;&amp;
438dig www.&lfs-domainname;</userinput></screen>
439
440 <para>You can see almost instantaneous results with the named caching
441 lookups. Consult the <application>BIND</application> Administrator
442 Reference Manual located at <filename>doc/arm/Bv9ARM.html</filename>
443 in the package source tree, for further configuration options.</para>
444
445 </sect3>
446
447 </sect2>
448
449 <sect2 role="content">
450 <title>Contents</title>
451
452 <segmentedlist>
453 <segtitle>Installed Programs</segtitle>
454 <segtitle>Installed Libraries</segtitle>
455 <segtitle>Installed Directories</segtitle>
456
457 <seglistitem>
458 <seg>dig, dnssec-keygen, dnssec-signzone, host, isc-config.sh, lwresd,
459 named, named-checkconf, named-checkzone, nslookup, nsupdate, rndc, and
460 rndc-confgen</seg>
461 <seg>libbind9.{so,a}, libdns.{so,a}, libisc.{so,a}, libisccc.{so,a},
462 libisccfg.{so,a}, and liblwres.{so,a}</seg>
463 <seg>/srv/named, /usr/include/bind9, /usr/include/dns, /usr/include/dst,
464 /usr/include/isc, /usr/include/isccc, /usr/include/isccfg,
465 /usr/include/lwres, and /usr/share/doc/bind-&bind-version;</seg>
466 </seglistitem>
467 </segmentedlist>
468
469 <variablelist>
470 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
471 <?dbfo list-presentation="list"?>
472 <?dbhtml list-presentation="table"?>
473
474 <varlistentry id="dig">
475 <term><command>dig</command></term>
476 <listitem>
477 <para>interrogates DNS servers.</para>
478 <indexterm zone="bind dig">
479 <primary sortas="b-dig">dig</primary>
480 </indexterm>
481 </listitem>
482 </varlistentry>
483
484 <varlistentry id="dnssec-keygen">
485 <term><command>dnssec-keygen</command></term>
486 <listitem>
487 <para>is a key generator for secure DNS.</para>
488 <indexterm zone="bind dnssec-keygen">
489 <primary sortas="b-dnssec-keygen">dnssec-keygen</primary>
490 </indexterm>
491 </listitem>
492 </varlistentry>
493
494 <varlistentry id="dnssec-signzone">
495 <term><command>dnssec-signzone</command></term>
496 <listitem>
497 <para>generates signed versions of zone files.</para>
498 <indexterm zone="bind dnssec-signzone">
499 <primary sortas="b-dnssec-signzone">dnssec-signzone</primary>
500 </indexterm>
501 </listitem>
502 </varlistentry>
503
504 <varlistentry id="host">
505 <term><command>host</command></term>
506 <listitem>
507 <para>is a utility for DNS lookups.</para>
508 <indexterm zone="bind host">
509 <primary sortas="b-host">host</primary>
510 </indexterm>
511 </listitem>
512 </varlistentry>
513
514 <varlistentry id="lwresd">
515 <term><command>lwresd</command></term>
516 <listitem>
517 <para>is a caching-only name server for local process use.</para>
518 <indexterm zone="bind lwresd">
519 <primary sortas="b-lwresd">lwresd</primary>
520 </indexterm>
521 </listitem>
522 </varlistentry>
523
524 <varlistentry id="named">
525 <term><command>named</command></term>
526 <listitem>
527 <para>is the name server daemon.</para>
528 <indexterm zone="bind named">
529 <primary sortas="b-named">named</primary>
530 </indexterm>
531 </listitem>
532 </varlistentry>
533
534 <varlistentry id="named-checkconf">
535 <term><command>named-checkconf</command></term>
536 <listitem>
537 <para>checks the syntax of <filename>named.conf</filename>
538 files.</para>
539 <indexterm zone="bind named-checkconf">
540 <primary sortas="b-named-checkconf">named-checkconf</primary>
541 </indexterm>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry id="named-checkzone">
546 <term><command>named-checkzone</command></term>
547 <listitem>
548 <para>checks zone file validity.</para>
549 <indexterm zone="bind named-checkzone">
550 <primary sortas="b-named-checkzone">named-checkzone</primary>
551 </indexterm>
552 </listitem>
553 </varlistentry>
554
555 <varlistentry id="nslookup">
556 <term><command>nslookup</command></term>
557 <listitem>
558 <para>is a program used to query Internet domain nameservers.</para>
559 <indexterm zone="bind nslookup">
560 <primary sortas="b-nslookup">nslookup</primary>
561 </indexterm>
562 </listitem>
563 </varlistentry>
564
565 <varlistentry id="nsupdate">
566 <term><command>nsupdate</command></term>
567 <listitem>
568 <para>is used to submit DNS update requests.</para>
569 <indexterm zone="bind nsupdate">
570 <primary sortas="b-nsupdate">nsupdate</primary>
571 </indexterm>
572 </listitem>
573 </varlistentry>
574
575 <varlistentry id="rndc">
576 <term><command>rndc</command></term>
577 <listitem>
578 <para>controls the operation of <application>BIND</application>.</para>
579 <indexterm zone="bind rndc">
580 <primary sortas="b-rndc">rndc</primary>
581 </indexterm>
582 </listitem>
583 </varlistentry>
584
585 <varlistentry id="rndc-confgen">
586 <term><command>rndc-confgen</command></term>
587 <listitem>
588 <para>generates <filename>rndc.conf</filename> files.</para>
589 <indexterm zone="bind rndc-confgen">
590 <primary sortas="b-rndc-confgen">rndc-confgen</primary>
591 </indexterm>
592 </listitem>
593 </varlistentry>
594
595 </variablelist>
596
597 </sect2>
598
599</sect1>
Note: See TracBrowser for help on using the repository browser.