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