source: server/major/bind.xml@ 5254d12

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 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 5254d12 was 5254d12, checked in by Randy McMurchy <randy@…>, 18 years ago

Standardized the id tag name of the Bootscripts package

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