source: server/major/bind.xml@ df01b7a9

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 df01b7a9 was 3cb0c57, checked in by Randy McMurchy <randy@…>, 18 years ago

Added the 'User Notes' wiki link to each package page; changed all instances of .[so,a] to .{so,a} (brackets changed to braces); changed all replaceable tags to use angle brackets instead of square brackets to encapsulate the text - commit #9

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

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