source: server/major/bind.xml@ d4a47c5a

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 d4a47c5a was d4a47c5a, checked in by Randy McMurchy <randy@…>, 16 years ago

Corrected a chmod command in the BIND instructions

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

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