source: server/major/bind.xml@ d1a0319

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 d1a0319 was 60bb78f, checked in by Andrew Benton <andy@…>, 12 years ago

s/arch/uname -m/

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

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