source: server/major/bind.xml@ d5fc113d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 d5fc113d was d5fc113d, checked in by Igor Živković <igor@…>, 10 years ago

Update to bind-9.9.4-P2.

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

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