source: server/major/bind.xml@ 8bcd51bd

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 8bcd51bd was 8bcd51bd, checked in by Randy McMurchy <randy@…>, 11 years ago

Fixed doc installation in the BIND instructions

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

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