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