source: server/major/bind.xml@ bae16652

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 bae16652 was bae16652, checked in by DJ Lucas <dj@…>, 16 years ago

made iproute2 patch for bind optional

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

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