source: server/major/bind.xml@ 9776bb80

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 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 9776bb80 was 9776bb80, checked in by Randy McMurchy <randy@…>, 16 years ago

Identified that the Bind patch is not required if Net-Tools is installed

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