source: server/major/bind.xml@ ba4b31cf

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

Updated links to Perl Modules

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