source: server/major/bind.xml@ 76e88b3

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

Change chmod explanation in bind.

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