source: server/major/bind.xml@ c27abcb4

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 c27abcb4 was c27abcb4, checked in by Bruce Dubbs <bdubbs@…>, 17 years ago

Update to bind-9.4.1-P1. Includes a security update.

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

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