source: server/major/bind.xml@ 634cf991

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 634cf991 was 634cf991, checked in by Andrew Benton <andy@…>, 12 years ago

bind tweaks

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@9463 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.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
7 "http://gd.tuwien.ac.at/infosys/servers/isc/bind9/&bind-version;/bind-&bind-version;.tar.gz">
8 <!ENTITY bind-download-ftp
9 "ftp://ftp.isc.org/isc/bind9/&bind-version;/bind-&bind-version;.tar.gz">
10 <!ENTITY bind-md5sum "afa41f8203d50bedad65071f9b6f96d7">
11 <!ENTITY bind-size "8.1 MB">
12 <!ENTITY bind-buildsize "260 MB">
13 <!ENTITY bind-time "1.7 SBU (additional 13 minutes, processor independent, to
14 run the complete test suite)">
15]>
16
17<sect1 id="bind" xreflabel="BIND-&bind-version;">
18 <?dbhtml filename="bind.html"?>
19
20 <sect1info>
21 <othername>$LastChangedBy$</othername>
22 <date>$Date$</date>
23 </sect1info>
24
25 <title>BIND-&bind-version;</title>
26
27 <indexterm zone="bind">
28 <primary sortas="a-BIND">BIND</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to BIND</title>
33
34 <para>The <application>BIND</application> package provides a DNS server
35 and client utilities. If you are only interested in the utilities, refer
36 to the <xref linkend="bind-utils"/>.</para>
37
38 &lfs70_checked;
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">Additional Downloads</bridgehead>
63 <itemizedlist spacing='compact'>
64 <listitem>
65 <para>Optional patch (if net-tools is not installed):
66 <ulink
67 url="&patch-root;/bind-&bind-version;-use_iproute2-1.patch"/></para>
68 </listitem>
69 </itemizedlist>
70
71 <bridgehead renderas="sect3">BIND Dependencies</bridgehead>
72
73 <bridgehead renderas="sect4">Optional</bridgehead>
74 <para role="optional"><xref linkend="openssl"/></para>
75
76 <bridgehead renderas="sect4">Optional (to run the test suite)</bridgehead>
77 <para role="optional"><xref linkend="perl-net-dns"/> and
78 <xref linkend="net-tools"/> (you may omit net-tools by using the optional
79 patch to utilize iproute2, but the IPv6 tests will fail)</para>
80
81 <bridgehead renderas="sect4">Optional (to rebuild the
82 documentation)</bridgehead>
83 <para role="optional"><!--<xref linkend="tetex"/> or-->
84 <xref linkend="texlive"/>, and
85 <xref linkend="libxslt"/></para>
86
87 <para condition="html" role="usernotes">User Notes:
88 <ulink url="&blfs-wiki;/bind"/></para>
89
90 </sect2>
91
92 <sect2 role="installation">
93 <title>Installation of BIND</title>
94
95 <para>If you have chosen not to install net-tools, apply the iproute2
96 patch with the following command:</para>
97
98<screen><userinput>patch -Np1 -i ../bind-&bind-version;-use_iproute2-1.patch</userinput></screen>
99
100 <para>Install <application>BIND</application> by running the
101 following commands:</para>
102
103<screen><userinput>./configure --prefix=/usr \
104 --sysconfdir=/etc \
105 --localstatedir=/var \
106 --mandir=/usr/share/man \
107 --enable-threads \
108 --with-libtool &amp;&amp;
109make</userinput></screen>
110
111 <para>Issue the following commands to run the complete suite of tests.
112 First, as the <systemitem class="username">root</systemitem> user, set up
113 some test interfaces:</para>
114
115<screen role="root"><userinput>bin/tests/system/ifconfig.sh up</userinput></screen>
116
117 <para>Now run the test suite as an unprivileged user:</para>
118
119<screen><userinput>make check 2&gt;&amp;1 | tee check.log</userinput></screen>
120
121 <para>Again as <systemitem class="username">root</systemitem>, clean up the
122 test interfaces:</para>
123
124<screen role="root"><userinput>bin/tests/system/ifconfig.sh down</userinput></screen>
125
126 <para>Issue the following command to check that all 148 tests
127 ran successfully:</para>
128
129<screen><userinput>grep "R:PASS" check.log | wc -l</userinput></screen>
130
131 <para>Finally, install the package as the <systemitem
132 class="username">root</systemitem> user:</para>
133
134<screen role="root"><userinput>make install &amp;&amp;
135chmod 755 /usr/lib/lib{bind9,isc{,cc,cfg},lwres,dns}.so.*.?.? &amp;&amp;
136
137cd doc &amp;&amp;
138install -v -d -m755 /usr/share/doc/bind-&bind-version;/{arm,draft,misc,rfc} &amp;&amp;
139install -v -m644 arm/*.html \
140 /usr/share/doc/bind-&bind-version;/arm &amp;&amp;
141install -v -m644 draft/*.txt \
142 /usr/share/doc/bind-&bind-version;/draft &amp;&amp;
143install -v -m644 rfc/* \
144 /usr/share/doc/bind-&bind-version;/rfc &amp;&amp;
145install -v -m644 \
146 misc/{dnssec,ipv6,migrat*,options,rfc-compliance,roadmap,sdb} \
147 /usr/share/doc/bind-&bind-version;/misc</userinput></screen>
148 </sect2>
149
150 <sect2 role="commands">
151 <title>Command Explanations</title>
152
153 <para><parameter>--sysconfdir=/etc</parameter>: This parameter forces
154 <application>BIND</application> to look for configuration
155 files in <filename class='directory'>/etc</filename> instead of
156 <filename class='directory'>/usr/etc</filename>.</para>
157
158 <para><parameter>--enable-threads</parameter>: This parameter enables
159 multi-threading capability.</para>
160
161 <para><parameter>--with-libtool</parameter>: This parameter forces the
162 building of dynamic libraries and links the installed binaries to these
163 libraries.</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 </sect2>
174
175 <sect2 role="configuration">
176 <title>Configuring BIND</title>
177
178 <sect3 id="bind-config">
179 <title>Config files</title>
180
181 <para><filename>named.conf</filename>,
182 <filename>root.hints</filename>,
183 <filename>127.0.0</filename>,
184 <filename>rndc.conf</filename> and
185 <filename>resolv.conf</filename></para>
186
187 <indexterm zone="bind bind-config">
188 <primary sortas="e-etc-named.conf">/etc/named.conf</primary>
189 </indexterm>
190
191 <indexterm zone="bind bind-config">
192 <primary sortas="e-etc-rndc.conf">/etc/rndc.conf</primary>
193 </indexterm>
194
195 <indexterm zone="bind bind-config">
196 <primary sortas="e-etc-resolv.conf">/etc/resolv.conf</primary>
197 </indexterm>
198
199 <indexterm zone="bind bind-config">
200 <primary
201 sortas="e-etc-namedb-root.hints">/etc/namedb/root.hints</primary>
202 </indexterm>
203
204 <indexterm zone="bind bind-config">
205 <primary
206 sortas="e-etc-namedb-pz-127.0.0.0">/etc/namedb/pz/127.0.0.0</primary>
207 </indexterm>
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,pz} usr/lib/engines var/run/named &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;
235cp /etc/localtime etc &amp;&amp;
236touch /srv/named/managed-keys.bind &amp;&amp;
237cp /usr/lib/engines/libgost.so usr/lib/engines &amp;&amp;
238[ $(arch) = x86_64 ] &amp;&amp; ln -sv lib usr/lib64</userinput></screen>
239
240 <para>The <filename>rndc.conf</filename> file contains information for
241 controlling <command>named</command> operations with the
242 <command>rndc</command> utility. Generate a key for use in the <filename>named.conf</filename> and <filename>rdnc.conf</filename> with the
243 <command>rndc-confgen</command> command:</para>
244
245<screen role="root"><userinput>rndc-confgen -r /dev/urandom -b 512 > /etc/rndc.conf &amp;&amp;
246sed '/conf/d;/^#/!d;s:^# ::' /etc/rndc.conf > /srv/named/etc/named.conf</userinput></screen>
247
248 <para>Complete the <filename>named.conf</filename> file from which
249 <command>named</command> will read the location of zone files, root
250 name servers and secure DNS keys:</para>
251
252<screen role="root"><?dbfo keep-together="auto"?><userinput>cat &gt;&gt; /srv/named/etc/named.conf &lt;&lt; "EOF"
253<literal>options {
254 directory "/etc/namedb";
255 pid-file "/var/run/named.pid";
256 statistics-file "/var/run/named.stats";
257
258};
259zone "." {
260 type hint;
261 file "root.hints";
262};
263zone "0.0.127.in-addr.arpa" {
264 type master;
265 file "pz/127.0.0";
266};
267
268// Bind 9 now logs by default through syslog (except debug).
269// These are the default logging rules.
270
271logging {
272 category default { default_syslog; default_debug; };
273 category unmatched { null; };
274
275 channel default_syslog {
276 syslog daemon; // send to syslog's daemon
277 // facility
278 severity info; // only send priority info
279 // and higher
280 };
281
282 channel default_debug {
283 file "named.run"; // write to named.run in
284 // the working directory
285 // Note: stderr is used instead
286 // of "named.run"
287 // if the server is started
288 // with the '-f' option.
289 severity dynamic; // log at the server's
290 // current debug level
291 };
292
293 channel default_stderr {
294 stderr; // writes to stderr
295 severity info; // only send priority info
296 // and higher
297 };
298
299 channel null {
300 null; // toss anything sent to
301 // this channel
302 };
303};</literal>
304EOF</userinput></screen>
305
306 <para>Create a zone file with the following contents:</para>
307
308<screen role="root"><userinput>cat &gt; /srv/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; /srv/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 199.7.83.42
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>&lt;yourdomain.com&gt;</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>&lt;yourdomain.com&gt;</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 /srv/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="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.&lfs-domainname; &amp;&amp;
418dig www.&lfs-domainname;</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>/srv/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.