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
|
---|
27 | provides a <acronym>DNS</acronym> server and client utilities. If you
|
---|
28 | are 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>
|
---|
46 | dependencies</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
|
---|
70 | running the following commands:</para>
|
---|
71 |
|
---|
72 | <screen><userinput><command>sed -i -e "s/dsssl-stylesheets/&-1.78/g" configure &&
|
---|
73 | ./configure --prefix=/usr --sysconfdir=/etc \
|
---|
74 | --enable-threads --with-libtool &&
|
---|
75 | make &&
|
---|
76 | make install &&
|
---|
77 | chmod 755 \
|
---|
78 | /usr/lib/{lib{bind9,isc{,cc,cfg},lwres}.so.?.?.?,libdns.so.20.0.0} &&
|
---|
79 | mv /usr/share/man/man8/named.conf.5 /usr/share/man/man5 &&
|
---|
80 | cd doc &&
|
---|
81 | install -d -m755 /usr/share/doc/bind-9.3.0/{arm,draft,misc,rfc} &&
|
---|
82 | install -m644 arm/*.html \
|
---|
83 | /usr/share/doc/bind-9.3.0/arm &&
|
---|
84 | install -m644 draft/*.txt \
|
---|
85 | /usr/share/doc/bind-9.3.0/draft &&
|
---|
86 | install -m644 rfc/* \
|
---|
87 | /usr/share/doc/bind-9.3.0/rfc &&
|
---|
88 | install -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
|
---|
92 | package, you need to set up some dummy interfaces (requires
|
---|
93 | <command>ifconfig</command>). Issue the following commands to run the
|
---|
94 | complete suite of tests:</para>
|
---|
95 |
|
---|
96 | <screen><userinput><command>bin/tests/system/ifconfig.sh up &&
|
---|
97 | make check >check.log 2>&1 &&
|
---|
98 | bin/tests/system/ifconfig.sh down</command></userinput></screen>
|
---|
99 |
|
---|
100 | <para>If desired, issue the following command to ensure all 145 tests ran
|
---|
101 | successfully:</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>
|
---|
112 | stylesheets 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
|
---|
116 | files 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
|
---|
120 | multi-threading capability.</para>
|
---|
121 |
|
---|
122 | <para><parameter>--with-libtool</parameter>: This parameter forces the
|
---|
123 | building of dynamic libraries and links the installed binaries to these
|
---|
124 | libraries.</para>
|
---|
125 |
|
---|
126 | <para><command>cd doc; install ...</command>: These commands install the
|
---|
127 | additional package documentation. Optionally, omit any or all of these
|
---|
128 | commands.</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
|
---|
144 | to run in a <command>chroot</command> jail as an unprivileged user (named).
|
---|
145 | This configuration is more secure in that a <acronym>DNS</acronym> compromise
|
---|
146 | can only affect a few files in the named user's <envar>HOME</envar>
|
---|
147 | directory.</para>
|
---|
148 |
|
---|
149 | <para>Create the unprivileged user and group named:</para>
|
---|
150 |
|
---|
151 | <screen><userinput><command>groupadd named &&
|
---|
152 | useradd -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 &&
|
---|
158 | mkdir -p dev etc/namedb/slave var/run &&
|
---|
159 | mknod /home/named/dev/null c 1 3 &&
|
---|
160 | mknod /home/named/dev/random c 1 8 &&
|
---|
161 | chmod 666 /home/named/dev/{null,random} &&
|
---|
162 | mkdir /home/named/etc/namedb/pz &&
|
---|
163 | cp /etc/localtime /home/named/etc</command></userinput></screen>
|
---|
164 |
|
---|
165 | <para>Then, generate a key for use in the <filename>named.conf</filename>
|
---|
166 | and <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
|
---|
172 | will read the location of zone files, root name servers and secure
|
---|
173 | <acronym>DNS</acronym> keys:</para>
|
---|
174 |
|
---|
175 | <screen><userinput><command>cat > /home/named/etc/named.conf << "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 |
|
---|
201 | logging {
|
---|
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
|
---|
240 | commands:</para>
|
---|
241 |
|
---|
242 | <screen><userinput><command>cat > /etc/rndc.conf << "EOF"</command>
|
---|
243 | key rndc_key {
|
---|
244 | algorithm "hmac-md5";
|
---|
245 | secret
|
---|
246 | "<replaceable>[Insert secret from rndc-confgen's output here]</replaceable>";
|
---|
247 | };
|
---|
248 | options {
|
---|
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
|
---|
255 | controlling named operations with the <command>rndc</command>
|
---|
256 | utility.</para>
|
---|
257 |
|
---|
258 | <para>Create a zone file with the following contents:</para>
|
---|
259 |
|
---|
260 | <screen><userinput><command>cat > /home/named/etc/namedb/pz/127.0.0 << "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.
|
---|
269 | 1 PTR localhost.
|
---|
270 | <command>EOF</command></userinput></screen>
|
---|
271 |
|
---|
272 | <para>Create the <filename>root.hints</filename> file with the following
|
---|
273 | commands:</para>
|
---|
274 |
|
---|
275 | <note><para>Caution must be used to ensure there are no leading spaces in this
|
---|
276 | file.</para></note>
|
---|
277 |
|
---|
278 | <screen><userinput><command>cat > /home/named/etc/namedb/root.hints << "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.
|
---|
292 | A.ROOT-SERVERS.NET. 6D IN A 198.41.0.4
|
---|
293 | B.ROOT-SERVERS.NET. 6D IN A 192.228.79.201
|
---|
294 | C.ROOT-SERVERS.NET. 6D IN A 192.33.4.12
|
---|
295 | D.ROOT-SERVERS.NET. 6D IN A 128.8.10.90
|
---|
296 | E.ROOT-SERVERS.NET. 6D IN A 192.203.230.10
|
---|
297 | F.ROOT-SERVERS.NET. 6D IN A 192.5.5.241
|
---|
298 | G.ROOT-SERVERS.NET. 6D IN A 192.112.36.4
|
---|
299 | H.ROOT-SERVERS.NET. 6D IN A 128.63.2.53
|
---|
300 | I.ROOT-SERVERS.NET. 6D IN A 192.36.148.17
|
---|
301 | J.ROOT-SERVERS.NET. 6D IN A 192.58.128.30
|
---|
302 | K.ROOT-SERVERS.NET. 6D IN A 193.0.14.129
|
---|
303 | L.ROOT-SERVERS.NET. 6D IN A 198.32.64.12
|
---|
304 | M.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.
|
---|
308 | This file must be updated periodically with the <command>dig</command>
|
---|
309 | utility. 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>
|
---|
313 | for details.</para>
|
---|
314 |
|
---|
315 | <para>Create or modify <filename>resolv.conf</filename> to use the new
|
---|
316 | name server with the following commands:</para>
|
---|
317 |
|
---|
318 | <note><para>Replace <replaceable>[yourdomain.com]</replaceable> with your own
|
---|
319 | valid domain name.</para></note>
|
---|
320 |
|
---|
321 | <screen><userinput><command>cp /etc/resolv.conf /etc/resolv.conf.bak &&
|
---|
322 | cat > /etc/resolv.conf << "EOF"</command>
|
---|
323 | search <replaceable>[yourdomain.com]</replaceable>
|
---|
324 | nameserver 127.0.0.1
|
---|
325 | <command>EOF</command></userinput></screen>
|
---|
326 |
|
---|
327 | <para>Set permissions on the <command>chroot</command> jail with the
|
---|
328 | following 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
|
---|
339 | the 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
|
---|
349 | query 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
|
---|
354 | difference 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 &&
|
---|
358 | dig www.linuxfromscratch.org</command></userinput></screen>
|
---|
359 |
|
---|
360 | <para>You can see almost instantaneous results with the named caching lookups.
|
---|
361 | Consult the <application><acronym>BIND</acronym></application> Administrator
|
---|
362 | Reference Manual located at
|
---|
363 | <filename>doc/arm/Bv9ARM.html</filename> in the package source tree, for
|
---|
364 | further 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>
|
---|
398 | servers.</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
|
---|
406 | zone files.</para></sect3>
|
---|
407 |
|
---|
408 | <sect3><title>host</title>
|
---|
409 | <para><command>host</command> is a utility for <acronym>DNS</acronym>
|
---|
410 | lookups.</para></sect3>
|
---|
411 |
|
---|
412 | <sect3><title>lwresd</title>
|
---|
413 | <para><command>lwresd</command> is a caching-only name server for local
|
---|
414 | process 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
|
---|
425 | validity.</para></sect3>
|
---|
426 |
|
---|
427 | <sect3><title>nslookup</title>
|
---|
428 | <para><command>nslookup</command> is a program used to query Internet
|
---|
429 | domain 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 |
|
---|