]> CyberLeo.Net >> Repos - FreeBSD/releng/8.0.git/blob - contrib/bind9/FAQ.xml
Adjust to reflect 8.0-RELEASE.
[FreeBSD/releng/8.0.git] / contrib / bind9 / FAQ.xml
1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2        "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []>
3 <!--
4  - Copyright (C) 2004-2009  Internet Systems Consortium, Inc. ("ISC")
5  - Copyright (C) 2000-2003  Internet Software Consortium.
6  -
7  - Permission to use, copy, modify, and/or distribute this software for any
8  - purpose with or without fee is hereby granted, provided that the above
9  - copyright notice and this permission notice appear in all copies.
10  -
11  - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  - PERFORMANCE OF THIS SOFTWARE.
18 -->
19
20 <!-- $Id: FAQ.xml,v 1.46.56.4 2009/02/19 01:51:58 tbox Exp $ -->
21
22 <article class="faq">
23   <title>Frequently Asked Questions about BIND 9</title>
24   <articleinfo>
25     <copyright>
26       <year>2004</year>
27       <year>2005</year>
28       <year>2006</year>
29       <year>2007</year>
30       <year>2008</year>
31       <year>2009</year>
32       <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
33     </copyright>
34     <copyright>
35       <year>2000</year>
36       <year>2001</year>
37       <year>2002</year>
38       <year>2003</year>
39       <holder>Internet Software Consortium.</holder>
40     </copyright>
41   </articleinfo>
42   <qandaset defaultlabel='qanda'>
43           
44     <qandadiv><title>Compilation and Installation Questions</title>       
45     
46     <qandaentry>
47       <question>
48         <para>
49           I'm trying to compile BIND 9, and "make" is failing due to
50           files not being found.  Why?
51         </para>
52       </question>
53       <answer>
54         <para>
55           Using a parallel or distributed "make" to build BIND 9 is
56           not supported, and doesn't work.  If you are using one of
57           these, use normal make or gmake instead.
58         </para>
59       </answer>
60     </qandaentry>
61     
62     <qandaentry>
63       <question>
64         <para>
65           Isn't "make install"  supposed to generate a default named.conf?
66         </para>
67       </question>
68       <answer>
69         <para>
70           Short Answer: No. 
71         </para>
72         <para>
73           Long Answer: There really isn't a default configuration which fits
74           any site perfectly.  There are lots of decisions that need to
75           be made and there is no consensus on what the defaults should be.
76           For example FreeBSD uses /etc/namedb as the location where the
77           configuration files for named are stored.  Others use /var/named.
78         </para>
79         <para>
80           What addresses to listen on?  For a laptop on the move a lot
81           you may only want to listen on the loop back interfaces.
82         </para>
83         <para>
84           Who do you offer recursive service to?  Is there are firewall
85           to consider?  If so is it stateless or stateful.  Are you
86           directly on the Internet?  Are you on a private network? Are
87           you on a NAT'd network? The answers
88           to all these questions change how you configure even a
89           caching name server.
90         </para>
91       </answer>
92     </qandaentry>
93     
94     </qandadiv> <!-- Compilation and Installation Questions -->
95             
96     <qandadiv><title>Configuration and Setup Questions</title>
97
98     <qandaentry>
99       <!-- configuration, log -->
100       <question>
101         <para>
102           Why does named log the warning message <quote>no TTL specified -
103           using SOA MINTTL instead</quote>?
104         </para>
105       </question>
106       <answer>
107         <para>
108           Your zone file is illegal according to RFC1035.  It must either
109           have a line like:
110         </para>
111         <informalexample>
112           <programlisting>
113 $TTL 86400</programlisting>
114         </informalexample>
115         <para>
116           at the beginning, or the first record in it must have a TTL field,
117           like the "84600" in this example:
118         </para>
119         <informalexample>
120           <programlisting>
121 example.com. 86400 IN SOA ns hostmaster ( 1 3600 1800 1814400 3600 )</programlisting>
122         </informalexample>
123       </answer>
124     </qandaentry>
125     
126     <qandaentry>
127       <!-- configuration -->
128       <question>
129         <para>
130           Why do I get errors like <quote>dns_zone_load: zone foo/IN: loading
131           master file bar: ran out of space</quote>?
132         </para>
133       </question>
134       <answer>
135         <para>
136         This is often caused by TXT records with missing close
137         quotes.  Check that all TXT records containing quoted strings
138         have both open and close quotes.
139         </para>
140       </answer>
141     </qandaentry>
142
143     <qandaentry>
144       <!-- security -->
145       <question>
146         <para>
147           How do I restrict people from looking up the server version?
148         </para>
149       </question>
150       <answer>
151         <para>
152           Put a "version" option containing something other than the
153           real version in the "options" section of named.conf.  Note
154           doing this will not prevent attacks and may impede people
155           trying to diagnose problems with your server.  Also it is
156           possible to "fingerprint" nameservers to determine their
157           version.
158         </para>
159       </answer>
160     </qandaentry>
161
162     <qandaentry>
163       <!-- security -->
164       <question>
165         <para>
166           How do I restrict only remote users from looking up the
167           server version?
168         </para>
169       </question>
170       <answer>
171         <para>
172           The following view statement will intercept lookups as the
173           internal view that holds the version information will be
174           matched last.  The caveats of the previous answer still
175           apply, of course.
176         </para>
177         <informalexample>
178           <programlisting>
179 view "chaos" chaos {
180         match-clients { &lt;those to be refused&gt;; };
181         allow-query { none; };
182         zone "." {
183                 type hint;
184                 file "/dev/null";  // or any empty file
185         };
186 };</programlisting>
187         </informalexample>
188       </answer>
189     </qandaentry>
190
191     <qandaentry>
192       <!-- configuration -->
193       <question>
194         <para>
195           What do <quote>no source of entropy found</quote> or <quote>could not
196           open entropy source foo</quote> mean?
197         </para>
198       </question>
199       <answer>
200         <para>
201           The server requires a source of entropy to perform certain
202           operations, mostly DNSSEC related.  These messages indicate
203           that you have no source of entropy.  On systems with
204           /dev/random or an equivalent, it is used by default.  A
205           source of entropy can also be defined using the random-device
206           option in named.conf.
207         </para>
208       </answer>
209     </qandaentry>
210
211     <qandaentry>
212       <!-- configuration -->
213       <question>
214         <para>
215           I'm trying to use TSIG to authenticate dynamic updates or
216           zone transfers.  I'm sure I have the keys set up correctly,
217           but the server is rejecting the TSIG.  Why?
218         </para>
219       </question>
220       <answer>
221         <para>
222           This may be a clock skew problem.  Check that the the clocks
223           on the client and server are properly synchronised (e.g.,
224           using ntp).
225         </para>
226       </answer>
227     </qandaentry>
228
229     <qandaentry>
230       <question>
231         <para>
232           I see a log message like the following.  Why?
233         </para>
234         <para>
235           couldn't open pid file '/var/run/named.pid': Permission denied
236         </para>
237       </question>
238       <answer>
239         <para>
240           You are most likely running named as a non-root user, and
241           that user does not have permission to write in /var/run.
242           The common ways of fixing this are to create a /var/run/named
243           directory owned by the named user and set pid-file to
244           "/var/run/named/named.pid", or set pid-file to "named.pid",
245           which will put the file in the directory specified by the
246           directory option (which, in this case, must be writable by
247           the named user).
248         </para>
249       </answer>
250     </qandaentry>
251     
252     <qandaentry>
253       <question>
254         <para>
255           I can query the nameserver from the nameserver but not from other
256           machines.  Why?
257         </para>
258       </question>
259       <answer>
260         <para>
261           This is usually the result of the firewall configuration stopping
262           the queries and / or the replies.
263         </para>
264       </answer>
265     </qandaentry>
266     
267     <qandaentry>
268       <question>
269         <para>
270           How can I make a server a slave for both an internal and
271           an external view at the same time?  When I tried, both views
272           on the slave were transferred from the same view on the master.
273         </para>
274       </question>
275       <answer>
276         <para>
277           You will need to give the master and slave multiple IP
278           addresses and use those to make sure you reach the correct
279           view on the other machine.
280         </para>
281         <informalexample>
282           <programlisting>
283 Master: 10.0.1.1 (internal), 10.0.1.2 (external, IP alias)
284     internal:
285         match-clients { !10.0.1.2; !10.0.1.4; 10.0.1/24; };
286                 notify-source 10.0.1.1;
287                 transfer-source 10.0.1.1;
288                 query-source address 10.0.1.1;
289     external:
290         match-clients { any; };
291         recursion no;   // don't offer recursion to the world
292         notify-source 10.0.1.2;
293         transfer-source 10.0.1.2;
294         query-source address 10.0.1.2;
295
296 Slave: 10.0.1.3 (internal), 10.0.1.4 (external, IP alias)
297     internal:
298         match-clients { !10.0.1.2; !10.0.1.4; 10.0.1/24; };
299         notify-source 10.0.1.3;
300         transfer-source 10.0.1.3;
301         query-source address 10.0.1.3;
302    external:
303         match-clients { any; };
304         recursion no;   // don't offer recursion to the world
305         notify-source 10.0.1.4;
306         transfer-source 10.0.1.4;
307         query-source address 10.0.1.4;</programlisting>
308         </informalexample>
309         <para>
310           You put the external address on the alias so that all the other
311           dns clients on these boxes see the internal view by default.
312         </para>
313       </answer>
314       <answer>
315         <para>
316           BIND 9.3 and later: Use TSIG to select the appropriate view.
317         </para>
318         <informalexample>
319           <programlisting>
320 Master 10.0.1.1:
321         key "external" {
322                 algorithm hmac-md5;
323                 secret "xxxxxxxx";
324         };
325         view "internal" {
326                 match-clients { !key external; 10.0.1/24; };
327                 ...
328         };
329         view "external" {
330                 match-clients { key external; any; };
331                 server 10.0.1.2 { keys external; };
332                 recursion no;
333                 ...
334         };
335
336 Slave 10.0.1.2:
337         key "external" {
338                 algorithm hmac-md5;
339                 secret "xxxxxxxx";
340         };
341         view "internal" {
342                 match-clients { !key external; 10.0.1/24; };
343                 ...
344         };
345         view "external" {
346                 match-clients { key external; any; };
347                 server 10.0.1.1 { keys external; };
348                 recursion no;
349                 ...
350         };</programlisting>
351         </informalexample>
352       </answer>
353     </qandaentry>
354     
355     <qandaentry>
356       <question>
357         <para>
358           I get error messages like <quote>multiple RRs of singleton type</quote>
359           and <quote>CNAME and other data</quote> when transferring a zone.  What
360           does this mean?
361         </para>
362       </question>
363       <answer>
364         <para>
365           These indicate a malformed master zone.  You can identify
366           the exact records involved by transferring the zone using
367           dig then running named-checkzone on it.
368         </para>
369         <informalexample>
370           <programlisting>
371 dig axfr example.com @master-server &gt; tmp
372 named-checkzone example.com tmp</programlisting>
373         </informalexample>
374         <para>
375           A CNAME record cannot exist with the same name as another record
376           except for the DNSSEC records which prove its existence (NSEC).
377         </para>
378         <para>
379           RFC 1034, Section 3.6.2: <quote>If a CNAME RR is present at a node,
380           no other data should be present; this ensures that the data for a
381           canonical name and its aliases cannot be different.  This rule also
382           insures that a cached CNAME can be used without checking with an
383           authoritative server for other RR types.</quote>
384         </para>
385       </answer>
386     </qandaentry>
387     
388     <qandaentry>
389       <question>
390         <para>
391           I get error messages like <quote>named.conf:99: unexpected end
392           of input</quote> where 99 is the last line of named.conf.
393         </para>
394       </question>
395       <answer>
396         <para>
397           There are unbalanced quotes in named.conf.
398         </para>
399       </answer>
400       <answer>
401         <para>
402           Some text editors (notepad and wordpad) fail to put a line
403           title indication (e.g. CR/LF) on the last line of a
404           text file.  This can be fixed by "adding" a blank line to
405           the end of the file.  Named expects to see EOF immediately
406           after EOL and treats text files where this is not met as
407           truncated.
408         </para>
409       </answer>
410     </qandaentry>
411     
412     <qandaentry>
413       <question>
414         <para>
415           How do I share a dynamic zone between multiple views?
416         </para>
417       </question>
418       <answer>
419         <para>
420           You choose one view to be master and the second a slave and
421           transfer the zone between views.
422         </para>
423         <informalexample>
424           <programlisting>
425 Master 10.0.1.1:
426         key "external" {
427                 algorithm hmac-md5;
428                 secret "xxxxxxxx";
429         };
430
431         key "mykey" {
432                 algorithm hmac-md5;
433                 secret "yyyyyyyy";
434         };
435
436         view "internal" {
437                 match-clients { !key external; 10.0.1/24; };
438                 server 10.0.1.1 {
439                         /* Deliver notify messages to external view. */
440                         keys { external; };
441                 };
442                 zone "example.com" {
443                         type master;
444                         file "internal/example.db";
445                         allow-update { key mykey; };
446                         notify-also { 10.0.1.1; };
447                 };
448         };
449
450         view "external" {
451                 match-clients { key external; any; };
452                 zone "example.com" {
453                         type slave;
454                         file "external/example.db";
455                         masters { 10.0.1.1; };
456                         transfer-source { 10.0.1.1; };
457                         // allow-update-forwarding { any; };
458                         // allow-notify { ... };
459                 };
460         };</programlisting>
461         </informalexample>
462       </answer>
463     </qandaentry>
464
465     <qandaentry>
466       <question>
467         <para>
468           I get a error message like <quote>zone wireless.ietf56.ietf.org/IN:
469           loading master file primaries/wireless.ietf56.ietf.org: no
470           owner</quote>.
471         </para>
472       </question>
473       <answer>
474         <para>
475           This error is produced when a line in the master file
476           contains leading white space (tab/space) but the is no
477           current record owner name to inherit the name from.  Usually
478           this is the result of putting white space before a comment,
479           forgetting the "@" for the SOA record, or indenting the master
480           file.
481         </para>
482       </answer>
483     </qandaentry>
484
485     <qandaentry>
486       <question>
487         <para>
488           Why are my logs in GMT (UTC).
489         </para>
490       </question>
491       <answer>
492         <para>
493           You are running chrooted (-t) and have not supplied local timezone
494           information in the chroot area.
495         </para>
496         <simplelist>
497           <member>FreeBSD: /etc/localtime</member>
498           <member>Solaris: /etc/TIMEZONE and /usr/share/lib/zoneinfo</member>
499           <member>OSF: /etc/zoneinfo/localtime</member>
500           </simplelist>
501         <para>
502           See also tzset(3) and zic(8).
503         </para>
504       </answer>
505     </qandaentry>
506     
507     <qandaentry>
508       <question>
509         <para>
510           I get <quote>rndc: connect failed: connection refused</quote> when
511           I try to run rndc.
512         </para>
513       </question>
514       <answer>
515         <para>
516           This is usually a configuration error.
517         </para>
518         <para>
519           First ensure that named is running and no errors are being
520           reported at startup (/var/log/messages or equivalent).
521           Running "named -g &lt;usual arguments&gt;" from a title
522           can help at this point.
523         </para>
524         <para>
525           Secondly ensure that named is configured to use rndc either
526           by "rndc-confgen -a", rndc-confgen or manually.  The
527           Administrators Reference manual has details on how to do
528           this.
529         </para>
530         <para>
531           Old versions of rndc-confgen used localhost rather than
532           127.0.0.1 in /etc/rndc.conf for the default server.  Update
533           /etc/rndc.conf if necessary so that the default server
534           listed in /etc/rndc.conf matches the addresses used in
535           named.conf.  "localhost" has two address (127.0.0.1 and
536           ::1).
537         </para>
538         <para>
539           If you use "rndc-confgen -a" and named is running with -t or -u
540           ensure that /etc/rndc.conf has the correct ownership and that
541           a copy is in the chroot area.  You can do this by re-running
542           "rndc-confgen -a" with appropriate -t and -u arguments.
543         </para>
544       </answer>
545     </qandaentry>
546     
547     <qandaentry>
548       <question>
549         <para>
550           I get <quote>transfer of 'example.net/IN' from 192.168.4.12#53:
551           failed while receiving responses: permission denied</quote> error
552           messages.
553         </para>
554       </question>
555       <answer>
556         <para>
557           These indicate a filesystem permission error preventing
558           named creating / renaming the temporary file.  These will
559           usually also have other associated error messages like
560         </para>
561         <informalexample>
562           <programlisting>
563 "dumping master file: sl/tmp-XXXX5il3sQ: open: permission denied"</programlisting>
564         </informalexample>
565         <para>
566           Named needs write permission on the directory containing
567           the file.  Named writes the new cache file to a temporary
568           file then renames it to the name specified in named.conf
569           to ensure that the contents are always complete.  This is
570           to prevent named loading a partial zone in the event of
571           power failure or similar interrupting the write of the
572           master file.
573         </para>
574         <para>
575           Note file names are relative to the directory specified in
576           options and any chroot directory  ([&lt;chroot
577           dir&gt;/][&lt;options dir&gt;]).
578         </para>
579         <informalexample>
580           <para>
581             If named is invoked as "named -t /chroot/DNS" with
582             the following named.conf then "/chroot/DNS/var/named/sl"
583             needs to be writable by the user named is running as.
584           </para>
585           <programlisting>
586 options {
587         directory "/var/named";
588 };
589
590 zone "example.net" {
591         type slave;
592         file "sl/example.net";
593         masters { 192.168.4.12; };
594 };</programlisting>
595         </informalexample>
596       </answer>
597     </qandaentry>
598     
599     <qandaentry>
600       <question>
601         <para>
602           I want to forward all DNS queries from my caching nameserver to
603           another server. But there are some domains which have to be
604           served locally, via rbldnsd.
605         </para>
606         <para>
607           How do I achieve this ?
608         </para>
609       </question>
610       <answer>
611         <programlisting>
612 options {
613         forward only;
614         forwarders { &lt;ip.of.primary.nameserver&gt;; };
615 };
616
617 zone "sbl-xbl.spamhaus.org" {
618         type forward; forward only;
619         forwarders { &lt;ip.of.rbldns.server&gt; port 530; };
620 };
621
622 zone "list.dsbl.org" {
623         type forward; forward only;
624         forwarders { &lt;ip.of.rbldns.server&gt; port 530; };
625 };
626         </programlisting>
627       </answer>
628     </qandaentry>
629
630     <qandaentry>
631       <question>
632         <para>
633           Can you help me understand how BIND 9 uses memory to store
634           DNS zones?
635         </para>
636         <para>
637           Some times it seems to take several times the amount of
638           memory it needs to store the zone.
639         </para>
640       </question>
641       <answer>
642         <para>
643           When reloading a zone named my have multiple copies of
644           the zone in memory at one time.  The zone it is serving
645           and the one it is loading.  If reloads are ultra fast it
646           can have more still.
647         </para>
648         <para>
649           e.g.  Ones that are transferring out, the one that it is
650           serving and the one that is loading.
651         </para>
652         <para>
653           BIND 8 destroyed the zone before loading and also killed
654           off outgoing transfers of the zone.
655         </para>
656         <para>
657           The new strategy allows slaves to get copies of the new
658           zone regardless of how often the master is loaded compared
659           to the transfer time.  The slave might skip some intermediate
660           versions but the transfers will complete and it will keep
661           reasonably in sync with the master.
662         </para>
663         <para>
664           The new strategy also allows the master to recover from
665           syntax and other errors in the master file as it still
666           has an in-core copy of the old contents.
667         </para>
668       </answer>
669     </qandaentry>
670
671     <qandaentry>
672       <question>
673         <para>
674           I want to use IPv6 locally but I don't have a external IPv6
675           connection.  External lookups are slow.
676         </para>
677       </question>
678       <answer>
679         <para>
680           You can use server clauses to stop named making external lookups
681           over IPv6.
682         </para>
683         <programlisting>
684 server fd81:ec6c:bd62::/48 { bogus no; }; // site ULA prefix
685 server ::/0 { bogus yes; };
686 </programlisting>
687       </answer>
688     </qandaentry>
689     
690     </qandadiv> <!-- Configuration and Setup Questions -->
691     
692     <qandadiv><title>Operations Questions</title>
693
694     <qandaentry>
695       <question>
696         <para>
697           How to change the nameservers for a zone?
698         </para>
699       </question>
700       <answer>
701         <para>
702           Step 1: Ensure all nameservers, new and old, are serving the
703           same zone content.
704         </para>
705         <para>
706           Step 2: Work out the maximum TTL of the NS RRset in the parent and child
707           zones.  This is the time it will take caches to be clear of a
708           particular version of the NS RRset.
709           If you are just removing nameservers you can skip to Step 6.
710         </para>
711         <para>
712           Step 3: Add new nameservers to the NS RRset for the zone and
713           wait until all the servers for the zone are answering with this
714           new NS RRset.
715         </para>
716         <para>
717           Step 4: Inform the parent zone of the new NS RRset then wait for all the
718           parent servers to be answering with the new NS RRset.
719         </para>
720         <para>
721           Step 5: Wait for cache to be clear of the old NS RRset.
722           See Step 2 for how long.
723           If you are just adding nameservers you are done.
724         </para>
725         <para>
726           Step 6: Remove any old nameservers from the zones NS RRset and
727           wait for all the servers for the zone to be serving the new NS RRset.
728         </para>
729         <para>
730           Step 7: Inform the parent zone of the new NS RRset then wait for all the
731           parent servers to be answering with the new NS RRset.
732         </para>
733         <para>
734           Step 8: Wait for cache to be clear of the old NS RRset.
735           See Step 2 for how long.
736         </para>
737         <para>
738           Step 9: Turn off the old nameservers or remove the zone entry from
739           the configuration of the old nameservers.
740         </para>
741         <para>
742           Step 10: Increment the serial number and wait for the change to
743           be visible in all nameservers for the zone.  This ensures that
744           zone transfers are still working after the old servers are
745           decommissioned.
746         </para>
747         <para>
748           Note: the above procedure is designed to be transparent
749           to dns clients.  Decommissioning the old servers too early
750           will result in some clients not being able to look up
751           answers in the zone.
752         </para>
753         <para>
754           Note: while it is possible to run the addition and removal
755           stages together it is not recommended.
756         </para>
757       </answer>
758     </qandaentry>
759
760     </qandadiv> <!-- Operations Questions -->
761
762     <qandadiv><title>General Questions</title>
763             
764     <qandaentry>
765       <question>
766         <para>
767           I keep getting log messages like the following.  Why?
768         </para>
769         <para>
770           Dec  4 23:47:59 client 10.0.0.1#1355: updating zone
771           'example.com/IN': update failed: 'RRset exists (value
772           dependent)' prerequisite not satisfied (NXRRSET)
773         </para>
774       </question>
775       <answer>
776         <para>
777           DNS updates allow the update request to test to see if
778           certain conditions are met prior to proceeding with the
779           update.  The message above is saying that conditions were
780           not met and the update is not proceeding.  See doc/rfc/rfc2136.txt
781           for more details on prerequisites.
782         </para>
783       </answer>
784     </qandaentry>
785
786     <qandaentry>
787       <question>
788         <para>
789           I keep getting log messages like the following.  Why?
790         </para>
791         <para>
792           Jun 21 12:00:00.000 client 10.0.0.1#1234: update denied
793         </para>
794       </question>
795       <answer>
796         <para>
797           Someone is trying to update your DNS data using the RFC2136
798           Dynamic Update protocol.  Windows 2000 machines have a habit
799           of sending dynamic update requests to DNS servers without
800           being specifically configured to do so.  If the update
801           requests are coming from a Windows 2000 machine, see
802           <ulink
803            url="http://support.microsoft.com/support/kb/articles/q246/8/04.asp">
804   &lt;http://support.microsoft.com/support/kb/articles/q246/8/04.asp&gt;</ulink>
805           for information about how to turn them off.
806         </para>
807       </answer>
808     </qandaentry>
809             
810     <qandaentry>
811       <question>
812         <para>
813           When I do a "dig . ns", many of the A records for the root
814           servers are missing.  Why?
815         </para>
816       </question>
817       <answer>
818         <para>
819           This is normal and harmless.  It is a somewhat confusing
820           side effect of the way BIND 9 does RFC2181 trust ranking
821           and of the efforts BIND 9 makes to avoid promoting glue
822           into answers.
823         </para>
824         <para>
825          When BIND 9 first starts up and primes its cache, it receives
826          the root server addresses as additional data in an authoritative
827          response from a root server, and these records are eligible
828          for inclusion as additional data in responses.  Subsequently
829          it receives a subset of the root server addresses as
830          additional data in a non-authoritative (referral) response
831          from a root server.  This causes the addresses to now be
832          considered non-authoritative (glue) data, which is not
833          eligible for inclusion in responses.
834         </para>
835         <para>
836          The server does have a complete set of root server addresses
837          cached at all times, it just may not include all of them
838          as additional data, depending on whether they were last
839          received as answers or as glue.  You can always look up the
840          addresses with explicit queries like "dig a.root-servers.net A".
841         </para>
842       </answer>
843     </qandaentry>
844     
845     <qandaentry>
846       <question>
847         <para>
848           Why don't my zones reload when I do an "rndc reload" or SIGHUP?
849         </para>
850       </question>
851       <answer>
852         <para>
853           A zone can be updated either by editing zone files and
854           reloading the server or by dynamic update, but not both.
855           If you have enabled dynamic update for a zone using the
856           "allow-update" option, you are not supposed to edit the
857           zone file by hand, and the server will not attempt to reload
858           it.
859         </para>
860       </answer>
861     </qandaentry>
862     
863     <qandaentry>
864       <question>
865         <para>
866           Why is named listening on UDP port other than 53?
867         </para>
868       </question>
869       <answer>
870         <para>
871           Named uses a system selected port to make queries of other
872           nameservers.  This behaviour can be overridden by using
873           query-source to lock down the port and/or address.  See
874           also notify-source and transfer-source.
875         </para>
876       </answer>
877     </qandaentry>
878     
879     <qandaentry>
880       <question>
881         <para>
882           I get warning messages like <quote>zone example.com/IN: refresh:
883           failure trying master 1.2.3.4#53: timed out</quote>.
884         </para>
885       </question>
886       <answer>
887         <para>
888         Check that you can make UDP queries from the slave to the master
889         </para>
890         <informalexample>
891           <programlisting>
892 dig +norec example.com soa @1.2.3.4</programlisting>
893         </informalexample>
894         <para>
895           You could be generating queries faster than the slave can
896           cope with.  Lower the serial query rate.
897         </para>
898         <informalexample>
899           <programlisting>
900 serial-query-rate 5; // default 20</programlisting>
901         </informalexample>
902       </answer>
903     </qandaentry>
904
905     <qandaentry>            
906       <question>
907         <para>
908           I don't get RRSIG's returned when I use "dig +dnssec".
909         </para>
910       </question>
911       <answer>
912         <para>
913           You need to ensure DNSSEC is enabled (dnssec-enable yes;).
914         </para>
915       </answer>
916     </qandaentry>
917     
918     <qandaentry>
919       <question>
920         <para>
921           Can a NS record refer to a CNAME.
922         </para>
923       </question>
924       <answer>
925         <para>
926           No.  The rules for glue (copies of the *address* records
927           in the parent zones) and additional section processing do
928           not allow it to work.
929         </para>
930         <para>
931           You would have to add both the CNAME and address records
932           (A/AAAA) as glue to the parent zone and have CNAMEs be
933           followed when doing additional section processing to make
934           it work.  No nameserver implementation supports either of
935           these requirements.
936         </para>
937       </answer>
938     </qandaentry>
939
940     <qandaentry>
941       <question>
942         <para>
943           What does <quote>RFC 1918 response from Internet for
944           0.0.0.10.IN-ADDR.ARPA</quote> mean?
945         </para>
946       </question>
947       <answer>
948         <para>
949           If the IN-ADDR.ARPA name covered refers to a internal address
950           space you are using then you have failed to follow RFC 1918
951           usage rules and are leaking queries to the Internet.  You
952           should establish your own zones for these addresses to prevent
953           you querying the Internet's name servers for these addresses.
954           Please see <ulink url="http://as112.net/">&lt;http://as112.net/&gt;</ulink>
955           for details of the problems you are causing and the counter
956           measures that have had to be deployed.
957         </para>
958         <para>
959           If you are not using these private addresses then a client
960           has queried for them.  You can just ignore the messages,
961           get the offending client to stop sending you these messages
962           as they are most probably leaking them or setup your own zones
963           empty zones to serve answers to these queries.
964         </para>
965         <informalexample>
966           <programlisting>
967 zone "10.IN-ADDR.ARPA" {
968         type master;
969         file "empty";
970 };
971
972 zone "16.172.IN-ADDR.ARPA" {
973         type master;
974         file "empty";
975 };
976
977 ...
978
979 zone "31.172.IN-ADDR.ARPA" {
980         type master;
981         file "empty";
982 };
983
984 zone "168.192.IN-ADDR.ARPA" {
985         type master;
986         file "empty";
987 };
988
989 empty:
990 @ 10800 IN SOA &lt;name-of-server&gt;. &lt;contact-email&gt;. (
991                1 3600 1200 604800 10800 )
992 @ 10800 IN NS &lt;name-of-server&gt;.</programlisting>
993         </informalexample>
994         <para>
995         <note>
996           Future versions of named are likely to do this automatically.
997         </note>
998         </para>
999       </answer>
1000     </qandaentry>
1001     
1002     <qandaentry>
1003       <question>
1004         <para>
1005           Will named be affected by the 2007 changes to daylight savings
1006           rules in the US.
1007         </para>
1008       </question>
1009       <answer>
1010         <para>
1011           No, so long as the machines internal clock (as reported
1012           by "date -u") remains at UTC.  The only visible change
1013           if you fail to upgrade your OS, if you are in a affected
1014           area, will be that log messages will be a hour out during
1015           the period where the old rules do not match the new rules.
1016         </para>
1017         <para>
1018           For most OS's this change just means that you need to
1019           update the conversion rules from UTC to local time.
1020           Normally this involves updating a file in /etc (which
1021           sets the default timezone for the machine) and possibly
1022           a directory which has all the conversion rules for the
1023           world (e.g. /usr/share/zoneinfo).  When updating the OS
1024           do not forget to update any chroot areas as well.
1025           See your OS's documentation for more details.
1026         </para>
1027         <para>
1028           The local timezone conversion rules can also be done on
1029           a individual basis by setting the TZ environment variable
1030           appropriately.  See your OS's documentation for more
1031           details.
1032         </para>
1033       </answer>
1034     </qandaentry>
1035
1036     <qandaentry>
1037       <question>
1038         <para>
1039           Is there a bugzilla (or other tool) database that mere
1040           mortals can have (read-only) access to for bind?
1041         </para>
1042       </question>
1043       <answer>
1044         <para>
1045           No.  The BIND 9 bug database is kept closed for a number
1046           of reasons.  These include, but are not limited to, that
1047           the database contains proprietory information from people
1048           reporting bugs.  The database has in the past and may in
1049           future contain unfixed bugs which are capable of bringing
1050           down most of the Internet's DNS infrastructure.
1051         </para>
1052         <para>
1053           The release pages for each version contain up to date
1054           lists of bugs that have been fixed post release.  That
1055           is as close as we can get to providing a bug database.
1056         </para>
1057       </answer>
1058     </qandaentry>
1059
1060     <qandaentry>
1061       <question>
1062         <para>
1063           Why do queries for NSEC3 records fail to return the NSEC3 record?
1064         </para>
1065       </question>
1066       <answer>
1067         <para>
1068           NSEC3 records are strictly meta data and can only be
1069           returned in the authority section.  This is done so that
1070           signing the zone using NSEC3 records does not bring names
1071           into existence that do not exist in the unsigned version
1072           of the zone.
1073         </para>
1074       </answer>
1075     </qandaentry>
1076
1077     </qandadiv> <!-- General Questions -->
1078     
1079     <qandadiv><title>Operating-System Specific Questions</title>
1080             
1081     <qandadiv><title>HPUX</title>
1082
1083     <qandaentry>
1084       <question>
1085         <para>I get the following error trying to configure BIND:
1086 <programlisting>checking if unistd.h or sys/types.h defines fd_set... no
1087 configure: error: need either working unistd.h or sys/select.h</programlisting>
1088         </para>
1089       </question>
1090       <answer>
1091         <para>
1092           You have attempted to configure BIND with the bundled C compiler.
1093           This compiler does not meet the minimum compiler requirements to
1094           for building BIND.  You need to install a ANSI C compiler and / or
1095           teach configure how to find the ANSI C compiler.  The later can
1096           be done by adjusting the PATH environment variable and / or
1097           specifying the compiler via CC.
1098         </para>
1099         <informalexample>
1100           <programlisting>./configure CC=&lt;compiler&gt; ...</programlisting>
1101         </informalexample>
1102       </answer>
1103     </qandaentry>
1104
1105     </qandadiv> <!-- HPUX -->
1106
1107     <qandadiv><title>Linux</title>
1108             
1109     <qandaentry>
1110       <question> 
1111         <para>
1112           Why do I get the following errors:
1113 <programlisting>general: errno2result.c:109: unexpected error:
1114 general: unable to convert errno to isc_result: 14: Bad address
1115 client: UDP client handler shutting down due to fatal receive error: unexpected error</programlisting>
1116         </para>
1117       </question>
1118       <answer>
1119         <para>
1120           This is the result of a Linux kernel bug.
1121         </para>
1122         <para>
1123           See:
1124           <ulink url="http://marc.theaimsgroup.com/?l=linux-netdev&amp;m=113081708031466&amp;w=2">&lt;http://marc.theaimsgroup.com/?l=linux-netdev&amp;m=113081708031466&amp;w=2&gt;</ulink>
1125         </para>
1126       </answer>
1127     </qandaentry>
1128
1129     <qandaentry>
1130       <question>
1131         <para>
1132           Why does named lock up when it attempts to connect over IPSEC tunnels?
1133         </para>
1134       </question>
1135       <answer>
1136         <para>
1137           This is due to a kernel bug where the fact that a socket is marked
1138           non-blocking is ignored.  It is reported that setting
1139           xfrm_larval_drop to 1 helps but this may have negative side effects.
1140           See:
1141 <ulink url="https://bugzilla.redhat.com/show_bug.cgi?id=427629">&lt;https://bugzilla.redhat.com/show_bug.cgi?id=427629&gt;</ulink>
1142           and
1143 <ulink url="http://lkml.org/lkml/2007/12/4/260">&lt;http://lkml.org/lkml/2007/12/4/260&gt;</ulink>.
1144         </para>
1145         <para>
1146         xfrm_larval_drop can be set to 1 by the following procedure:
1147 <programlisting>
1148 echo "1" &gt; proc/sys/net/core/xfrm_larval_drop</programlisting>
1149         </para>
1150       </answer>
1151     </qandaentry>
1152
1153     <qandaentry>
1154       <question>
1155         <para>
1156           Why do I see 5 (or more) copies of named on Linux?
1157         </para>
1158       </question>
1159       <answer>
1160         <para>
1161           Linux threads each show up as a process under ps.  The
1162           approximate number of threads running is n+4, where n is
1163           the number of CPUs.  Note that the amount of memory used
1164           is not cumulative; if each process is using 10M of memory,
1165           only a total of 10M is used.
1166         </para>
1167         <para>
1168           Newer versions of Linux's ps command hide the individual threads
1169           and require -L to display them.
1170         </para>
1171       </answer>
1172     </qandaentry>
1173     
1174     <qandaentry>
1175       <question>
1176         <para>
1177           Why does BIND 9 log <quote>permission denied</quote> errors accessing
1178           its configuration files or zones on my Linux system even
1179           though it is running as root?
1180         </para>
1181       </question>
1182       <answer>
1183         <para>
1184           On Linux, BIND 9 drops most of its root privileges on
1185           startup.  This including the privilege to open files owned
1186           by other users.  Therefore, if the server is running as
1187           root, the configuration files and zone files should also
1188           be owned by root.
1189         </para>
1190       </answer>
1191     </qandaentry>
1192     
1193     <qandaentry>
1194       <question>
1195         <para>
1196           I get the error message <quote>named: capset failed: Operation
1197           not permitted</quote> when starting named.
1198         </para>
1199       </question>
1200       <answer>
1201         <para>
1202           The capability module, part of "Linux Security Modules/LSM",
1203           has not been loaded into the kernel.  See insmod(8), modprobe(8).
1204         </para>
1205         <para>
1206           The relevant modules can be loaded by running:
1207 <programlisting>
1208 modprobe commoncap
1209 modprobe capability</programlisting>
1210         </para>
1211       </answer>
1212     </qandaentry>
1213     
1214     <qandaentry>
1215       <question>
1216         <para>
1217            I'm running BIND on Red Hat Enterprise Linux or Fedora Core -
1218         </para>
1219         <para>
1220           Why can't named update slave zone database files?
1221         </para>
1222         <para>
1223           Why can't named create DDNS journal files or update
1224           the master zones from journals?
1225         </para>
1226         <para>
1227           Why can't named create custom log files?
1228         </para>
1229       </question>
1230
1231       <answer>
1232         <para>
1233           Red Hat Security Enhanced Linux (SELinux) policy security
1234           protections :
1235         </para>
1236
1237         <para>
1238            Red Hat have adopted the National Security Agency's
1239            SELinux security policy (see <ulink
1240    url="http://www.nsa.gov/selinux">&lt;http://www.nsa.gov/selinux&gt;</ulink>)
1241            and recommendations for BIND security , which are more
1242            secure than running named in a chroot and make use of
1243            the bind-chroot environment unnecessary .
1244         </para>
1245
1246         <para>
1247           By default, named is not allowed by the SELinux policy
1248           to write, create or delete any files EXCEPT in these
1249           directories:
1250           <informalexample>
1251             <programlisting>
1252 $ROOTDIR/var/named/slaves
1253 $ROOTDIR/var/named/data
1254 $ROOTDIR/var/tmp
1255             </programlisting>
1256           </informalexample>
1257           where $ROOTDIR may be set in /etc/sysconfig/named if
1258           bind-chroot is installed.
1259         </para>
1260
1261         <para>
1262           The SELinux policy particularly does NOT allow named to modify
1263           the $ROOTDIR/var/named directory, the default location for master
1264           zone database files.
1265         </para>
1266
1267         <para>
1268           SELinux policy overrules file access permissions - so
1269           even if all the files under /var/named have ownership
1270           named:named and mode rw-rw-r--, named will still not be
1271           able to write or create files except in the directories
1272           above, with SELinux in Enforcing mode.
1273         </para>
1274   
1275         <para>
1276           So, to allow named to update slave or DDNS zone files,
1277           it is best to locate them in $ROOTDIR/var/named/slaves,
1278           with named.conf zone statements such as:
1279           <informalexample>
1280             <programlisting>
1281 zone "slave.zone." IN {
1282         type slave;
1283         file "slaves/slave.zone.db";
1284         ...
1285 };   
1286 zone "ddns.zone." IN  {
1287         type master;
1288         allow-updates {...};
1289         file "slaves/ddns.zone.db";
1290 };
1291             </programlisting>
1292           </informalexample>
1293         </para>
1294
1295         <para>
1296           To allow named to create its cache dump and statistics
1297           files, for example, you could use named.conf options
1298           statements such as:
1299           <informalexample>
1300             <programlisting>
1301 options {
1302         ...
1303         dump-file "/var/named/data/cache_dump.db";
1304         statistics-file "/var/named/data/named_stats.txt";
1305         ...
1306 };
1307             </programlisting>
1308           </informalexample>
1309         </para>
1310
1311         <para>
1312           You can also tell SELinux to allow named to update any
1313           zone database files, by setting the SELinux tunable boolean
1314           parameter 'named_write_master_zones=1', using the
1315           system-config-securitylevel GUI, using the 'setsebool'
1316           command, or in /etc/selinux/targeted/booleans.
1317         </para>
1318   
1319         <para>
1320           You can disable SELinux protection for named entirely by
1321           setting the 'named_disable_trans=1' SELinux tunable boolean
1322           parameter.
1323         </para>
1324     
1325         <para>
1326           The SELinux named policy defines these SELinux contexts for named:
1327           <informalexample>
1328             <programlisting>
1329 named_zone_t : for zone database files       - $ROOTDIR/var/named/*
1330 named_conf_t : for named configuration files - $ROOTDIR/etc/{named,rndc}.*
1331 named_cache_t: for files modifiable by named - $ROOTDIR/var/{tmp,named/{slaves,data}}
1332             </programlisting>
1333           </informalexample>
1334         </para>
1335    
1336         <para>
1337           If you want to retain use of the SELinux policy for named,
1338           and put named files in different locations, you can do
1339           so by changing the context of the custom file locations
1340           .
1341         </para>
1342
1343         <para>
1344           To create a custom configuration file location, e.g.
1345           '/root/named.conf', to use with the 'named -c' option,
1346           do:
1347           <informalexample>
1348             <programlisting>
1349 # chcon system_u:object_r:named_conf_t /root/named.conf
1350             </programlisting>
1351           </informalexample>
1352         </para>
1353   
1354         <para>
1355           To create a custom modifiable named data location, e.g.
1356           '/var/log/named' for a log file, do:
1357           <informalexample>
1358             <programlisting>
1359 # chcon system_u:object_r:named_cache_t /var/log/named
1360             </programlisting>
1361           </informalexample>
1362         </para>
1363    
1364         <para>
1365    To create a custom zone file location, e.g. /root/zones/, do:
1366           <informalexample>
1367             <programlisting>
1368 # chcon system_u:object_r:named_zone_t /root/zones/{.,*}
1369             </programlisting>
1370           </informalexample>
1371         </para>
1372   
1373         <para>
1374           See these man-pages for more information : selinux(8),
1375           named_selinux(8), chcon(1), setsebool(8)
1376         </para>
1377       </answer>
1378     </qandaentry>
1379
1380     <qandaentry>
1381       <question>
1382         <para>
1383           Listening on individual IPv6 interfaces does not work.
1384         </para>
1385       </question>
1386       <answer>
1387         <para>
1388           This is usually due to "/proc/net/if_inet6" not being available
1389           in the chroot file system.  Mount another instance of "proc"
1390           in the chroot file system.
1391         </para>
1392         <para>
1393           This can be be made permanent by adding a second instance to
1394           /etc/fstab.
1395           <informalexample>
1396             <programlisting>
1397 proc /proc           proc defaults 0 0
1398 proc /var/named/proc proc defaults 0 0</programlisting>
1399           </informalexample>
1400         </para>
1401       </answer>
1402     </qandaentry>
1403     
1404     </qandadiv> <!-- Linux -->
1405     
1406     <qandadiv><title>Windows</title>
1407             
1408     <qandaentry>
1409       <question>
1410         <para>
1411           Zone transfers from my BIND 9 master to my Windows 2000
1412           slave fail.  Why?
1413         </para>
1414       </question>
1415       <answer>
1416         <para>
1417           This may be caused by a bug in the Windows 2000 DNS server
1418           where DNS messages larger than 16K are not handled properly.
1419           This can be worked around by setting the option "transfer-format
1420           one-answer;".  Also check whether your zone contains domain
1421           names with embedded spaces or other special characters,
1422           like "John\032Doe\213s\032Computer", since such names have
1423           been known to cause Windows 2000 slaves to incorrectly
1424           reject the zone.
1425         </para>
1426       </answer>
1427     </qandaentry>
1428     
1429     <qandaentry>
1430       <question>
1431         <para>
1432           I get <quote>Error 1067</quote> when starting named under Windows.
1433         </para>
1434       </question>
1435       <answer>
1436         <para>
1437           This is the service manager saying that named exited.   You
1438           need to examine the Application log in the EventViewer to
1439           find out why.
1440         </para>
1441         <para>
1442           Common causes are that you failed to create "named.conf"
1443           (usually "C:\windows\dns\etc\named.conf") or failed to
1444           specify the directory in named.conf.
1445         </para>
1446         <informalexample>
1447           <programlisting>
1448 options {
1449         Directory "C:\windows\dns\etc";
1450 };</programlisting>
1451         </informalexample>
1452       </answer>
1453     </qandaentry>
1454             
1455     </qandadiv> <!-- Windows -->
1456     
1457     <qandadiv><title>FreeBSD</title>
1458             
1459     <qandaentry>
1460       <question>
1461         <para>
1462           I have FreeBSD 4.x and "rndc-confgen -a" just sits there.
1463         </para>
1464       </question>
1465       <answer>
1466         <para>
1467           /dev/random is not configured.  Use rndcontrol(8) to tell
1468           the kernel to use certain interrupts as a source of random
1469           events.  You can make this permanent by setting rand_irqs
1470           in /etc/rc.conf.
1471         </para>
1472         <informalexample>
1473           <programlisting>
1474 rand_irqs="3 14 15"</programlisting>
1475         </informalexample>
1476         <para>
1477           See also
1478           <ulink url="http://people.freebsd.org/~dougb/randomness.html">
1479           &lt;http://people.freebsd.org/~dougb/randomness.html&gt;</ulink>.
1480         </para>
1481       </answer>
1482     </qandaentry>
1483     
1484     </qandadiv> <!-- FreeBSD -->
1485     
1486     <qandadiv><title>Solaris</title>
1487             
1488     <qandaentry>
1489       <question>
1490         <para>
1491           How do I integrate BIND 9 and Solaris SMF
1492         </para>
1493       </question>
1494       <answer>
1495         <para>
1496           Sun has a blog entry describing how to do this.
1497         </para>
1498         <para>
1499           <ulink
1500           url="http://blogs.sun.com/roller/page/anay/Weblog?catname=%2FSolaris">
1501          &lt;http://blogs.sun.com/roller/page/anay/Weblog?catname=%2FSolaris&gt;
1502           </ulink>
1503         </para>
1504       </answer>
1505     </qandaentry>
1506     
1507     </qandadiv>
1508
1509     <qandadiv><title>Apple Mac OS X</title>
1510
1511     <qandaentry>
1512       <question>
1513         <para>
1514           How do I run BIND 9 on Apple Mac OS X?
1515         </para>
1516       </question>
1517       <answer>
1518         <para>
1519          If you run Tiger(Mac OS 10.4) or later then this is all you need to do:
1520         </para>
1521         <informalexample>
1522           <programlisting>
1523 % sudo rndc-confgen  > /etc/rndc.conf</programlisting>
1524         </informalexample>
1525         <para>
1526           Copy the key statement from /etc/rndc.conf into /etc/rndc.key, e.g.:
1527         </para>
1528         <informalexample>
1529           <programlisting>
1530 key "rndc-key" {
1531         algorithm hmac-md5;
1532         secret "uvceheVuqf17ZwIcTydddw==";
1533 };</programlisting>
1534         </informalexample>
1535         <para>
1536           Then start the relevant service:
1537         </para>
1538         <informalexample>
1539           <programlisting>
1540 % sudo service org.isc.named start</programlisting>
1541         </informalexample>
1542         <para>
1543           This is persistent upon a reboot, so you will have to do it only once.
1544         </para>
1545       </answer>
1546
1547       <answer>
1548         <para>
1549          Alternatively you can just generate /etc/rndc.key by running:
1550         </para>
1551         <informalexample>
1552           <programlisting>
1553 % sudo rndc-confgen -a</programlisting>
1554         </informalexample>
1555         <para>
1556           Then start the relevant service:
1557         </para>
1558         <informalexample>
1559           <programlisting>
1560 % sudo service org.isc.named start</programlisting>
1561         </informalexample>
1562         <para>
1563           Named will look for /etc/rndc.key when it starts if it
1564           doesn't have a controls section or the existing controls are
1565           missing keys sub-clauses.  This is persistent upon a
1566           reboot, so you will have to do it only once.
1567         </para>
1568       </answer>
1569     </qandaentry>
1570
1571     </qandadiv>
1572     
1573     </qandadiv> <!-- Operating-System Specific Questions -->
1574
1575   </qandaset>
1576 </article>