source: server/other/bind.xml@ 16473a92

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

Updated BIND server instructions

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

  • Property mode set to 100644
File size: 16.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/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-size "4.6 MB">
10<!ENTITY bind-buildsize "87 MB">
11<!ENTITY bind-time "1.87 SBU (additional 4.14 SBU to run the complete test suite)">
12]>
13
14<sect1 id="bind" xreflabel="BIND-&bind-version;">
15<sect1info>
16<othername>$LastChangedBy$</othername>
17<date>$Date$</date>
18</sect1info>
19<?dbhtml filename="bind.html"?>
20<title><acronym>BIND</acronym>-&bind-version;</title>
21
22<sect2>
23<title>Introduction to
24<application><acronym>BIND</acronym></application></title>
25
26<para>The <application><acronym>BIND</acronym></application> package
27provides a <acronym>DNS</acronym> server and client utilities. If you
28are only interested in the utilities, refer to the
29<xref linkend="bind-utils"/>.</para>
30
31<sect3><title>Package information</title>
32<itemizedlist spacing='compact'>
33<listitem><para>Download (HTTP):
34<ulink url="&bind-download-http;"/></para></listitem>
35<listitem><para>Download (FTP):
36<ulink url="&bind-download-ftp;"/></para></listitem>
37<listitem><para>Download size:
38&bind-size;</para></listitem>
39<listitem><para>Estimated disk space required:
40&bind-buildsize;</para></listitem>
41<listitem><para>Estimated build time:
42&bind-time;</para></listitem></itemizedlist>
43</sect3>
44
45<sect3><title><application><acronym>BIND</acronym></application>
46dependencies</title>
47<sect4><title>Optional</title>
48<para><xref linkend="openssl"/></para>
49</sect4>
50
51<sect4><title>Optional (to run the full test suite)</title>
52<para><xref linkend="net-tools"/> (for <command>ifconfig</command>) and
53<xref linkend="perl-modules"/>: Net-DNS</para>
54</sect4>
55
56<sect4><title>Optional (to [re]build documentation)</title>
57<para><xref linkend="openjade"/>,
58<xref linkend="jadetex"/>,
59<xref linkend="docbook-dsssl"/></para>
60</sect4>
61</sect3>
62
63</sect2>
64
65<sect2>
66<title>Installation of
67<application><acronym>BIND</acronym></application></title>
68
69<para>Install <application><acronym>BIND</acronym></application> by
70running the following commands:</para>
71
72<screen><userinput><command>sed -i -e "s/dsssl-stylesheets/&amp;-1.78/g" configure &amp;&amp;
73./configure --prefix=/usr --sysconfdir=/etc \
74 --enable-threads --with-libtool &amp;&amp;
75make &amp;&amp;
76make install &amp;&amp;
77chmod 755 \
78 /usr/lib/{lib{bind9,isc{,cc,cfg},lwres}.so.?.?.?,libdns.so.20.0.0} &amp;&amp;
79mv /usr/share/man/man8/named.conf.5 /usr/share/man/man5 &amp;&amp;
80cd doc &amp;&amp;
81install -d -m755 /usr/share/doc/bind-9.3.0/{arm,draft,misc,rfc} &amp;&amp;
82install -m644 arm/*.html \
83 /usr/share/doc/bind-9.3.0/arm &amp;&amp;
84install -m644 draft/*.txt \
85 /usr/share/doc/bind-9.3.0/draft &amp;&amp;
86install -m644 rfc/* \
87 /usr/share/doc/bind-9.3.0/rfc &amp;&amp;
88install -m644 misc/{dnssec,ipv6,migrat*,options,rfc-compliance,roadmap,sdb} \
89 /usr/share/doc/bind-9.3.0/misc</command></userinput></screen>
90
91<para>In order to run the complete test suite before installing the
92package, you need to set up some dummy interfaces (requires
93<command>ifconfig</command>). Issue the following commands to run the
94complete suite of tests:</para>
95
96<screen><userinput><command>bin/tests/system/ifconfig.sh up &amp;&amp;
97make check &gt;check.log 2&gt;&amp;1 &amp;&amp;
98bin/tests/system/ifconfig.sh down</command></userinput></screen>
99
100<para>If desired, issue the following command to ensure all 145 tests ran
101successfully:</para>
102
103<screen><userinput><command>grep "R:PASS" check.log | wc -l</command></userinput></screen>
104
105</sect2>
106
107<sect2>
108<title>Command explanations</title>
109
110<para><command>sed -i -e ... configure</command>: This command forces
111<command>configure</command> to look for the <acronym>DSSSL</acronym>
112stylesheets in the standard <acronym>BLFS</acronym> location.</para>
113
114<para><parameter>--sysconfdir=/etc</parameter>: This parameter forces
115<application><acronym>BIND</acronym></application> to look for configuration
116files in <filename class='directory'>/etc</filename> instead of
117<filename class='directory'>/usr/etc</filename>.</para>
118
119<para><parameter>--enable-threads</parameter>: This parameter enables
120multi-threading capability.</para>
121
122<para><parameter>--with-libtool</parameter>: This parameter forces the
123building of dynamic libraries and links the installed binaries to these
124libraries.</para>
125
126<para><command>cd doc; install ...</command>: These commands install the
127additional package documentation. Optionally, omit any or all of these
128commands.</para>
129
130</sect2>
131
132<sect2>
133<title>Configuring
134<application><acronym>BIND</acronym></application></title>
135
136<sect3><title>Config files</title>
137<para><filename>named.conf</filename>, <filename>root.hints</filename>,
138<filename>127.0.0</filename>, <filename>rndc.conf</filename></para>
139</sect3>
140
141<sect3><title>Configuration Information</title>
142
143<para><application><acronym>BIND</acronym></application> will be configured
144to run in a <command>chroot</command> jail as an unprivileged user (named).
145This configuration is more secure in that a <acronym>DNS</acronym> compromise
146can only affect a few files in the named user's <envar>HOME</envar>
147directory.</para>
148
149<para>Create the unprivileged user and group named:</para>
150
151<screen><userinput><command>groupadd named &amp;&amp;
152useradd -m -c "BIND Owner" -g named -s /bin/false named</command></userinput></screen>
153
154<para>Set up some files, directories and devices needed by
155<application><acronym>BIND</acronym></application>:</para>
156
157<screen><userinput><command>cd /home/named &amp;&amp;
158mkdir -p dev etc/namedb/slave var/run &amp;&amp;
159mknod /home/named/dev/null c 1 3 &amp;&amp;
160mknod /home/named/dev/random c 1 8 &amp;&amp;
161chmod 666 /home/named/dev/{null,random} &amp;&amp;
162mkdir /home/named/etc/namedb/pz &amp;&amp;
163cp /etc/localtime /home/named/etc</command></userinput></screen>
164
165<para>Then, generate a key for use in the <filename>named.conf</filename>
166and <filename>rdnc.conf</filename> files using the
167<command>rndc-confgen</command> command:</para>
168
169<screen><userinput><command>rndc-confgen -b 512 | grep -m 1 "secret" | cut -d '"' -f 2</command></userinput></screen>
170
171<para>Create the <filename>named.conf</filename> file from which named
172will read the location of zone files, root name servers and secure
173<acronym>DNS</acronym> keys:</para>
174
175<screen><userinput><command>cat &gt; /home/named/etc/named.conf &lt;&lt; "EOF"</command>
176 options {
177 directory "/etc/namedb";
178 pid-file "/var/run/named.pid";
179 statistics-file "/var/run/named.stats";
180
181 };
182 controls {
183 inet 127.0.0.1 allow { localhost; } keys { rndc_key; };
184 };
185 key "rndc_key" {
186 algorithm hmac-md5;
187 secret "<replaceable>[Insert secret from rndc-confgen's output here]</replaceable>";
188 };
189 zone "." {
190 type hint;
191 file "root.hints";
192 };
193 zone "0.0.127.in-addr.arpa" {
194 type master;
195 file "pz/127.0.0";
196 };
197
198// Bind 9 now logs by default through syslog (except debug).
199// These are the default logging rules.
200
201logging {
202 category default { default_syslog; default_debug; };
203 category unmatched { null; };
204
205 channel default_syslog {
206 syslog daemon; // send to syslog's daemon
207 // facility
208 severity info; // only send priority info
209 // and higher
210 };
211
212 channel default_debug {
213 file "named.run"; // write to named.run in
214 // the working directory
215 // Note: stderr is used instead
216 // of "named.run"
217 // if the server is started
218 // with the '-f' option.
219 severity dynamic; // log at the server's
220 // current debug level
221 };
222
223 channel default_stderr {
224 stderr; // writes to stderr
225 severity info; // only send priority info
226 // and higher
227 };
228
229 channel null {
230 null; // toss anything sent to
231 // this channel
232 };
233};
234
235
236
237<command>EOF</command></userinput></screen>
238
239<para>Create the <filename>rndc.conf</filename> file with the following
240commands:</para>
241
242<screen><userinput><command>cat &gt; /etc/rndc.conf &lt;&lt; "EOF"</command>
243key rndc_key {
244algorithm "hmac-md5";
245 secret
246 "<replaceable>[Insert secret from rndc-confgen's output here]</replaceable>";
247 };
248options {
249 default-server localhost;
250 default-key rndc_key;
251};
252<command>EOF</command></userinput></screen>
253
254<para>The <filename>rndc.conf</filename> file contains information for
255controlling named operations with the <command>rndc</command>
256utility.</para>
257
258<para>Create a zone file with the following contents:</para>
259
260<screen><userinput><command>cat &gt; /home/named/etc/namedb/pz/127.0.0 &lt;&lt; "EOF"</command>
261$TTL 3D
262@ IN SOA ns.local.domain. hostmaster.local.domain. (
263 1 ; Serial
264 8H ; Refresh
265 2H ; Retry
266 4W ; Expire
267 1D) ; Minimum TTL
268 NS ns.local.domain.
2691 PTR localhost.
270<command>EOF</command></userinput></screen>
271
272<para>Create the <filename>root.hints</filename> file with the following
273commands:</para>
274
275<note><para>Caution must be used to ensure there are no leading spaces in this
276file.</para></note>
277
278<screen><userinput><command>cat &gt; /home/named/etc/namedb/root.hints &lt;&lt; "EOF"</command>
279. 6D IN NS A.ROOT-SERVERS.NET.
280. 6D IN NS B.ROOT-SERVERS.NET.
281. 6D IN NS C.ROOT-SERVERS.NET.
282. 6D IN NS D.ROOT-SERVERS.NET.
283. 6D IN NS E.ROOT-SERVERS.NET.
284. 6D IN NS F.ROOT-SERVERS.NET.
285. 6D IN NS G.ROOT-SERVERS.NET.
286. 6D IN NS H.ROOT-SERVERS.NET.
287. 6D IN NS I.ROOT-SERVERS.NET.
288. 6D IN NS J.ROOT-SERVERS.NET.
289. 6D IN NS K.ROOT-SERVERS.NET.
290. 6D IN NS L.ROOT-SERVERS.NET.
291. 6D IN NS M.ROOT-SERVERS.NET.
292A.ROOT-SERVERS.NET. 6D IN A 198.41.0.4
293B.ROOT-SERVERS.NET. 6D IN A 192.228.79.201
294C.ROOT-SERVERS.NET. 6D IN A 192.33.4.12
295D.ROOT-SERVERS.NET. 6D IN A 128.8.10.90
296E.ROOT-SERVERS.NET. 6D IN A 192.203.230.10
297F.ROOT-SERVERS.NET. 6D IN A 192.5.5.241
298G.ROOT-SERVERS.NET. 6D IN A 192.112.36.4
299H.ROOT-SERVERS.NET. 6D IN A 128.63.2.53
300I.ROOT-SERVERS.NET. 6D IN A 192.36.148.17
301J.ROOT-SERVERS.NET. 6D IN A 192.58.128.30
302K.ROOT-SERVERS.NET. 6D IN A 193.0.14.129
303L.ROOT-SERVERS.NET. 6D IN A 198.32.64.12
304M.ROOT-SERVERS.NET. 6D IN A 202.12.27.33
305<command>EOF</command></userinput></screen>
306
307<para>The <filename>root.hints</filename> file is a list of root name servers.
308This file must be updated periodically with the <command>dig</command>
309utility. A current copy of root.hints can be obtained from
310<ulink url="ftp://rs.internic.net/domain/named.root" />. Consult the
311<ulink url="http://www.bind9.net/Bv9ARM.html"><application>
312<acronym>BIND</acronym></application> 9 Administrator Reference Manual</ulink>
313for details.</para>
314
315<para>Create or modify <filename>resolv.conf</filename> to use the new
316name server with the following commands:</para>
317
318<note><para>Replace <replaceable>[yourdomain.com]</replaceable> with your own
319valid domain name.</para></note>
320
321<screen><userinput><command>cp /etc/resolv.conf /etc/resolv.conf.bak &amp;&amp;
322cat &gt; /etc/resolv.conf &lt;&lt; "EOF"</command>
323search <replaceable>[yourdomain.com]</replaceable>
324nameserver 127.0.0.1
325<command>EOF</command></userinput></screen>
326
327<para>Set permissions on the <command>chroot</command> jail with the
328following command:</para>
329
330<screen><userinput><command>chown -R named.named /home/named</command></userinput></screen>
331
332<para>To start the <acronym>DNS</acronym> server at boot, install the
333<filename>/etc/rc.d/init.d/bind</filename> init script included in the
334<xref linkend="intro-important-bootscripts"/> package.</para>
335
336<screen><userinput><command>make install-bind</command></userinput></screen>
337
338<para>Now start <application><acronym>BIND</acronym></application> with
339the new boot script:</para>
340
341<screen><userinput><command>/etc/rc.d/init.d/bind start</command></userinput></screen>
342
343</sect3>
344
345<sect3><title>Testing <application><acronym>BIND</acronym></application></title>
346
347<para>Test out the new
348<application><acronym>BIND</acronym></application> 9 installation. First
349query the local host address with <command>dig</command>:</para>
350
351<screen><userinput><command>dig -x 127.0.0.1</command></userinput></screen>
352
353<para>Now try an external name lookup, taking note of the speed
354difference in repeated lookups due to the caching. Run the
355<command>dig</command> command twice on the same address:</para>
356
357<screen><userinput><command>dig www.linuxfromscratch.org &amp;&amp;
358dig www.linuxfromscratch.org</command></userinput></screen>
359
360<para>You can see almost instantaneous results with the named caching lookups.
361Consult the <application><acronym>BIND</acronym></application> Administrator
362Reference Manual located at
363<filename>doc/arm/Bv9ARM.html</filename> in the package source tree, for
364further configuration options.</para>
365</sect3>
366
367</sect2>
368
369<sect2>
370<title>Contents</title>
371
372<para>The <application><acronym>BIND</acronym></application> package contains
373<command>dig</command>,
374<command>dnssec-keygen</command>,
375<command>dnssec-signzone</command>,
376<command>host</command>,
377<command>isc-config.sh</command>,
378<command>lwresd</command>,
379<command>named</command>,
380<command>named-checkconf</command>,
381<command>named-checkzone</command>,
382<command>nslookup</command>,
383<command>nsupdate</command>,
384<command>rndc</command>,
385<command>rndc-confgen</command>,
386<filename class='libraryfile'>libbind9</filename>,
387<filename class='libraryfile'>libdns</filename>,
388<filename class='libraryfile'>libisc</filename>,
389<filename class='libraryfile'>libisccc</filename>,
390<filename class='libraryfile'>libisccfg</filename> and
391<filename class='libraryfile'>liblwres</filename>.</para>
392</sect2>
393
394<sect2><title>Description</title>
395
396<sect3><title>dig</title>
397<para><command>dig</command> interrogates <acronym>DNS</acronym>
398servers.</para></sect3>
399
400<sect3><title>dnssec-keygen</title>
401<para><command>dnssec-keygen</command> is a key generator for secure
402<acronym>DNS</acronym>.</para></sect3>
403
404<sect3><title>dnssec-signzone</title>
405<para><command>dnssec-signzone</command> generates signed versions of
406zone files.</para></sect3>
407
408<sect3><title>host</title>
409<para><command>host</command> is a utility for <acronym>DNS</acronym>
410lookups.</para></sect3>
411
412<sect3><title>lwresd</title>
413<para><command>lwresd</command> is a caching-only name server for local
414process use.</para></sect3>
415
416<sect3><title>named</title>
417<para><command>named</command> is the name server daemon.</para></sect3>
418
419<sect3><title>named-checkconf</title>
420<para><command>named-checkconf</command> checks the syntax of
421<filename>named.conf</filename> files.</para></sect3>
422
423<sect3><title>named-checkzone</title>
424<para><command>named-checkzone</command> checks zone file
425validity.</para></sect3>
426
427<sect3><title>nslookup</title>
428<para><command>nslookup</command> is a program used to query Internet
429domain nameservers.</para></sect3>
430
431<sect3><title>nsupdate</title>
432<para><command>nsupdate</command> is used to submit
433<acronym>DNS</acronym> update requests.</para></sect3>
434
435<sect3><title>rndc</title>
436<para><command>rndc</command> controls the operation of
437<application><acronym>BIND</acronym></application>.</para></sect3>
438
439<sect3><title>rndc-confgen</title>
440<para><command>rndc-confgen</command> generates
441<filename>rndc.conf</filename> files.</para></sect3>
442
443</sect2>
444
445</sect1>
446
Note: See TracBrowser for help on using the repository browser.