source: server/major/bind.xml@ f1e103a

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 f1e103a was f1e103a, checked in by Randy McMurchy <randy@…>, 13 years ago

Added new package TeX Live-20100722

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