source: server/major/bind.xml@ 2a5310e8

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 2a5310e8 was 2a5310e8, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Typo fix. Server.

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

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