home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / internet / tcp-ip / domains-faq / part2 < prev   
Encoding:
Internet Message Format  |  1998-12-17  |  83.1 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!news.kodak.com!news-nysernet-16.sprintlink.net!news-in-east1.sprintlink.net!news.sprintlink.net!newshub.northeast.verio.net!news.idt.net!newsin.iconnet.net!IConNet!not-for-mail
  2. From: cdp2582@hertz.njit.edu (Chris Peckham)
  3. Newsgroups: comp.protocols.tcp-ip.domains,comp.answers,news.answers,comp.protocols.dns.bind
  4. Subject: comp.protocols.tcp-ip.domains Frequently Asked Questions (FAQ) (Part 2 of 2)
  5. Supersedes: <cptd-faq-2-911181667@njit.edu>
  6. Followup-To: comp.protocols.tcp-ip.domains
  7. Organization: NJIT.EDU - New Jersey Institute of Technology, Newark, NJ, USA
  8. Lines: 2050
  9. Sender: cdp@chipmunk.iconnet.net
  10. Approved: news-answers-request@MIT.EDU
  11. Distribution: world
  12. Expires: Wednesday, 20 Jan 99 11:47:26 EDT
  13. Message-ID: <cptd-faq-2-913826846@njit.edu>
  14. References: <cptd-faq-1-913826846@njit.edu>
  15. Reply-To: domain-faq@pfmc.net (comp.protocols.tcp-ip.domains FAQ comments)
  16. Keywords: BIND,DOMAIN,DNS
  17. X-Posting-Frequency: posted during the first week of each month
  18. Date: Wed, 16 Dec 1998 16:47:32 GMT
  19. NNTP-Posting-Host: chipmunk.iconnet.net
  20. NNTP-Posting-Date: Wed, 16 Dec 1998 11:47:32 EDT
  21. Xref: senator-bedfellow.mit.edu comp.protocols.tcp-ip.domains:22180 comp.answers:34269 news.answers:146737 comp.protocols.dns.bind:6040
  22.  
  23. Posted-By: auto-faq 3.3 beta (Perl 5.004)
  24. Archive-name: internet/tcp-ip/domains-faq/part2
  25.  
  26. (Continued from Part 1, where you'll find the introduction and 
  27. table of contents.)
  28.  
  29.  
  30. ===============================================================================
  31.  
  32. Section 5.  CONFIGURATION
  33.  
  34.  Q5.1        Upgrading from 4.9.x to 8.x 
  35.  Q5.2        Changing a Secondary server to a Primary server ?
  36.  Q5.3        Moving a Primary server to another server
  37.  Q5.4        How do I subnet a Class B Address ?
  38.  Q5.5        Subnetted domain name service
  39.  Q5.6        Recommended format/style of DNS files
  40.  Q5.7        DNS on a system not connected to the Internet
  41.  Q5.8        Multiple Domain configuration
  42.  Q5.9        wildcard MX records
  43.  Q5.10       How do you identify a wildcard MX record ?
  44.  Q5.11       Why are fully qualified domain names recommended ?
  45.  Q5.12       Distributing load using named
  46.  Q5.13       Round robin IS NOT load balancing
  47.  Q5.14       Order of returned records
  48.  Q5.15       resolv.conf
  49.  Q5.16       How do I delegate authority for sub-domains ?
  50.  Q5.17       DNS instead of NIS on a Sun OS 4.1.x system
  51.  Q5.18       Patches to add functionality to BIND 
  52.  Q5.19       How to serve multiple domains from one server
  53.  Q5.20       hostname and domain name the same
  54.  Q5.21       Restricting zone transfers
  55.  Q5.22       DNS in firewalled and private networks
  56.  Q5.23       Different DNS answers for same RR
  57.  
  58. -----------------------------------------------------------------------------
  59.  
  60. Question 5.1.  Upgrading from 4.9.x to 8.x
  61.  
  62. Date: Wed Jul  9 22:00:07 EDT 1997
  63.  
  64. Q: Help !  How do I use the Completely new configuration syntax in BIND 8
  65. ? I've attempted to upgrade bind from 4.9.5 to 8.1, but unfortunately it
  66. didn't seem to like the same config/zone files.. is this normal or should
  67. 8.1 be able to read the same files as 4.9.5 did?
  68.  
  69. A: If you then look in doc/html/config.html, you will find directions on
  70. how to convert a 4.9.x .boot file to 8.x .conf file, as well as directions
  71. on how to utilize all of the new features of the 8.x .conf file format.
  72.  
  73. -----------------------------------------------------------------------------
  74.  
  75. Question 5.2.  Changing a Secondary server to a Primary server ?
  76.  
  77. Date: Fri Jul  5 23:54:35 EDT 1996
  78.  
  79. For 4.8.3,  it's prudent to kill and restart following any changes to
  80. named.boot.
  81.  
  82. In BIND 4.9.3, you only have to kill and restart named if you change a
  83. primary zone to a secondary or v-v, or if you delete a zone and remain
  84. authoritative for its parent.  Every other case should be taken care of by
  85. a HUP.  (Ed. note: 4.9.3b9 may still require you to kill and restart the
  86. server due to some bugs in the HUP code).
  87.  
  88. You will also need to update the server information on the root servers.
  89. You can do this by filing a new domain registration form to inform
  90. InterNIC of the change.  They will then update the root server's SOA
  91. records.  This process usually takes 10-12 business days after they
  92. receive the request.
  93.  
  94. -----------------------------------------------------------------------------
  95.  
  96. Question 5.3.  Moving a Primary server to another server
  97.  
  98. Date: Fri Jul  5 23:54:35 EDT 1996
  99.  
  100. The usual solution is to move the primary to ns.newserver.com, and have
  101. ns.oldserver.com be configured as a secondary server until the change  to
  102. the root servers takes place after the request has been made to the
  103. InterNIC.
  104.  
  105. If you are moving to a different ISP which will change your IP's, the
  106. recommend setting for the SOA that would minimize problems for your name
  107. servers using the old settings can be done as follows:
  108.  
  109. Gradually lower the TTL value in your SOA (that's the last one of the five
  110. numbers) to always be equal to the time left until you change over.
  111. (assuming that none of your resource records have individual TTL's set, if
  112. so, do likewise with them.)  So, the day before, lower  to 43200 seconds
  113. (12 hours).  Then lower every few hours to be the time  remaining until
  114. the change-over.  So, an hour before the change, you may  just want to
  115. lower it all the way to 60 seconds or so.  That way no one  can cache
  116. information past the change-over.
  117.  
  118. After the change, start gradually incrementing the TTL value, because
  119. you'll probably be making changes to work out problems.  Once everything
  120. stabilizes, move the TTL up to whatever your normal values are.
  121.  
  122. To minimize name servers from using the "old settings", you can do the
  123. same thing with the "refresh" interval in the SOA (the second number of
  124. the SOA).  That will tell the secondaries to refresh every X seconds.
  125. Lower that value as you approach the changeover date.  You probably don't
  126. want to go much below an hour or you'll start the primary thrashing as all
  127. the secondaries perpetually refresh.
  128.  
  129. Also see the answer to the "How can I change the IP address of our server
  130. ?" in the INTRODUCTION section.
  131.  
  132. -----------------------------------------------------------------------------
  133.  
  134. Question 5.4.  How do I subnet a Class B Address ?
  135.  
  136. Date: Mon Jun 15 23:21:39 EDT 1998
  137.  
  138. That you need to subnet at all is something of a misconception.  You can
  139. also think of a class B network as giving you 65,534 individual hosts, and
  140. such a network will work. You can also configure your class B as 16,384
  141. networks of 2 hosts each.  That's obviously not very practical, but it
  142. needs to be made clear that you are not constrained by the size of an
  143. octet (remember that many older devices would not work in a network
  144. configured in this manner).
  145.  
  146. So, the question is: why do you need to subnet?   One reason is that it is
  147. easier to manage a subnetted network, and in fact, you can delegate the
  148. responsibility for address space management to local administrators on the
  149. various subnets.  Also, IP based problems will end up localized rather
  150. than affecting your entire network.
  151.  
  152. If your network is a large backbone with numerous segments individually
  153. branching off the backbone, that too suggests subnetting.
  154.  
  155. Subnetting can also be used to improve routing conditions.
  156.  
  157. You may wish to partition your network to disallow certain protocols  on
  158. certain segments of your net.  You can, for example, restrict IP or IPX to
  159. certain segments only by adding a router routing high level  protocols,
  160. and across the router you may have to subnet.
  161.  
  162. Finally, as far as how many subnets you need depends on the answer to the
  163. above question.  As far as subnet masks are concerned, the mask can be
  164. anything from 255.0.0.0 to 255.255.255.252.  You'll probably be looking at
  165. 9 or 10 bits for the subnet (last octet 128 or 192 respectively).  RFC
  166. 1219 discusses the issue of subnetting very well  and leaves the network
  167. administrator with a large amount of flexibility for future growth.
  168.  
  169. (The following section was contributed by Berislav Todorovic.)
  170.  
  171. A user or an ISP, having a whole /16 sized IP block (former "Class B")
  172. network assigned/allocated, has the responsibility of maintaining the
  173. reverse domain for the whole network. That policy is currently applied by
  174. all regional Internet registries (RIPE NCC, ARIN, APNIC). In other words,
  175. if you're assigned a whole "B class" (say, 10.91/16), you're in charge for
  176. the whole 91.10.IN-ADDR.ARPA zone. This zone may be organized using two
  177. methods, according to the network topology being in use.
  178.  
  179. The first, "brute force" method is to place all PTR records directly into
  180. a single zone file. Example:
  181.  
  182.    $origin  91.10.in-addr.arpa
  183.    @        IN   SOA   (usual stuff)
  184.             IN   NS    ns1.mydomain.com.
  185.             IN   NS    ns2.mydomain.com.
  186.  
  187.    1.1      IN   PTR   one-1.mydomain.com.       ; ---> 10.91.1.1
  188.    2.1      IN   PTR   one-2.mydomain.com.       ; ---> 10.91.1.2
  189.    ...
  190.    254.1    IN   PTR   one-254.mydomain.com.     ; ---> 10.91.1.254
  191.    1.2      IN   PTR   two-1.mydomain.com.       ; ---> 10.91.2.1
  192.  
  193. While this approach may look simple in the networks with a central
  194. management authority (say, campus networks), maintaining such a zone file
  195. becomes more and more difficult in the more complex environment.  Thus,
  196. this becomes a bad method. Furthermore, if you're an ISP, it is more
  197. likely that a /16 network will be subnetted and its subnets be assigned to
  198. your customers.
  199.  
  200. Therefore, another "smarter" approach is to delegate portions of the
  201. reverse domain 91.10.IN-ADDR.ARPA to the end users of the subnets of
  202. 10.91/16. There would only be NS records in the zone file, while PTR
  203. record insertion would be the responsibility of the end users. For
  204. example, if you assign:
  205.  
  206.    * 10.91.0.0/22  (10.91.0.0 - 10.91.3.255) to Customer-A.COM
  207.    * 10.91.4.0/23  (10.91.4.0 - 10.91.5.255) to Customer-B.COM
  208.    * 10.91.7.0/24  (10.91.7.0 - 10.91.7.255) to Customer-C.COM
  209.  
  210. then each customer will maintain zone files for the reverse domains of
  211. their own networks (say, Customer C will maintain the zone
  212. 7.91.10.IN-ADDR.ARPA, customer B their 2 zones, Customer A their own 4
  213. zones).  In this constellation, the zone file for reverse domain
  214. 91.10.IN-ADDR.ARPA will look like this:
  215.  
  216.    $origin  91.10.in-addr.arpa
  217.    @        IN   SOA   (usual stuff)
  218.             IN   NS    ns1.mydomain.com.
  219.             IN   NS    ns2.mydomain.com.
  220.  
  221.    ; --- Customer-A.COM
  222.  
  223.  
  224.    0        IN   NS    ns.customer-A.com.
  225.             IN   NS    ns1.mydomain.com.
  226.    1        IN   NS    ns.customer-A.com.
  227.             IN   NS    ns1.mydomain.com.
  228.    2        IN   NS    ns.customer-A.com.
  229.             IN   NS    ns1.mydomain.com.
  230.    3        IN   NS    ns.customer-A.com.
  231.             IN   NS    ns1.mydomain.com.
  232.  
  233.    ; --- Customer-B.COM
  234.  
  235.    4        IN   NS    ns.customer-B.com.
  236.             IN   NS    ns1.mydomain.com.
  237.    5        IN   NS    ns.customer-B.com.
  238.             IN   NS    ns1.mydomain.com.
  239.  
  240.    ; --- Customer-C.COM
  241.  
  242.    7        IN   NS    ns.customer-C.com.
  243.             IN   NS    ns1.mydomain.com.
  244.  
  245. The zone file of the Customer C reverse domain would look like this:
  246.  
  247.    $origin  7.91.10.in-addr.arpa
  248.    @        IN   SOA   (usual stuff)
  249.             IN   NS    ns.customer-C.com.
  250.             IN   NS    ns1.mydomain.com.
  251.  
  252.    1        IN   PTR   one.customer-C.com.
  253.    2        IN   PTR   two.customer-C.com.
  254.    3        IN   PTR   three.customer-C.com.
  255.    ...
  256.  
  257. -----------------------------------------------------------------------------
  258.  
  259. Question 5.5.  Subnetted domain name service
  260.  
  261. Date: Thu Jul 16 10:50:41 EDT 1998
  262.  
  263. If you are looking for some examples of handling subnetted class C
  264. networks as separate DNS domains, see RFC 2317 for more information.
  265.  
  266. Details follow- You need to delegate down to the fourth octet, so you will
  267. have one domain per IP address !  Here is how you can subdelegate a
  268. in-addr.arpa address for non-byte aligned subnet masks:
  269.  
  270. Take as an example the net 192.1.1.x, and example subnet mask
  271. 255.255.255.240.
  272.  
  273. We first define the domain for the class C net,
  274.  
  275.    $origin  1.1.192.in-addr.arpa
  276.    @       SOA   (usual stuff)
  277.    @       ns  some.nameserver
  278.            ns  some.other.nameserver
  279.    ; delegate a subdomain
  280.    one     ns  one.nameserver
  281.            ns  some.nameserver
  282.    ; delegate another
  283.    two     ns  two.nameserver
  284.            ns  some.nameserver
  285.    ; CNAME pointers to subdomain one
  286.    0       CNAME 0.one
  287.    1       CNAME 1.one
  288.    ;    through
  289.    15      CNAME 15.one
  290.    ; CNAME pointers to subdomain two
  291.    16      CNAME 16.two
  292.    17      CNAME 17.two
  293.    31      CNAME 31.two
  294.    ; CNAME as many as required.
  295.  
  296. Now, in the delegated nameserver, one.nameserver
  297.  
  298.    $origin one.1.1.192.in-addr.arpa
  299.    @       SOA (usual stuff)
  300.            NS  one.nameserver
  301.            NS  some.nameserver   ;  secondary for us
  302.    0       PTR  onenet.one.domain
  303.    1       PTR  onehost.one.domain
  304.    ;   through
  305.    15      PTR  lasthost.one.domain
  306.  
  307. And similar for the two.1.1.192.in-addr.arpa delegated domain.
  308.  
  309. There is additional documentation and a perl script that may be used for
  310. this purpose available for anonymous ftp from:
  311.  
  312. ftp.is.co.za : /networking/ip/dns/gencidrzone/gencidrzone
  313.  
  314. -----------------------------------------------------------------------------
  315.  
  316. Question 5.6.  Recommended format/style of DNS files
  317.  
  318. Date: Sun Nov 27 23:32:41 EST 1994
  319.  
  320. This answer is quoted from an article posted by Paul Vixie:
  321.  
  322.    I've gone back and forth on the question of whether the BOG should
  323.    include a section on this topic.  I know what I myself prefer, but
  324.    I'm wary of ramming my own stylistic preferences down the throat of
  325.    every BOG reader.  But since you ask :-)...
  326.  
  327.    Create /var/named.  If your system is too old to have a /var, either
  328.    create one or use /usr/local/adm/named instead.  Put your named.boot
  329.    in it, and make /etc/named.boot a symlink to it.  If your system
  330.    doesn't have symlinks, you're S-O-L (but you knew that).  In
  331.    named.boot, put a "directory" directive that specifies your actual
  332.    BIND working directory:
  333.  
  334.         directory       /var/named
  335.  
  336.    All relative pathnames used in "primary", "secondary", and "cache"
  337.    directives will be evaluated relative to this directory.  Create two
  338.    subdirectories, /var/named/pri and /var/named/sec.  Whenever you add
  339.    a "primary" directive to your named.boot, use "pri/WHATEVER" as the
  340.    path name.  And then put the primary zone file into "pri/WHATEVER".
  341.    Likewise when you add "secondary" directives, use "sec/WHATEVER" and
  342.    BIND (really named-xfer) will create the files in that
  343.    subdirectory.
  344.  
  345.    (Variations: (1) make a midlevel directory "zones" and put "pri" and
  346.    "sec" into it; (2) if you tend to pick up a lot of secondaries from
  347.    a few hosts, group them together in their own subdirectories --
  348.    something like /var/named/zones/uucp if you're a UUCP Project name
  349.    server.)
  350.  
  351.    For your forward files, name them after the zone.  dec.com becomes
  352.    "/var/named/zones/pri/dec.com".  For your reverse files, name them
  353.    after the network number.  0.1.16.in-addr.arpa becomes
  354.    "/var/named/zones/pri/16.1.0".
  355.  
  356.    When creating or maintaining primary zone files, try to use the same
  357.    SOA values everywhere, except for the serial number which varies per
  358.    zone.  Put a $ORIGIN directive at the top of the primary zone file,
  359.    not because its needed (it's not since the default origin is the
  360.    zone named in the "primary" directive) but because it make it easier
  361.    to remember what you're working on when you have a lot of primary
  362.    zones.  Put some comments up there indicating contact information
  363.    for the real owner if you're proxying.  Use RCS and put the "Id"
  364.    in a ";" comment near the top of the zone file.
  365.  
  366.    The SOA and other top level information should all be listed
  367.    together.  But don't put IN on every line, it defaults nicely.  For
  368.    example:
  369.  
  370. ==============
  371. @       IN      SOA     gw.home.vix.com. postmaster.vix.com. (
  372.                         1994082501      ; serial
  373.                         3600    ; refresh (1 hour)
  374.                         1800    ; retry (30 mins)
  375.                         604800  ; expire (7 days)
  376.                         3600 )  ; minimum (1 hour)
  377.  
  378.                 NS      gw.home.vix.com.
  379.                 NS      ns.uu.net.
  380.                 NS      uucp-gw-1.pa.dec.com.
  381.                 NS      uucp-gw-2.pa.dec.com.
  382.  
  383.                 MX      10 gw.home.vix.com.
  384.                 MX      20 uucp-gw-1.pa.dec.com.
  385.                 MX      20 uucp-gw-1.pa.dec.com.
  386. ==============
  387.  
  388.    I don't necessarily recommend those SOA values.  Not every zone is
  389.    as volatile as the example shown.  I do recommend that serial number
  390.    format; it's in date format with a 2-digit per-day revision number.
  391.    This format will last us until 2147 A.D. at which point I expect a
  392.    better solution will have been found :-).  (Note that it would last
  393.    until 4294 A.D. except that there are some old BINDs out there that
  394.    use a signed quantity for representing serial number internally; I
  395.    suppose that as long as none of these are still running after 2047
  396.    A.D., that we can use the above serial number format until 4294
  397.    A.D., at which point a better solution will HAVE to be found.)
  398.  
  399.    You'll note that I use a tab stop for "IN" even though I never again
  400.    specify it.  This leaves room for names longer than 7 bytes without
  401.    messing up the columns.  You might also note that I've put the MX
  402.    priority and destination in the same tab stop; this is because both
  403.    are part of the RRdata and both are very different from MX which is
  404.    an RRtype.  Some folks seem to prefer to group "MX" and the priority
  405.    together in one tab stop.  While this looks neat it's very confusing
  406.    to newcomers and for them it violates the law of least
  407.    astonishment.
  408.  
  409.    If you have a multi-level zone (one which contains names that have
  410.    dots in them), you can use additional $ORIGIN statements but I
  411.    recommend against it since there is no "back" operator.  That is,
  412.    given the above example you can add:
  413.  
  414. =============
  415. $ORIGIN home
  416. gw              A       192.5.5.1
  417. =============
  418.  
  419.    The problem with this is that subsequent RR's had better be
  420.    somewhere under the "home.vix.com" name or else the $ORIGIN that
  421.    introduces them will have to use a fully qualified name.  FQDN
  422.    $ORIGIN's aren't bad and I won't be mad if you use them.
  423.    Unqualified ones as shown above are real trouble.  I usually stay
  424.    away from them and just put the whole name in:
  425.  
  426. =============
  427. gw.home         A       192.5.5.1
  428. =============
  429.  
  430.    In your reverse zones, you're usually in some good luck because the
  431.    owner name is usually a single short token or sometimes two.
  432.  
  433. =============
  434. $ORIGIN 5.5.192.in-addr.arpa.
  435. @       IN      SOA     ...
  436.                 NS      ...
  437. 1               PTR     gw.home.vix.com.
  438. =========================================
  439. $ORIGIN 1.16.in-addr.arpa.
  440. @       IN      SOA     ...
  441.                 NS      ...
  442. 2.0             PTR     gatekeeper.dec.com.
  443. =============
  444.  
  445.    It is usually pretty hard to keep your forward and reverse zones in
  446.    sync.  You can avoid that whole problem by just using "h2n" (see
  447.    the ORA book, DNS and BIND, and its sample toolkit, included in the
  448.    BIND distribution or on ftp.uu.net (use the QUOTE SITE EXEC INDEX
  449.    command there to find this -- I never can remember where it's at).
  450.    "h2n" and many tools like it can just read your old /etc/hosts file
  451.    and churn it into DNS zone files.  (May I recommend
  452.    contrib/decwrl/mkdb.pl from the BIND distribution?)  However, if you
  453.    (like me) prefer to edit these things by hand, you need to follow
  454.    the simple convention of making all of your holes consistent.  If
  455.    you use 192.5.5.1 and 192.5.5.3 but not (yet) 192.5.5.2, then in
  456.    your forward file you will have something like
  457.  
  458. =============
  459. ...
  460. gw.home         A       192.5.5.1
  461. ;avail          A       192.5.5.2
  462. pc.home         A       192.5.5.3
  463. =============
  464.  
  465.    and in your reverse file you will have something like
  466.  
  467. =============
  468. ...
  469. 1               PTR     gw.home.vix.com.
  470. ;2              PTR     avail
  471. 3               PTR     pc.home.vix.com.
  472. =============
  473.  
  474.    This convention will allow you to keep your sanity and make fewer
  475.    errors.  Any kind of automation (h2n, mkdb, or your own
  476.    perl/tcl/awk/python tools) will help you maintain a consistent
  477.    universe even if it's also a complex one.  Editing by hand doesn't
  478.    have to be deadly but you MUST take care.
  479.  
  480. -----------------------------------------------------------------------------
  481.  
  482. Question 5.7.  DNS on a system not connected to the Internet
  483.  
  484. Date: Sun Nov 27 23:32:41 EST 1994
  485.  
  486. You need to create your own root domain name server until you connect  to
  487. the internet.  Your roots need to delegate to mydomain.com and any
  488. in-addr.arpa subdomains you might have, and that's about it.  As soon as
  489. you're connected, rip out the fake roots and use the real ones.
  490.  
  491. It does not actually have to be another server pretending to be the root.
  492. You can set up the name server so that it is primary for each domain above
  493. you and leave them empty (i.e. you are foo.bar.com - claim to be primary
  494. for bar.com and com)
  495.  
  496. If you connect intermittently and want DNS to work when you are connected,
  497. and "fail" when you are not, you can point the resolver at the name server
  498. at the remote site and if the connection (SLIP/PPP) isn't up, the resolver
  499. doesn't have a route to the remote server and since there's only one name
  500. server in resolv.conf, the resolver quickly backs off the using
  501. /etc/hosts.  No problem.  You could do the same with multiple name server
  502. and a resolver that did configurable /etc/hosts fallback.
  503.  
  504. -----------------------------------------------------------------------------
  505.  
  506. Question 5.8.  Multiple Domain configuration
  507.  
  508. Date: Fri Dec  2 15:40:49 EST 1994
  509.  
  510. If you want to have multiple domain names pointing to the same
  511. destination, such as:
  512.  
  513.       ftp ftp.biff.com connects user to -> ftp.biff.com
  514.       ftp ftp.fred.com connects user to -> ftp.biff.com
  515.       ftp ftp.bowser.com connects user to -> ftp.biff.com
  516.  
  517. You may do this by using CNAMEs:
  518.  
  519.       ftp.bowser.com.         IN      CNAME ftp.biff.com.
  520.  
  521. You can also do the same thing with multiple A records.
  522.  
  523. -----------------------------------------------------------------------------
  524.  
  525. Question 5.9.  wildcard MX records
  526.  
  527. Date: Sun Nov 27 23:32:41 EST 1994
  528.  
  529. Does BIND not understand wildcard MX records such as the following?
  530.  
  531.      *.foo.com       MX      0       mail.foo.com.
  532.  
  533. No. It just doesn't work.
  534.  
  535. Explicit RR's at one level of specificity will, by design, "block" a
  536. wildcard at a lesser level of specificity. I suspect that you have an RR
  537. (an A RR, perhaps?) for "bar.foo.com" which is blocking the application of
  538. your "*.foo.com" wildcard. The initial MX query is thus failing (NOERROR
  539. but an answer count of 0), and the backup query finds the A RR for
  540. "bar.foo.com" and uses it to deliver the mail directly (which is what you
  541. DIDN'T want it to do).  Adding an explicit MX RR for the host is therefore
  542. the right way to handle this situation.
  543.  
  544. See RFC 1034, Section 4.3.3 ("Wildcards") for more information on this
  545. "blocking" behavior, along with an illustrative example. See also RFC 974
  546. for an explanation of standard mailer behavior in the face of an "empty"
  547. response to one's MX query.
  548.  
  549. Basically, what it boils down to is, there is no point in trying to use a
  550. wildcard MX for a host which is otherwise listed in the DNS.
  551.  
  552. It just doesn't work.
  553.  
  554. -----------------------------------------------------------------------------
  555.  
  556. Question 5.10.  How do you identify a wildcard MX record ?
  557.  
  558. Date: Thu Dec  1 11:10:39 EST 1994
  559.  
  560. You don't really need to "identify" a wildcard MX RR.  The precedence  for
  561. u@dom is:
  562.  
  563.         exact match MX
  564.         exact match A
  565.         wildcard MX
  566.  
  567. One way to implement this is to query for ("dom",IN,MX) and if the answer
  568. name that comes back is "*." something, you know it's a wildcard,
  569. therefore you know there is no exact match MX, and you therefore query for
  570. ("dom",IN,A) and if you get something, use it.  if you don't, use the
  571. previous wildcard response.
  572.  
  573. RFC 974 explains this pretty well.
  574.  
  575. -----------------------------------------------------------------------------
  576.  
  577. Question 5.11.  Why are fully qualified domain names recommended ?
  578.  
  579. Date: Sun Nov 27 23:32:41 EST 1994
  580.  
  581. The documentation for BIND 4.9.2 says that the hostname should be set  to
  582. the full domain style name (i.e host.our.domain rather than host).  What
  583. advantages are there in this, and are there any adverse consequences if we
  584. don't?
  585.  
  586. Paul Vixie likes to do it :-)  He lists a few reasons -
  587.  
  588. * Sendmail can be configured to just use Dj$w rather than Dj$w.mumble
  589.   where "mumble" is something you have to edit in by hand.  Granted, most
  590.   people use "mumble" elsewhere in their config files ("tack on local
  591.   domain", etc) but why should it be a requirement ?
  592. * The real reason is that not doing it violates a very useful invariant:
  593.     gethostbyname(gethostname) == gethostbyaddr(primary_interface_address)
  594.  
  595.  
  596.   If you take an address and go "backwards" through the PTR's with it,
  597.   you'll get a FQDN, and if you push that back through the A RR's, you get
  598.   the same address.  Or you should.  Many multi-homed hosts violate this
  599.   uncaringly.
  600.  
  601.   If you take a non-FQDN hostname and push it "forwards" through the A
  602.   RR's, you get an address which, if you push it through the PTR's, comes
  603.   back as a FQDN which is not the same as the hostname you started with.
  604.   Consider the fact that, absent NIS/YP, there is no "domainname" command
  605.   analogous to the "hostname" command.  (NIS/YP's doesn't count, of
  606.   course, since it's sometimes-but-only-rarely the same as the Internet
  607.   domain or subdomain above a given host's name.)  The "domain" keyword in
  608.   resolv.conf doesn't specify the parent domain of the current host; it
  609.   specifies the default domain of queries initiated on the current host,
  610.   which can be a very different thing.  (As of RFC 1535 and BIND 4.9.2's
  611.   compliance with it, most people use "search" in resolv.conf, which
  612.   overrides "domain", anyway.)
  613.  
  614.   What this means is that there is NO authoritative way to
  615.   programmatically discover your host's FQDN unless it is set in the
  616.   hostname, or unless every application is willing to grovel the "netstat
  617.   -in" tables, find what it hopes is the primary address, and do a PTR
  618.   query on it.
  619.  
  620.   FQDN /bin/hostnames are, intuitively or not, the simplest way to go.
  621.  
  622. -----------------------------------------------------------------------------
  623.  
  624. Question 5.12.  Distributing load using named
  625.  
  626. Date: Thu Jul 16 10:42:05 EDT 1998
  627.  
  628. When you attempt to distribute the load on a system using named, the first
  629. response be cached, and then later queries use the cached value (This
  630. would be for requests that come through the same server).  Therefore, it
  631. can be useful to use a lower TTL on records where this is important.  You
  632. can use values like 300 or 500 seconds.
  633.  
  634. If your local caching server has ROUND_ROBIN, it does not matter what the
  635. authoritative servers have -- every response from the cache is rotated.
  636.  
  637. But if it doesn't, and the authoritative server site is depending on this
  638. feature (or the old "shuffle-A") to do load balancing, then if one doesn't
  639. use small TTLs, one could conceivably end up with a really nasty
  640. situation, e.g., hundreds of workstations at a branch campus pounding on
  641. the same front end at the authoritative server's site during class
  642. registration.
  643.  
  644. Not nice.
  645.  
  646. Paul Vixie has an example of the ROUND_ROBIN code in action.  Here is
  647. something that he wrote regarding his example:
  648.  
  649.      I want users to be distributed evenly among those 3 hosts.
  650.  
  651.      Believe it or not :-), BIND offers an ugly way to do this.  I offer
  652.      for your collective amusement the following snippet from the
  653.      ugly.vix.com zone file:
  654.  
  655.        hydra           cname        hydra1
  656.                        cname        hydra2
  657.                        cname        hydra3
  658.        hydra1          a            10.1.0.1
  659.                        a            10.1.0.2
  660.                        a            10.1.0.3
  661.        hydra2          a            10.2.0.1
  662.                        a            10.2.0.2
  663.                        a            10.2.0.3
  664.        hydra3          a            10.3.0.1
  665.                        a            10.3.0.2
  666.                        a            10.3.0.3
  667.        
  668.       Note that having multiple CNAME RR's at a given name is
  669.       meaningless according to the DNS RFCs but BIND doesn't mind (in
  670.       fact it doesn't even complain).  If you call
  671.       gethostbyname("hydra.ugly.vix.com") (try it!) you will get
  672.       results like the following.  Note that there are two round robin
  673.       rotations going on: one at ("hydra",CNAME) and one at each
  674.       ("hydra1",A) et al.  I used a layer of CNAME's above the layer of
  675.       A's to keep the response size down.  If you don't have nine
  676.       addresses you probably don't care and would just use a pile of
  677.       CNAME's pointing directly at real host names.
  678.  
  679.       {hydra.ugly.vix.com
  680.       name: hydra2.ugly.vix.com
  681.       aliases: hydra.ugly.vix.com
  682.       addresses: 10.2.0.2 10.2.0.3 10.2.0.1
  683.  
  684.       {hydra.ugly.vix.com
  685.       name: hydra3.ugly.vix.com
  686.       aliases: hydra.ugly.vix.com
  687.       addresses: 10.3.0.2 10.3.0.3 10.3.0.1
  688.  
  689.       {hydra.ugly.vix.com
  690.       name: hydra1.ugly.vix.com
  691.       aliases: hydra.ugly.vix.com
  692.       addresses: 10.1.0.2 10.1.0.3 10.1.0.1
  693.  
  694.       {hydra.ugly.vix.com
  695.       name: hydra2.ugly.vix.com
  696.       aliases: hydra.ugly.vix.com
  697.       addresses: 10.2.0.3 10.2.0.1 10.2.0.2
  698.  
  699.       {hydra.ugly.vix.com
  700.       name: hydra3.ugly.vix.com
  701.       aliases: hydra.ugly.vix.com
  702.       addresses: 10.3.0.3 10.3.0.1 10.3.0.2
  703.  
  704. Please note that this is not a recommended practice and will not work with
  705. modern BIND unless you have the entry "multiple-cnames yes" in your
  706. named.conf file.
  707.  
  708. -----------------------------------------------------------------------------
  709.  
  710. Question 5.13.  Round robin IS NOT load balancing
  711.  
  712. Date: Mon Mar  9 22:10:51 EST 1998
  713.  
  714. Round robin != load balancing. It's a very crude attempt at load
  715. balancing, and a method that is possible without breaking DNS protocols.
  716. If a host  is down that is included in a round robin list, then
  717. connections to that  particular host will fail.  In addition, true load
  718. balancing should take  into consideration the actual LOAD on the system.
  719.  
  720. Information on one such technique, implemented by Roland J. Schemers III
  721. at Stanford, may be found at
  722. http://www-leland.stanford.edu/~schemers/docs/lbnamed/lbnamed.html.
  723.  
  724. Additional information may be found in RFC 1794.  MultiNet for OpenVMS
  725. also includes this feature.
  726.  
  727. -----------------------------------------------------------------------------
  728.  
  729. Question 5.14.  Order of returned records
  730.  
  731. Date: Tue Apr  8 20:21:02 EDT 1997
  732.  
  733. Sorting, is the *resolver's* responsibility.  RFC 1123:
  734.  
  735.  
  736.          6.1.3.4  Multihomed Hosts
  737.  
  738.             When the host name-to-address function encounters a host
  739.             with multiple addresses, it SHOULD rank or sort the
  740.             addresses using knowledge of the immediately connected
  741.             network number(s) and any other applicable performance or
  742.             history information.
  743.  
  744.             DISCUSSION:
  745.                  The different addresses of a multihomed host generally
  746.                  imply different Internet paths, and some paths may be
  747.                  preferable to others in performance, reliability, or
  748.                  administrative restrictions.  There is no general way
  749.                  for the domain system to determine the best path.  A
  750.                  recommended approach is to base this decision on local
  751.                  configuration information set by the system
  752.                  administrator.
  753.  
  754. In BIND 4.9.x's resolver code, the "sortlist" directive in resolv.conf
  755. can be used to configure this.  The directive may also be used in the
  756. named.boot as well.
  757.  
  758. -----------------------------------------------------------------------------
  759.  
  760. Question 5.15.  resolv.conf
  761.  
  762. Date: Fri Feb 10 15:46:17 EST 1995
  763.  
  764. The question was asked one time, "Why should I use 'real' IP addresses in
  765. /etc/resolv.conf and not 0.0.0.0 or 127.0.0.1" ?
  766.  
  767. Paul Vixie writes on the issue of the contents of resolv.conf:
  768.  
  769.    It's historical.  Some kernels can't unbind a UDP socket's source
  770.    address, and some resolver versions (notably not including BIND
  771.    4.9.2 or 4.9.3's) try to do this.  The result can be wide area
  772.    network traffic with 127.0.0.1 as the source address.  Rather than
  773.    giving out a long and detailed map of version/vendor combinations of
  774.    kernels/BINDs that have/don't this problem, I just tell folks not to
  775.    use 127.0.0.1 at all.
  776.  
  777.    0.0.0.0 is just an alias for the first interface address assigned
  778.    after a system boot, and if that interface is a up-and-down point to
  779.    point link (PPP, SLIP, whatever), there's no guarantee that you'll
  780.    be able to reach yourself via 0.0.0.0 during the entire lifetime of
  781.    any system instance.  On most kernels you can finesse this by adding
  782.    static routes to 127.0.0.1 for each of your interface addresses, but
  783.    some kernels don't like that trick and rather than give a detailed
  784.    map of which ones work and which ones don't, I just globally
  785.    recommend against 0.0.0.0.
  786.  
  787.    If you know enough to know that 127.0.0.1 or 0.0.0.0 is safe on your
  788.    kernel and resolver, then feel free to use them.  If you don't know
  789.    for sure that it is safe, don't use them.  I never use them (except
  790.    on my laptop, whose hostname is "localhost" and whose 0.0.0.0 is
  791.    127.0.0.1 since I ifconfig my lo0 before any other interface).  The
  792.    operational advantage to using a real IP address rather than an
  793.    wormhole like 0.0.0.0 or 127.0.0.1, is that you can then "rdist" or
  794.    otherwise share identical copies of your resolv.conf on all the
  795.    systems on any given subnet, not all of which will be servers.
  796.  
  797. The problem was with older versions of the resolver (4.8.X).  If you
  798. listed 127.0.0.1 as the first entry in resolv.conf, and for whatever
  799. reason the local name server wasn't running and the resolver fell back to
  800. the second name server listed, it would send queries to the name server
  801. with the source IP address set to 127.0.0.1 (as it was set when the
  802. resolver was trying to send to 127.0.0.1--you use the loopback address to
  803. send to the loopback address).
  804.  
  805. -----------------------------------------------------------------------------
  806.  
  807. Question 5.16.  How do I delegate authority for sub-domains ?
  808.  
  809. Date: Mon Nov 10 22:57:54 EST 1997
  810.  
  811. When you start having a very big domain that can be broken into logical
  812. and separate entities that can look after their own DNS information, you
  813. will probably want to do this.  Maintain a central area for the things
  814. that everyone needs to see and delegate the authority for the other parts
  815. of the organization so that they can manage themselves.
  816.  
  817. Another essential piece of information is that every domain that exists
  818. must have it NS records associated with it.  These NS records denote the
  819. name servers that are queried for information about that zone.  For your
  820. zone to be recognized by the outside world, the server responsible for the
  821. zone above you must have created a NS record for your your new servers
  822. (NOTE that the new servers DO NOT  have to be in the new domain).  For
  823. example, putting the computer club onto the network and giving them
  824. control over their own part  of the domain space we have the following.
  825.  
  826. The machine authorative for gu.uwa.edu.au is mackerel and the machine
  827. authorative for ucc.gu.uwa.edu.au is marlin.
  828.  
  829. in mackerel's data for gu.uwa.edu.au we have the following
  830.  
  831.    @               IN      SOA ...
  832.                    IN      A       130.95.100.3
  833.                    IN      MX      mackerel.gu.uwa.edu.au.
  834.                    IN      MX      uniwa.uwa.edu.au.
  835.     
  836.    marlin          IN      A       130.95.100.4
  837.  
  838.    ucc             IN      NS      marlin.gu.uwa.edu.au.
  839.                    IN      NS      mackerel.gu.uwa.edu.au.
  840.  
  841. Marlin is also given an IP in our domain as a convenience.  If they blow
  842. up their name serving there is less that can go wrong because people can
  843. still see that machine which is a start.  You could place "marlin.ucc" in
  844. the first column and leave the machine totally inside the ucc domain as
  845. well.
  846.  
  847. The second NS line is because mackerel will be acting as secondary name
  848. server for the ucc.gu domain.  Do not include this line if you are not
  849. authorative for the information included in the sub-domain.
  850.  
  851. To delegate authority for PTR records, the same concepts apply.
  852.  
  853.    stub 10.168.192.in-addr.arpa <subdomain server addr> db.192.168.10
  854.  
  855. may be added to your primary server's named.boot in recent versions of
  856. bind.  In other versions (and recent ones :-) ), the following lines may
  857. be added  to the db.192.168.10 zone file to perform the same function:
  858.  
  859.    xxx IN NS <server1>
  860.    xxx IN NS <server2>
  861.    xxx IN NS <server3>            ; if needed
  862. ...
  863.    xxx IN NS <serverN>            ; if needed
  864.  
  865. -----------------------------------------------------------------------------
  866.  
  867. Question 5.17.  DNS instead of NIS on a Sun OS 4.1.x system
  868.  
  869. Date: Sat Dec  7 01:14:17 EST 1996
  870.  
  871. Comments relating to running bind 4.9.x on a Sun OS 4.1.x system and the
  872. effect on sendmail, ftp, telnet and other TCP/IP services bypassing NIS
  873. and directly using named is documented quite well in the
  874. comp.sys.sun.admin FAQ in questions one and two.  You can get them from:
  875.  
  876. * ftp.ece.uc.edu : /pub/sun-faq/FAQs/sun-faq.general
  877. * http://www.cis.ohio-state.edu/hypertext/faq/usenet/comp-sys-sun-faq
  878.  
  879. as well as from rtfm.mit.edu in the usual place, etc.
  880.  
  881. -----------------------------------------------------------------------------
  882.  
  883. Question 5.18.  Patches to add functionality to BIND
  884.  
  885. Date: Wed Jan 14 11:57:20 EST 1998
  886.  
  887. There are others, but these are listed here:
  888.  
  889. * When using the round robin DNS and assigning 3 IPs to a host (for
  890.   example), a process to guarantee that all 3 IPs are reachable may be
  891.   found  at
  892.   http://www-leland.stanford.edu/~schemers/docs/lbnamed/lbnamed.html
  893.  
  894. * Patches for 4.9.3-REL that will support the IPv6 AAAA record format may
  895.   be  found at ftp.inria.fr : /network/ipv6/
  896.  
  897.   This is built into more recent versions of BIND (after 4.9.5?)
  898.  
  899. * A patch for 4.9.3-REL that will allow you to turn off forwarding of
  900.   information from my server may be found at ftp.vix.com :
  901.   /pub/bind/release/4.9.3/contrib/noforward.tar.gz
  902.  
  903.   Also look at
  904.  
  905.   ftp.is.co.za : /networking/ip/dns/bind/contrib/noforward.tar.gz
  906.  
  907. * How do I tell a server to listen to a particular interface to listen and
  908.   respond to DNS queries on ?
  909.  
  910.   Mark Andrews has a patch that will tell a 4.9.4 server to listen to a
  911.   particular interface and respond to DNS queries.  It may be found at an
  912.   unofficial location: http://www.ultra.net/~jzp/andrews.patch.txt
  913.  
  914.   This is built into BIND 8.1.1.
  915.  
  916. * A patch to implement "selective forwarding" from Todd Aven at
  917.   http://www.dns.net/dnsrd/servers.html.
  918.  
  919. -----------------------------------------------------------------------------
  920.  
  921. Question 5.19.  How to serve multiple domains from one server
  922.  
  923. Date: Tue Nov  5 23:44:02 EST 1996
  924.  
  925. Most name server implementations allow information about multiple domains
  926. to be kept on one server, and questions about those domains  to be
  927. answered by that one server.  For instance, there are many large  servers
  928. on the Internet that each serve information about more than  1000
  929. different domains.
  930.  
  931. To be completely accurate, a server contains information about zones,
  932. which are parts of domains that are kept as a single unit.  [Ed note: for
  933. a definition of zones and domains, see Section 2: The Name Service in the
  934. "Name Server Operations Guide" included with the BIND 4.9.5 distribution.]
  935.  
  936. In the configuration of the name server, the additional zones need to be
  937. specified.  An important consideration is whether a particular server is
  938. primary or secondary for any specific zone--a secondary server maintains
  939. only a copy of the zone, periodically refreshing its copy from another,
  940. specified, server.  In BIND, to set up a server as a secondary server for
  941. the x.y.z zone, to the configuration file /etc/named.boot add the line
  942.  
  943.       secondary   x.y.z   10.0.0.1        db.x.y.z
  944.  
  945. where 10.0.0.1 is the IP address of the server that the zone will be
  946. copied from, and db.x.y.z is a local filename that will contain the copy
  947. of the zone.
  948.  
  949. If this is a question related to how to set up multiple IP numbers on one
  950. system, which you do not need to do to act as a domain server for
  951. multiple domains, see
  952.  
  953. http://www.thesphere.com/%7Edlp/TwoServers/.
  954.  
  955. -----------------------------------------------------------------------------
  956.  
  957. Question 5.20.  hostname and domain name the same
  958.  
  959. Date: Wed Jul  9 21:47:36 EDT 1997
  960.  
  961. Q: I have a subdomain sub.foobar.com. I would like to name a host
  962. sub.foobar.com. It should also be the mail relay for all hosts in
  963. sub.foobar.com. How do I do this ?
  964.  
  965. A: You would add an A record for sub.foobar.com, and multiple MX records
  966. pointing to this host (sub.foobar.com).  For example:
  967.  
  968. sub.foobar.com.         IN      A       1.2.3.4 ; address of host
  969. ;
  970. foo.sub.foobar.com.     IN      MX      10 sub.foobar.com.
  971. bar.sub.foobar.com.     IN      MX      10 sub.foobar.com.
  972.  
  973. The host, sub.foobar.com, may also need to be to configured to understand
  974. that mail addressed to user@sub.foobar.com and possibly other sub.foobar.com 
  975. hosts should be treated as local.
  976.  
  977. -----------------------------------------------------------------------------
  978.  
  979. Question 5.21.  Restricting zone transfers
  980.  
  981. Date: Wed Jan 14 12:16:35 EST 1998
  982.  
  983. Q: How do I restrict my zone transfers to my secondaries or other trusted
  984. hosts?
  985.  
  986. A: Use the 'xfrnets' directive within the named.boot file or  the
  987. 'secure_zone' TXT RR within a zone file.  The BOG has more information on
  988. both of these options.
  989.  
  990. As an example within an 4.9.x named.boot file:
  991.  
  992.    xfernets 10.1.2.0&255.255.255.0 44.66.10.0&255.255.255.0 
  993.  
  994.  
  995. Only Nameservers on these networks will be able to do zone transfers from
  996. the server with this configuration.
  997.  
  998. Please note that 'secure_zone' restricts all access to the containing
  999. zone, as well as restricting zone transfers :-) .
  1000.  
  1001. BIND 8.x supports restricting zone transfers on a per-zone basis in  the
  1002. named.conf file, whereas BIND 4.9.x only supports xfrnets as a global
  1003. option.
  1004.  
  1005. -----------------------------------------------------------------------------
  1006.  
  1007. Question 5.22.  DNS in firewalled and private networks
  1008.  
  1009. Date: Mon Sep 14 22:15:16 EDT 1998
  1010.  
  1011. (The following section was contributed by Berislav Todorovic)
  1012.  
  1013. When talking about private networks, we distinguish between two cases:
  1014.  
  1015. * Networks consisting of firewall-separated private and public subnetworks
  1016.  
  1017.   * Same domain name used in private and public part of the network
  1018.   * Different domain names used in the public and private subnetwork
  1019.  
  1020. * Closed networks, not connected the Internet at all
  1021.  
  1022. * The first case of the  "Same domain name", we're talking about DNS
  1023.   configuration, usually referred to as "split DNS". In this case, two
  1024.   different DNS servers (or two separate DNS processes on the same
  1025.   multi-homed machine) have to be configured. One of them ("private DNS")
  1026.   will serve the internal network and will contain data about all hosts in
  1027.   the private part of the network. The other one ("public DNS") will serve
  1028.   Internet users and will contain only the most necessary RR's for
  1029.   Internet users (like MX records for email exchange, A and CNAME records
  1030.   for public Web servers, records for other publicly accessible hosts
  1031.   etc.). Both of them will be configured as primary for the same corporate
  1032.   domain (e.g.  DOMAIN.COM).  The public DNS will be delegated with the
  1033.   appropriate NIC as authoritative for domain DOMAIN.COM.
  1034.  
  1035.   Private DNS - resolves names from DOMAIN.COM for hosts inside the
  1036.   private network. If asked for a name outside DOMAIN.COM, they should
  1037.   forward the request to the public DNS (forwarders line should be used in
  1038.   the boot file).  They should NEVER contact a root DNS on the Internet.
  1039.   The boot file for the private DNS should, therefore, be:
  1040.  
  1041.     primary            domain.com              ZONE.domain.com
  1042.     primary            1.10.in-addr.arpa       REV.10.1
  1043.     forwarders         172.16.12.10
  1044.     slave
  1045.   Public DNS - resolves names from DOMAIN.COM for hosts on the public part
  1046.   of the network. If asked for a name outside DOMAIN.COM they should
  1047.   contact root DNS servers or (optionally) forward the request to a
  1048.   forwarder on the ISP network. Boot file for the public DNS should be of
  1049.   the form:
  1050.  
  1051.     primary            domain.com              ZONE.domain.com
  1052.     primary            12.16.172.in-addr.arpa  REV.172.16.12
  1053.     ... (other domains)
  1054.   Zone files for domain DOMAIN.COM on the public and private DNS should
  1055.   be:
  1056.  
  1057.    ; --- Public DNS - zone file for DOMAIN.COM
  1058.  
  1059.    domain.com.        IN   SOA   ns.domain.com. hostmaster.domain.com. ( ... )
  1060.                       IN   NS    ns.domain.com.
  1061.                       IN   NS    ns.provider.net.
  1062.                       IN   MX    10     mail.provider.net.
  1063.  
  1064.    ns                 IN   A     172.16.12.10
  1065.    www                IN   A     172.16.12.12
  1066.    ftp                IN   A     172.16.12.13
  1067.    ...
  1068.  
  1069.    ; --- Private DNS - zone file for DOMAIN.COM
  1070.  
  1071.    domain.com.        IN   SOA   ns1.domain.com. hostmaster.domain.com. ( ... )
  1072.                       IN   NS    ns1.domain.com.
  1073.                       IN   NS    ns2.domain.com.
  1074.    wks1-1             IN   A     10.1.1.1
  1075.    wks1-2             IN   A     10.1.1.2
  1076.    ...
  1077.  
  1078.   The second case of the  "Same domain name", is simpler than the previous
  1079.   case: in the internal network, a separate domain name might be used.
  1080.   Recommended domain name syntax is "name.local" (e.g. DOMAIN.LOCAL).
  1081.   Sample configuration:
  1082.  
  1083.    ; --- Private DNS - named.boot
  1084.  
  1085.    primary       domain.local           ZONE.domain.local
  1086.    ...
  1087.    forwarders    172.16.12.10
  1088.    slave
  1089.  
  1090.    ; --- Public DNS - named.boot
  1091.    
  1092.    primary       domain.com             ZONE.domain.com
  1093.    ...
  1094.   IMPLEMENTATION NOTES
  1095.  
  1096.   Location of the DNS service in both cases is irrelevant. Usually, they
  1097.   are located on two different physical servers, each of them connected to
  1098.   the appropriate part of the network (private, public). Certain savings
  1099.   may be done if public DNS service is hosted on the ISP network - in that
  1100.   case, the user will need only one (private) DNS server.
  1101.  
  1102.   Finally, both public and private DNS, in some cases, may be placed on
  1103.   the servers in the private network, behind the firewall. With a Cisco
  1104.   PIX, a statical public/private IP address mapping in this case would be
  1105.   needed.  Two servers for the same domain could be even placed on the
  1106.   same physical server, with two different DNS processes running on
  1107.   different IP interfaces.  Note that BIND 8 is needed in the latter case.
  1108.  
  1109. * If the network is not connected to the Internet at all, only private DNS
  1110.   servers are needed. However, due to the lack of Internet connectivity,
  1111.   internal servers will fail to contact the root DNS servers every time a
  1112.   user types, by mistake, an address outside the corporate domain
  1113.   DOMAIN.COM.  Some older servers won't even work if they can't reach root
  1114.   servers. To overcome this, it is most proper to create a so-called "fake
  1115.   root zone" on one or more DNS servers in the corporation. That would
  1116.   make all DNS servers within the corporation think there is only one or
  1117.   two DNS servers in the world, all located on the corporation network.
  1118.   Only domain names used within the corporation (DOMAIN.COM, appropriate
  1119.   inverse domains etc.) should be entered in the fake root zone file. Note
  1120.   that no cache line in the boot file of the "root" DNS makes sense.
  1121.   Sample configuration:
  1122.  
  1123.    ; --- named.boot
  1124.  
  1125.    primary     domain.com         ZONE.domain.com
  1126.    primary     1.10.in-addr.arpa  REV.10.1
  1127.    priamry     .                  ZONE.root
  1128.    ... (other data; NOTE - do *NOT* place any "cache" line here !!!)
  1129.  
  1130.    ; --- ZONE.root - fake root zone file, containing only corporation domains
  1131.  
  1132.    .                   IN NS  ns.domain.com.  hostmaster.domain.com.  ( ... )
  1133.                        IN NS  ns.domain.com.
  1134.                        IN NS  ns2.domain.com.
  1135.    
  1136.    domain.com.         IN NS  ns.domain.com.
  1137.    ns.domain.com.      IN  A  10.1.1.1
  1138.    domain.com.         IN NS  ns2.domain.com.
  1139.    ns2.domain.com.     IN  A  10.1.1.2
  1140.    
  1141.    1.10.in-addr.arpa.  IN NS  ns.domain.com.
  1142.                        IN NS  ns2.domain.com.
  1143.    
  1144.   Other zone files follow standard configuration.
  1145.  
  1146. -----------------------------------------------------------------------------
  1147.  
  1148. Question 5.23.  Different DNS answers for same RR
  1149.  
  1150. Date: Mon Sep 14 22:15:16 EDT 1998
  1151.  
  1152. (The following section was contributed by Berislav Todorovic)
  1153.  
  1154. Many times there is a need for a DNS server to send different answers for
  1155. same RR's, depending on the IP address of the request sender. For example,
  1156. many coprporations wish to make their customers to use the "geographically
  1157. closest" Web server when accessing corporate Web pages. A corporation may
  1158. impose the following policy: if someone asked for the IP address of
  1159. WWW.DOMAIN.COM, they may want to:
  1160.  
  1161. * Answer that the IP address is 172.16.2.3, if the request came from one
  1162.   of the following IP networks: 172.1/16, 172.2/16 or 172.10/16.
  1163. * Answer that the IP address is 172.16.1.1, if the request came from the
  1164.   IP address 172.16/16 or 172.17.128/18.
  1165. * By default, for all other requests send the answer that the IP address
  1166.   is  172.16.2.3.
  1167.  
  1168. The example above will need a DNS to send different A RR's, depending on
  1169. the source of queries. A similar approach may be imposed for MX's, CNAME's
  1170. etc. The question which arise here is: IS IT POSSIBLE?
  1171.  
  1172. [Ed note: There are commercial products such as Cisco's Distributed
  1173. Director that also will address this issue]
  1174.  
  1175. The simple answer to the question is: NOT DIRECTLY.  This is true if
  1176. standard DNS software (e.g. BIND) is used on the DNS servers.  However,
  1177. there are two workarounds which may solve this problem:
  1178.  
  1179. * Using two DNS servers on different UDP ports + UDP redirector
  1180. * Using two DNS servers on different IP addresses + NAT on the router
  1181.  
  1182. Solution 1: (tested on a Linux system and should work on other Unix boxes
  1183. as well). Software needed is:
  1184.  
  1185. * BIND 8
  1186. * udprelay - a package which redirects traffic to other UDP port
  1187.   (sunsite.unc.edu: /pub/Linux/system/network/misc/udprelay-0.2.tar.Z ).
  1188.  
  1189. Build and install udprelay and bring up two DNS servers on different UDP
  1190. ports, using different configuration files (i.e., bring one on 5300 and
  1191. the other one on 5400):
  1192.  
  1193.    // --- named.conf.5300
  1194.    options {
  1195.         directory "/var/named"
  1196.         listen-on port 5300 { any; };
  1197.         ... (other options)
  1198.       };
  1199.  
  1200.    zone "domain.com" {
  1201.         type master;
  1202.         file "domain.com.5300";
  1203.       };
  1204.  
  1205.    // --- named.conf.5400
  1206.  
  1207.    options {
  1208.         directory "/var/named"
  1209.         listen-on port 5400 { any; };
  1210.         ... (other options)
  1211.       };
  1212.  
  1213.    zone "domain.com" {
  1214.         type master;
  1215.         file "domain.com.5400";
  1216.       };
  1217.  
  1218.  
  1219.    ; domain.com.5300
  1220.    ... (SOA and other stuff)
  1221.  
  1222.    www          IN     A     172.16.2.3
  1223.  
  1224.    ; --- domain.com.5400
  1225.    ... (SOA and other stuff)
  1226.  
  1227.    www          IN     A     172.16.1.1
  1228.  
  1229. As can be seen, there will be two separate zone files for DOMAIN.COM,
  1230. depending on which UDP port the server listens to.  Each zone file can
  1231. contain different records.  Now, when configure udprelay to forward  UDP
  1232. traffic from port 53 to 5300 or 5400, depending on the remote  IP address:
  1233.  
  1234.    relay  172.1.0.0  mask 255.255.0.0 * 53   172.16.1.1 5300 53
  1235.    relay  172.2.0.0  mask 255.255.0.0 * 53   172.16.1.1 5300 53
  1236.    relay  172.10.0.0 mask 255.255.0.0 * 53   172.16.1.1 5300 53
  1237.    relay  172.16.0.0 mask 255.255.0.0 * 53   172.16.1.1 5400 53
  1238.    relay  172.17.0.0 mask 255.255.0.0 * 53   172.16.1.1 5400 53
  1239.    relay  *                           * 53   172.16.1.1 5400 53
  1240. After starting udprelay, all traffic coming to port 53 will be redirected
  1241. to 5300 or 5400, depending on the source IP address.
  1242.  
  1243. NOTE - This solution deals with the UDP part of DNS only. Zone xfers will
  1244. be able to be done from one DNS server only, since this solution doesn't
  1245. deal the TCP part of DNS. This is, thus, a partial solution but it works!
  1246.  
  1247. Solution 2: Bring up two DNS servers on your network, using "private" IP
  1248. addresses (RFC 1918), say ns1.domain.com (10.1.1.1) and ns2.domain.com
  1249. (10.1.1.2). Both servers will have the same public address - 172.16.1.1,
  1250. which will be used to access the servers.  Configure them to be both
  1251. primary for domain DOMAIN.COM.  Let one of them (say, ns1) be the
  1252. "default" DNS, which will be used in most of the cases. Establish NAT on
  1253. the router, so it translates the public IP address 172.16.1.1 to 10.1.1.1
  1254. and delegate your "default" DNS with the appropriate NIC, using its public
  1255. address 172.16.1.1. Once you're assured everything works, setup your
  1256. router to translate the public IP address 172.16.1.1 to either 10.1.1.1 or
  1257. 10.1.1.2, depending on the requestor IP address. After that, depending on
  1258. the source IP address, the router will return one translation or the
  1259. latter, thus forwarding the remote side to the appropriate DNS server.
  1260.  
  1261. ===============================================================================
  1262.  
  1263. Section 6.  PROBLEMS
  1264.  
  1265.  Q6.1        No address for root server
  1266.  Q6.2        Error - No Root Nameservers for Class XX
  1267.  Q6.3        Bind 4.9.x and MX querying?
  1268.  Q6.4        Do I need to define an A record for localhost ?
  1269.  Q6.5        MX records, CNAMES and A records for MX targets
  1270.  Q6.6        Can an NS record point to a CNAME ?
  1271.  Q6.7        Nameserver forgets own A record
  1272.  Q6.8        General problems (core dumps !)
  1273.  Q6.9        malloc and DECstations
  1274.  Q6.10       Can't resolve names without a "."
  1275.  Q6.11       Why does swapping kill BIND ?
  1276.  Q6.12       Resource limits warning in system
  1277.  Q6.13       ERROR:ns_forw: query...learnt 
  1278.  Q6.14       ERROR:zone has trailing dot
  1279.  Q6.15       ERROR:Zone declared more then once
  1280.  Q6.16       ERROR:response from unexpected source
  1281.  Q6.17       ERROR:record too short from [zone name]
  1282.  Q6.18       ERROR:sysquery: findns error (3)
  1283.  Q6.19       ERROR:Err/TO getting serial# for XXX
  1284.  Q6.20       ERROR:zonename IN NS points to a CNAME
  1285.  Q6.21       ERROR:Masters for secondary zone [XX] unreachable
  1286.  Q6.22       ERROR:secondary zone [XX] expired
  1287.  Q6.23       ERROR:bad response to SOA query from [address]
  1288.  Q6.24       ERROR:premature EOF, fetching [zone]
  1289.  Q6.25       ERROR:Zone [XX] SOA serial# rcvd from [Y] is < ours
  1290.  Q6.26       ERROR:connect(IP/address) for zone [XX] failed
  1291.  Q6.27       ERROR:sysquery: no addrs found for NS
  1292.  Q6.28       ERROR:zone [name] rejected due to errors
  1293.  
  1294. -----------------------------------------------------------------------------
  1295.  
  1296. Question 6.1.  No address for root server
  1297.  
  1298. Date: Wed Jan 14 12:15:54 EST 1998
  1299.  
  1300. Q: I've been getting the following messages lately from bind-4.9.2..
  1301.         ns_req: no address for root server
  1302.  
  1303. We are behind a firewall and have the following for our named.cache file -
  1304.  
  1305.         ; list of servers
  1306.         .               99999999    IN  NS  POBOX.FOOBAR.COM.
  1307.                         99999999    IN  NS  FOOHOST.FOOBAR.COM.
  1308.         foobar.com.     99999999    IN  NS  pobox.foobar.com.
  1309.  
  1310. You can't do that.  Your nameserver contacts POBOX.FOOBAR.COM, gets the
  1311. correct list of root servers from it, then tries again and fails because
  1312. of your firewall.
  1313.  
  1314. You will need a 'forwarder' definition, to ensure that all requests are
  1315. forwarded to a host which can penetrate the firewall.  And it is unwise to
  1316. put phony data into 'named.cache'.
  1317.  
  1318. Q: We are getting logging information in the form:
  1319.  
  1320. Apr  8 08:05:22 gute named[107]: sysquery: no addrs found for root NS
  1321.                 (A.ROOT-SERVERS.NET)
  1322. Apr  8 08:05:22 gute named[107]: sysquery: no addrs found for root NS
  1323.                 (B.ROOT-SERVERS.NET)
  1324. Apr  8 08:05:22 gute named[107]: sysquery: no addrs found for root NS
  1325.                 (C.ROOT-SERVERS.NET)  
  1326. ...
  1327.  
  1328. We are running bind 4.9.5PL1 Our system IS NOT behind a firewall.  Any ideas ?
  1329.  
  1330. This was discussed on the mailing list in November of 1996.  The short
  1331. answer  was to ignore it as it was not a problem.  That being said,  you
  1332. should  upgrade to a newer version at this time if you are running a
  1333. non-current  version :-)
  1334.  
  1335. -----------------------------------------------------------------------------
  1336.  
  1337. Question 6.2.  Error - No Root Nameservers for Class XX
  1338.  
  1339. Date: Sun Nov 27 23:32:41 EST 1994
  1340.  
  1341. Q: I've received errors before about "No root nameservers for class XX"
  1342.    but they've been because of network connectivity problems.
  1343.    I believe that Class 1 is Internet Class data.
  1344.    And I think I heard someone say that Class 4 is Hesiod??
  1345.    Does anyone know what the various Class numbers are?
  1346.  
  1347. From RFC 1700:
  1348.  
  1349.        DOMAIN NAME SYSTEM PARAMETERS
  1350.        The Internet Domain Naming System (DOMAIN) includes several
  1351.        parameters.  These are documented in [RFC1034] and [RFC1035].  The
  1352.        CLASS parameter is listed here.  The per CLASS parameters are 
  1353.        defined in separate RFCs as indicated.
  1354.  
  1355.        Domain System Parameters:
  1356.  
  1357.        Decimal   Name                                          References
  1358.        --------  ----                                          ----------
  1359.               0  Reserved                                           [PM1]
  1360.               1  Internet (IN)                              [RFC1034,PM1]
  1361.               2  Unassigned                                         [PM1]
  1362.               3  Chaos (CH)                                         [PM1]
  1363.               4  Hesoid (HS)                                       [PM1]
  1364.         5-65534  Unassigned                                         [PM1]
  1365.           65535  Reserved                                           [PM1]
  1366.  
  1367. DNS information for RFC 1700 was taken from
  1368.  
  1369. ftp.isi.edu : /in-notes/iana/assignments/dns-parameters
  1370.  
  1371. Hesiod is class 4, and there are no official root nameservers for class 4,
  1372. so you can safely declare yourself one if you like.  You might want  to
  1373. put up a packet filter so that no one outside your network is capable  of
  1374. making Hesiod queries of your machines, if you define yourself to be  a
  1375. root nameserver for class 4.
  1376.  
  1377. -----------------------------------------------------------------------------
  1378.  
  1379. Question 6.3.  Bind 4.9.x and MX querying?
  1380.  
  1381. Date: Sun Nov 27 23:32:41 EST 1994
  1382.  
  1383. If you query a 4.9.x DNS server for MX records, a list of the MX records
  1384. as well as a list of the authorative nameservers is returned.  This
  1385. happens because bind 4.9.2 returns the list of nameserver that are
  1386. authorative for a domain in the response packet, along with their IP
  1387. addresses in the additional section.
  1388.  
  1389. -----------------------------------------------------------------------------
  1390.  
  1391. Question 6.4.  Do I need to define an A record for localhost ?
  1392.  
  1393. Date: Sat Sep  9 00:36:01 EDT 1995
  1394.  
  1395. Somewhere deep in the BOG (BIND Operations Guide) that came with 4.9.3
  1396. (section 5.4.3), it says that you define this yourself  (if need be) in
  1397. the same zone files as your "real" IP addresses  for your domain.  Quoting
  1398. the BOG:
  1399.  
  1400.  
  1401.                                  ... As  implied by this PTR
  1402.          record, there should be a  ``localhost.my.dom.ain''
  1403.          A  record  (with address 127.0.0.1) in every domain
  1404.          that contains hosts.  ``localhost.'' will lose  its
  1405.          trailing dot when 1.0.0.127.in-addr.arpa is queried
  1406.          for;...
  1407.  
  1408. The sample files in the BIND distribution show you what needs to be done
  1409. (see the BOG).
  1410.  
  1411. Some HP boxen (especially those running HP OpenView) will also need
  1412. "loopback" defined with this IP address.   You may set it as a CNAME
  1413. record pointing to the "localhost." record.
  1414.  
  1415. -----------------------------------------------------------------------------
  1416.  
  1417. Question 6.5.  MX records, CNAMES and A records for MX targets
  1418.  
  1419. Date: Sun Nov 27 23:32:41 EST 1994
  1420.  
  1421. The O'Reilly "DNS and Bind" book warns against using non-canonical names
  1422. in MX records, however, this warning is given in the context of mail hubs
  1423. that MX to each other for backup purposes.  How does this apply to mail
  1424. spokes.  RFC 974 has a similar warning, but where is it specifically
  1425. prohibited to us an alias in an MX record ?
  1426.  
  1427. Without the restrictions in the RFC, a MTA must request the A records  for
  1428. every MX listed to determine if it is in the MX list then reduce the list.
  1429. This introduces many more lookups than would other wise be required. If
  1430. you are behind a 1200 bps link YOU DON'T WANT TO DO THIS. The addresses
  1431. associated with CNAMES are not passed as additional data so you will force
  1432. additional traffic to result even if you are running a caching server
  1433. locally.
  1434.  
  1435. There is also the problem of how does the MTA find all of it's IP
  1436. addresses. This is not straight forward. You have to be able to do this is
  1437. you allow CNAMEs (or extra A's) as MX targets.
  1438.  
  1439. The letter of the law is that an MX record should point to an A record.
  1440.  
  1441. There is no "real" reason to use CNAMEs for MX targets or separate As for
  1442. nameservers any more. CNAMEs for services other than mail should be used
  1443. because there is no specified method for locating the desired server yet.
  1444.  
  1445. People don't care what the names of MX targets are.  They're invisible to
  1446. the process anyway.  If you have mail for "mary" redirected to "sue" is
  1447. totally irrelevant.  Having CNAMEs as the targets of MX's just needlessly
  1448. complicates things, and is more work for the resolver.
  1449.  
  1450. Having separate A's for nameservers like "ns.your.domain" is pointless
  1451. too, since again nobody cares what the name of your nameserver is, since
  1452. that too is invisible to the process.  If you move your nameserver from
  1453. "mary.your.domain" to "sue.your.domain" nobody need care except you and
  1454. your parent domain administrator (and the InterNIC).  Even less so for
  1455. mail servers, since only you are affected.
  1456.  
  1457. Q: Given the example - 
  1458.  
  1459.      hello in cname     realname
  1460.      mailx in mx        0 hello
  1461.  
  1462.    Now, while reading the operating manual of bind it clearly states
  1463.    that this is *not* valid.  These two statements clearly contradict
  1464.    each other.  Is there some later RFC than 974 that overrides what is
  1465.    said in there with respect to MX and CNAMEs?  Anyone have the
  1466.    reference handy?
  1467.  
  1468. A: This isn't what the BOG says at all.  See below.  You can have a CNAME 
  1469.    that points to some other RR type; in fact, all CNAMEs have to point
  1470.    to other names (Canonical ones, hence the C in CNAME).  What you
  1471.    can't have is an MX that points to a CNAME.  MX RR's that point to
  1472.    names which have only CNAME RR's will not work in many cases, and
  1473.    RFC 974 intimates that it's a bad idea:
  1474.  
  1475.       Note that the algorithm to delete irrelevant RRs breaks if LOCAL has
  1476.       a alias and the alias is listed in the MX records for REMOTE.  (E.g.
  1477.       REMOTE has an MX of ALIAS, where ALIAS has a CNAME of LOCAL).  This
  1478.       can be avoided if aliases are never used in the data section of MX
  1479.       RRs.
  1480.  
  1481.    Here's the relevant BOG snippet:
  1482.  
  1483.          aliases    {ttl   addr-class   CNAME   Canonical name
  1484.          ucbmonet           IN           CNAME   monet
  1485.  
  1486.          The  Canonical  Name resource record, CNAME, speci-
  1487.          fies an alias or  nickname  for  the  official,  or
  1488.          canonical,  host  name.   This record should be the
  1489.          only one associated with the alias name.  All other
  1490.          resource  records  should  be associated  with the
  1491.          canonical  name,  not  with  the   nickname.  Any
  1492.          resource  records  that  include  a  domain name as
  1493.          their value (e.g., NS or MX) must list the  canoni-
  1494.          cal name, not the nickname.
  1495.  
  1496. -----------------------------------------------------------------------------
  1497.  
  1498. Question 6.6.  Can an NS record point to a CNAME ?
  1499.  
  1500. Date: Wed Mar  1 11:14:10 EST 1995
  1501.  
  1502. Can I do this ?  Is it legal ?
  1503.  
  1504.  
  1505.    @                       SOA     (.........)
  1506.                            NS      ns.host.this.domain.
  1507.                            NS      second.host.another.domain.
  1508.    ns                      CNAME   third
  1509.    third           IN      A       xxx.xxx.xxx.xxx
  1510.  
  1511. No.  Only one RR type is allowed to refer, in its data field, to a CNAME,
  1512. and that's CNAME itself.  So CNAMEs can refer to CNAMEs but  NSs and MXs
  1513. cannot.
  1514.  
  1515. BIND 4.9.3 (Beta11 and later) explicitly syslogs this case rather than
  1516. simply failing as pre-4.9 servers did.  Here's a current example:
  1517.  
  1518.       Dec  7 00:52:18 gw named[17561]: "foobar.com IN NS" \
  1519.              points to a CNAME (foobar.foobar.com)
  1520.  
  1521. Here is the reason why:
  1522.  
  1523. Nameservers are not required to include CNAME records in the Additional
  1524. Info section returned after a query.  It's partly an implementation
  1525. decision and partly a part of the spec.  The algorithm described in RFC
  1526. 1034 (pp24,25; info also in RFC 1035, section 3.3.11, p 18) says 'Put
  1527. whatever addresses are available into the additional section, using glue
  1528. RRs [if necessary]'.  Since NS records are speced to contain only primary
  1529. names of hosts, not CNAMEs, then there's no reason for algorithm to
  1530. mention them. If, on the other hand, it's decided to allow CNAMEs in NS
  1531. records (and indeed in other records) then there's no reason that CNAME
  1532. records might not be included along with A records.  The Additional Info
  1533. section is intended for any information that might be useful but which
  1534. isn't strictly the answer to the DNS query processed.  It's an
  1535. implementation decision in as much as some servers used to follow CNAMEs
  1536. in  NS references.
  1537.  
  1538. -----------------------------------------------------------------------------
  1539.  
  1540. Question 6.7.  Nameserver forgets own A record
  1541.  
  1542. Date: Fri Dec  2 16:17:31 EST 1994
  1543.  
  1544. Q: Lately, I've been having trouble with named 4.9.2 and 4.9.3.  
  1545.    Periodically, the nameserver will seem to "forget" its own A record,
  1546.    although the other information stays intact.  One theory I had was
  1547.    that somehow a site that the nameserver was secondary for was
  1548.    "corrupting" the A record somehow.
  1549.  
  1550. A: This is invariably due to not removing ALL of the cached zones
  1551.    when you moved to 4.9.X. Remove ALL cached zones and restart
  1552.    your nameservers.
  1553.  
  1554.    You get "ignoreds" because the primaries for the relevant zones are
  1555.    running old versions of BIND which pass out more glue than is
  1556.    required. named-xfer trims off this extra glue.
  1557.  
  1558. -----------------------------------------------------------------------------
  1559.  
  1560. Question 6.8.  General problems (core dumps !)
  1561.  
  1562. Date: Sun Dec  4 22:21:22 EST 1994
  1563.  
  1564. Paul Vixie says:
  1565.  
  1566.    I'm always interested in hearing about cases where BIND dumps core.
  1567.    However, I need a stack trace.   Compile with -g and not -O (unless
  1568.    you are using gcc and know what you are doing) and then when it
  1569.    dumps core, get into dbx or gdb using the executable and the core
  1570.    file and use "bt" to get a stack trace.   Send it to me
  1571.    <paul@vix.com> along with specific circumstances leading to or
  1572.    surrounding the crash (test data, tail of the debug log, tail of the
  1573.    syslog... whatever matters) and ideally you should save your core
  1574.    dump for a day or so in case I have questions you can answer via
  1575.    gdb/dbx.
  1576.  
  1577. -----------------------------------------------------------------------------
  1578.  
  1579. Question 6.9.  malloc and DECstations
  1580.  
  1581. Date: Mon Jan  2 14:19:22 EST 1995
  1582.  
  1583. We have replaced malloc on our DECstations with a malloc that is more
  1584. compact in memory usage, and this helped the operation of bind a lot.  The
  1585. source is now available for anonymous ftp from
  1586.  
  1587. ftp.cs.wisc.edu : /pub/misc/malloc.tar.gz
  1588.  
  1589. -----------------------------------------------------------------------------
  1590.  
  1591. Question 6.10.  Can't resolve names without a "."
  1592.  
  1593. (Answer written by Mark Andrews) You are not using a RFC 1535 aware
  1594. resolver. Depending upon the age of your resolver you could try  adding a
  1595. search directive to resolv.conf.
  1596.  
  1597.     e.g.
  1598.     domain <domain>
  1599.     search <domain> [<domain2> ...]
  1600.  
  1601. If that doesn't work you can configure you server to serve the parent and
  1602. grandparent domains as this is the default search list.
  1603.  
  1604. "domain langley.af.mil" has an implicit "search langley.af.mil af.mil mil"
  1605. in the old resolvers, and you are timing out trying to resolve the
  1606. address with one of these domains tacked on.
  1607.  
  1608. When resolving internic.net the following will be tried in order.
  1609.  
  1610.         internic.net.langley.af.mil
  1611.         internic.net.af.mil
  1612.         internic.net.mil
  1613.         internic.net.
  1614.  
  1615. RFC 1535 aware resolvers try qualified address first.
  1616.  
  1617.         internic.net.
  1618.         internic.net.langley.af.mil
  1619.         internic.net.af.mil
  1620.         internic.net.mil
  1621.  
  1622. RFC 1535 documents the problems associated with the old search
  1623. algorithim,  including security issues, and how to alleviate some of the
  1624. problems.
  1625.  
  1626. -----------------------------------------------------------------------------
  1627.  
  1628. Question 6.11.  Why does swapping kill BIND ?
  1629.  
  1630. Date: Thu Jul  4 23:20:20 EDT 1996
  1631.  
  1632. The question was:
  1633.  
  1634.    I've been diagnosing a problem with BIND 4.9.x (where x is usually 3BETA9 
  1635.    or 3REL) for several months now.  I finally tracked it down to swap space
  1636.    utilization on the unix boxes.
  1637.  
  1638.    This happens under (at least) under Linux 1.2.9 & 1.2.13, SunOS 4.1.3U1, 
  1639.    4.1.1, and Solaris 2.5.  The symptom is that if these machines get into 
  1640.    swap at all bind quits resolving most, if not all queries.  Mind you that 
  1641.    these machines are not "swapping hard", but rather we're talking about a 
  1642.    several hundred K TEMPORARY deficiency.   I have noticed while digging 
  1643.    through various archives that there is some referral to "bind thrashing
  1644.    itself to death".   Is this what is happening ?
  1645.  
  1646. And the answer is:
  1647.  
  1648.    Yes it is. Bind can't tolerate having even a few pages swapped out.  
  1649.    The time required to send responses climbs to several seconds/request,
  1650.    and the request queue fills and overflows.
  1651.  
  1652.    It's possible to shrink memory consumption a lot by undefining STATS
  1653.    and XSTATS, and recompiling.  You could nuke DEBUG too, which will
  1654.    cut the code size down some, but probably not the data size.  If that
  1655.    doesn't do the job then it sounds like you'll need to move DNS onto a
  1656.    separate box.
  1657.  
  1658.    BIND tends to touch all of its resident pages all of the time with
  1659.    normal activity... if you look at the RSS verses the total process
  1660.    size, you will always see the RSS within, usually, 90% of the total
  1661.    size of the process.  This means that *any* paging of named-owned
  1662.    pages will stall named.  Thus, a machine running a heavily accessed
  1663.    named process cannot afford to swap *at all*.
  1664.  
  1665.    (Paul Vixie continues on this subject):
  1666.    I plan to try to get BIND to exhibit slightly better locality of
  1667.    reference in some future release.  Of course, I can only do this if
  1668.    the query names also exhibit some kind of hot spots.  If someone
  1669.    queries all your names often, BIND will have to touch all of its VM
  1670.    pool that often.  (Right now, BIND touches everything pretty often
  1671.    even if you're just hammering on some hot spots -- that's the part
  1672.    I'd like to fix.  Malloc isn't cooperating.)
  1673.  
  1674. -----------------------------------------------------------------------------
  1675.  
  1676. Question 6.12.  Resource limits warning in system
  1677.  
  1678. Date: Sun Feb 15 22:04:43 EST 1998
  1679.  
  1680. When bind-8.1.1 is started the following informational message appears in
  1681. the syslog...
  1682.  
  1683.    Feb 13 14:19:35 ns1named[1986]:
  1684.        "cannot set resource limits on this system"
  1685.  
  1686. What does this mean ?
  1687.  
  1688. A: It means that BIND doesn't know how to implement the "coresize",
  1689. "datasize", "stacksize", or "files" process limits on your OS.
  1690.  
  1691. If you're not using these options, you may ignore the message.
  1692.  
  1693. -----------------------------------------------------------------------------
  1694.  
  1695. Question 6.13.  ERROR:ns_forw: query...learnt
  1696.  
  1697. Date: Sun Feb 15 23:08:06 EST 1998
  1698.  
  1699. The following message appears in syslog:
  1700.  
  1701.    Jan 22 21:59:55 server1 named[21386]: ns_forw: query(testval) contains
  1702.         our address (dns1.foobar.org:1.2.3.4) learnt (A=:NS=)
  1703.  
  1704. what does it mean ?
  1705.  
  1706. A: This means that when it was looking up the NS records for the domain
  1707. containing "testval" (i.e. the root domain), it found an NS record
  1708. pointing to dns1.foobar.org, and the A record for this is 1.2.3.4.
  1709. This is server1's own IP address, but it's not authoritative for the
  1710. root domain.  The (A-:NS=) part of the message means that it didn't
  1711. learn these NS records from any other machine.
  1712.  
  1713. You may have listed dns1.foobar.org in your root server cache
  1714. file, even though it's not configured as a root server.  
  1715.  
  1716.  
  1717. \question 09jul:linuxq ERROR:recvfrom: Connection refused
  1718.  
  1719. Date: Wed Jul  9 21:57:40 EDT 1997
  1720.  
  1721. DNS on my linux system is reporting the error 
  1722.  
  1723. \verbatim
  1724. Mar 26 12:11:20 idg named[45]: recvfrom: Connection refused 
  1725.  
  1726. When I start or restart the named program I get no errors.  What could be
  1727. causing this ?
  1728.  
  1729. A: Are you running the BETA9 version of bind 4.9.3 ?   It is a bug that
  1730. does no harm and the error reporting was corrected in later releases.  You
  1731. should upgrade to a newer version of bind.
  1732.  
  1733. -----------------------------------------------------------------------------
  1734.  
  1735. Question 6.14.  ERROR:zone has trailing dot
  1736.  
  1737. Date: Wed Jul  9 22:11:51 EDT 1997
  1738.  
  1739. If syslog reports "zone has trailing dot", the zone information contains a
  1740. trailing dot in the named.boot file where it does not belong.
  1741.  
  1742.  
  1743.    example:
  1744.    secondary  domain.com.         xxx.xxx.xxx.xxx    S-domain.com
  1745.                         ^
  1746. -----------------------------------------------------------------------------
  1747.  
  1748. Question 6.15.  ERROR:Zone declared more then once
  1749.  
  1750. Date: Wed Jul  9 22:12:45 EDT 1997
  1751.  
  1752. If syslog reports "Zone declared more then once",
  1753.  
  1754. A zone is specified multiple times in the named.boot file
  1755.  
  1756.    example:
  1757.    secondary  domain.com         198.247.225.251    S-domain.com
  1758.    secondary  zone.com           198.247.225.251    S-zone.com
  1759.    primary    domain.com         P-domain.com
  1760.  
  1761.    domain.com is declared twice, once as primary, and once as secondary
  1762.  
  1763. -----------------------------------------------------------------------------
  1764.  
  1765. Question 6.16.  ERROR:response from unexpected source
  1766.  
  1767. Date: Wed Jul  9 22:12:45 EDT 1997
  1768.  
  1769. If syslog reports "response from unexpected source", BIND (pre 4.9.3) has
  1770. a bug if implimented on a multi homed server.  This error indicates that
  1771. the response to a query came from an address other then the one sent to.
  1772. So, if ace gets a response from an unexpected source, ace will ignore the
  1773. response.
  1774.  
  1775. -----------------------------------------------------------------------------
  1776.  
  1777. Question 6.17.  ERROR:record too short from [zone name]
  1778.  
  1779. Date: Mon Jun 15 21:34:49 EDT 1998
  1780.  
  1781. If syslog report "record too short from [zone name]", The secondary server
  1782. is trying to pull a zone from the primary server.  For some reason, the
  1783. primary sent an incomplete zone.  This usually is a problem at the primary
  1784. server.
  1785.  
  1786.    To troubleshoot, try this:
  1787.  
  1788.    dig [zonename] axfr @[primary IP address]
  1789.  
  1790.    Often, this is caused by a line broken in the middle.
  1791.  
  1792. When the primary server's "named.boot" file contains "xfrnets" entries
  1793. for other servers and the secondary is not listed, this error can occur.
  1794. Creating an "xfrnets" entry for the secondary will solve the error.
  1795.  
  1796. -----------------------------------------------------------------------------
  1797.  
  1798. Question 6.18.  ERROR:sysquery: findns error (3)
  1799.  
  1800. Date: Wed Jul  9 22:17:09 EDT 1997
  1801.  
  1802. If syslog reports "sysquery: findns error (3)" or
  1803. "qserial_query(zonename): sysquery FAILED", there is no ns record for  the
  1804. zone.  or the NS record is not defined correctly.
  1805.  
  1806. -----------------------------------------------------------------------------
  1807.  
  1808. Question 6.19.  ERROR:Err/TO getting serial# for XXX
  1809.  
  1810. Date: Wed Jul  9 22:18:41 EDT 1997
  1811.  
  1812. If syslog reports "Err/TO getting serial# for XXX", there could be a
  1813. number of possible errors:
  1814.  
  1815.    - An incorrect IP address in named.boot,
  1816.    - A network reachibility problem,
  1817.    - The primary is lame for the zone.
  1818.  
  1819. An external check to see if you can retrieve the SOA is the best way to
  1820. work out which it is.
  1821.  
  1822. -----------------------------------------------------------------------------
  1823.  
  1824. Question 6.20.  ERROR:zonename IN NS points to a CNAME
  1825.  
  1826. Date: Wed Jul  9 22:20:29 EDT 1997
  1827.  
  1828. If syslog reports "zonename IN NS points to a CNAME" or  "zonename IN MX
  1829. points to a CNAME", named is 'reminding' you that due to various RFCs, an
  1830. NS or MX record cannot point to a CNAME.
  1831.  
  1832.    EXAMPLE 1
  1833.    ---------
  1834.    domain.com    IN SOA      (...stuff...)
  1835.                  IN NS       ns.domain.com.
  1836.    ns            IN CNAME    machine.domain.com.
  1837.    machine       IN A        1.2.3.4
  1838.  
  1839.    The IN NS record points to ns, which is a CNAME for machine.  This
  1840.    is what results in the above error
  1841.  
  1842.    EXAMPLE 2
  1843.    ---------
  1844.    domain.com    IN SOA      (...stuff...)
  1845.                  IN MX       mail.domain.com.
  1846.    mail          IN CNAME    machine.domain.com.
  1847.    machine       IN A        1.2.3.4
  1848.  
  1849.    This would cause the MX variety of the error.
  1850.  
  1851.    The fix is point MX and NS records to a machine that is defined explicitly
  1852.    by an IN A record.
  1853.  
  1854. -----------------------------------------------------------------------------
  1855.  
  1856. Question 6.21.  ERROR:Masters for secondary zone [XX] unreachable
  1857.  
  1858. Date: Wed Jul  9 22:24:27 EDT 1997
  1859.  
  1860. If syslog reports "Masters for secondary zone [XX] unreachable", the
  1861. initial attempts to load a zone failed, and the name server is still
  1862. trying.  If this occurs multiple times, a problem exists, likely on the
  1863. primary server.  This is a fairly generic error, and could indicate a vast
  1864. number of problems.  It might be that named is not running on the primary
  1865. server, or they do not have the correct zone file.  If this keeps up long
  1866. enough a zone might expire.
  1867.  
  1868. -----------------------------------------------------------------------------
  1869.  
  1870. Question 6.22.  ERROR:secondary zone [XX] expired
  1871.  
  1872. Date: Wed Jul  9 22:25:53 EDT 1997
  1873.  
  1874. If syslog reports "secondary zone [XX] expired", there has been a
  1875. expiration of a secondary zone on this server.
  1876.  
  1877. An expired zone is one in which a transfer hasn't successfully been
  1878. completed in the amount of time specified before a zone expires.
  1879.  
  1880. This problem could be anything which prevents a zone transfer: The primary
  1881. server is down, named isn't running on the primary, named.boot has the
  1882. wrong IP address, etc.
  1883.  
  1884. -----------------------------------------------------------------------------
  1885.  
  1886. Question 6.23.  ERROR:bad response to SOA query from [address]
  1887.  
  1888. Date: Wed Jan 14 12:15:11 EST 1998
  1889.  
  1890. If syslog reports "bad response to SOA query from [address], zone [name]",
  1891. a syntax error may exist in the SOA record of the zone your server is
  1892. attempting to pull.
  1893.  
  1894. It may also indicate that the primary server is lame, possibly due to a
  1895. syntax error somewhere in the zone file.
  1896.  
  1897. -----------------------------------------------------------------------------
  1898.  
  1899. Question 6.24.  ERROR:premature EOF, fetching [zone]
  1900.  
  1901. Date: Wed Jul  9 22:28:26 EDT 1997
  1902.  
  1903. If syslog reports "premature EOF, fetching [zone]", a syntax error exists
  1904. on the zone at the primary location, likely towards the End of File (EOF)
  1905. location.
  1906.  
  1907. -----------------------------------------------------------------------------
  1908.  
  1909. Question 6.25.  ERROR:Zone [XX] SOA serial# rcvd from [Y] is < ours
  1910.  
  1911. Date: Wed Jul  9 22:30:03 EDT 1997
  1912.  
  1913. If syslog reports "Zone [name] SOA serial# rcvd from [address] is < ours",
  1914. the zone transfer failed because the primary machine has a lower serial
  1915. number in the SOA record than the one on file on this server.
  1916.  
  1917. -----------------------------------------------------------------------------
  1918.  
  1919. Question 6.26.  ERROR:connect(IP/address) for zone [XX] failed
  1920.  
  1921. Date: Wed Jan 14 12:21:40 EST 1998
  1922.  
  1923. If syslog reports "connect(address) for zone [name] failed: No route to
  1924. host" or "connect(address) for zone [name] failed: Connection timed out",
  1925. it could be that there is no route to the specified host or a slow primary
  1926. system.  Try a traceroute to the address specified to isolate the problem.
  1927. The problem may be a mistyped IP address in named.boot.
  1928.  
  1929. A very slow primary machine or a connection may have been initialized,
  1930. then connectivity lost for some reason, etc.  Try networking
  1931. troubleshooting  tools like ping and traceroute, then try connecting to
  1932. port 53 using  nslookup or dig.
  1933.  
  1934. If syslog reports "connect(address) for zone [name] failed: Connection
  1935. refused", the destination address is not allowing the connection.  Either
  1936. the destination is not running DNS (port 53), or possibly filtering the
  1937. connection from you.  It is also possible that the  named.boot is pointing
  1938. to the wrong address.
  1939.  
  1940. -----------------------------------------------------------------------------
  1941.  
  1942. Question 6.27.  ERROR:sysquery: no addrs found for NS
  1943.  
  1944. Date: Wed Jul  9 22:37:01 EDT 1997
  1945.  
  1946. If syslog reports "sysquery: no addrs found for NS" , the IN NS record may
  1947. be pointing to a host with no IN A record.
  1948.  
  1949. -----------------------------------------------------------------------------
  1950.  
  1951. Question 6.28.  ERROR:zone [name] rejected due to errors
  1952.  
  1953. Date: Wed Jul  9 22:37:51 EDT 1997
  1954.  
  1955. If syslog reports "primary zone [name] rejected due to errors", there will
  1956. likely be another more descriptive error along with this, like  "zonefile:
  1957. line 17: database format error".  That zone file should be investigated
  1958. for errors.
  1959.  
  1960. ===============================================================================
  1961.  
  1962. Section 7.  ACKNOWLEDGEMENTS
  1963.  
  1964.  Q7.1        How is this FAQ generated ?
  1965.  Q7.2        What formats are available ?
  1966.  Q7.3        Contributors
  1967.  
  1968. -----------------------------------------------------------------------------
  1969.  
  1970. Question 7.1.  How is this FAQ generated ?
  1971.  
  1972. Date: Mon Jun 15 21:45:53 EDT 1998
  1973.  
  1974. This FAQ is maintained in BFNN (Bizzarre Format with No Name).  This
  1975. allows me to create ASCII, HTML, and GNU info (postscript coming soon)
  1976. from one source file.
  1977.  
  1978. The perl script "bfnnconv.pl" that is available with the linux FAQ is used
  1979. to generate the various output files from the BFNN source.  This script is
  1980. available at
  1981.  
  1982. txs-11.mit.edu : /pub/linux/docs/linux-faq/linux-faq.source.tar.gz
  1983.  
  1984. -----------------------------------------------------------------------------
  1985.  
  1986. Question 7.2.  What formats are available ?
  1987.  
  1988. Date: Fri Dec  6 16:51:31 EST 1996
  1989.  
  1990. You may obtain one of the following formats for this document:
  1991.  
  1992. * ASCII: http://www.intac.com/~cdp/cptd-faq/cptd-faq.ascii
  1993. * BFNN: http://www.intac.com/~cdp/cptd-faq/cptd-faq.bfnn
  1994. * GNU info: http://www.intac.com/~cdp/cptd-faq/cptd-faq.info
  1995. * HTML: http://www.intac.com/~cdp/cptd-faq/index.html
  1996.  
  1997. -----------------------------------------------------------------------------
  1998.  
  1999. Question 7.3.  Contributors
  2000.  
  2001. Date: Thu Jul 16 10:45:57 EDT 1998
  2002.  
  2003. Many people have helped put this list together.  Listed in e-mail address
  2004. alphabetical order, the following people have contributed to this FAQ:
  2005.  
  2006. * <BERI@etf.bg.ac.yu> (Berislav Todorovic)
  2007. * <Benoit.Grange@inria.fr> (Benoit.Grange)
  2008. * <D.T.Shield@csc.liv.ac.uk> (Dave Shield)
  2009. * <Karl.Auer@anu.edu.au> (Karl Auer)
  2010. * <Todd.Aven@BankersTrust.Com>
  2011. * <adam@comptech.demon.co.uk> (Adam Goodfellow)
  2012. * <andras@is.co.za> (Andras Salamon)
  2013. * <barmar@bbnplanet.com> (Barry Margolin)
  2014. * <barr@pop.psu.edu> (David Barr)
  2015. * <bj@herbison.com> (B.J. Herbison)
  2016. * <bje@cbr.fidonet.org> (Ben Elliston)
  2017. * <brad@birch.ims.disa.mil> (Brad Knowles)
  2018. * <ckd@kei.com> (Christopher Davis)
  2019. * <cdp2582@hertz.njit.edu> (Chris Peckham)
  2020. * <cricket@hp.com> (Cricket Liu)
  2021. * <cudep@csv.warwick.ac.uk> (Ian 'Vato' Dickinson [ID17])
  2022. * <dj@netscape.com> (David Jagoda)
  2023. * <djk@cyber.com.au> (David Keegel)
  2024. * <dillon@best.com> (Matthew Dillon)
  2025. * <dparter@cs.wisc.edu> (David Parter)
  2026. * <e07@nikhef.nl> (Eric Wassenaar)
  2027. * <fitz@think.com> (Tom Fitzgerald)
  2028. * <fwp@CC.MsState.Edu> (Frank Peters)
  2029. * <gah@cco.caltech.edu> (Glen A. Herrmannsfeldt)
  2030. * <glenn@popco.com> (Glenn Fleishman)
  2031. * <harvey@indyvax.iupui.edu> (James Harvey)
  2032. * <hubert@cac.washington.edu> (Steve Hubert)
  2033. * <ivanl@pacific.net.sg> (Ivan Leong)
  2034. * <jpass@telxon.com> (Jim Pass)
  2035. * <jhawk@panix.com> (John Hawkinson)
  2036. * <jmalcolm@uunet.uu.net> (Joseph Malcolm)
  2037. * <jprovo@augustus.ultra.net> (Joe Provo)
  2038. * <jrs@foliage.com> (J. Richard Sladkey)
  2039. * <jsd@gamespot.com> (Jon Drukman)
  2040. * <jwells@pacificcoast.net> (John Wells)
  2041. * <kop@meme.com> (Karl O. Pinc)
  2042. * <kevin@cfc.com> (Kevin Darcy)
  2043. * <lamont@abstractsoft.com> (Sean T. Lamont)
  2044. * <lavondes@tidtest.total.fr> (Michel Lavondes)
  2045. * <mark@ucsalf.ac.uk> (Mark Powell)
  2046. * <marka@syd.dms.CSIRO.AU> (Mark Andrews)
  2047. * <mathias@unicorn.swi.com.sg> (Mathias Koerber)
  2048. * <mfuhr@dimensional.com> (Michael Fuhr)
  2049. * <mike@westie.gi.net> (Michael Hawk)
  2050. * <mjo@iao.ford.com> (Mike O'Connor)
  2051. * <nick@flapjack.ieunet.ie> (Nick Hilliard)
  2052. * <oppedahl@popserver.panix.com> (Carl Oppedahl)
  2053. * <patrick@oes.amdahl.com> (Patrick J. Horgan)
  2054. * <paul@software.com> (Paul Wren)
  2055. * <pb@fasterix.frmug.fr.net> (Pierre Beyssac)
  2056. * <ph10@cus.cam.ac.uk> (Philip Hazel)
  2057. * <phil@netpart.com> (Phil Trubey)
  2058. * <raj@ceeri.ernet.in> (Raj Singh)
  2059. * <rocky@panix.com> (R. Bernstein)
  2060. * <rv@seins.Informatik.Uni-Dortmund.DE> (Ruediger Volk)
  2061. * <sedwards@sedwards.com> (Steve Edwards)
  2062. * <shields@tembel.org> (Michael Shields)
  2063. * <spsprunk@pop.srv.paranet.com> (Stephen Sprunk)
  2064. * <tanner@george.arc.nasa.gov> (Rob Tanner)
  2065. * <vixie@vix.com> (Paul A Vixie)
  2066. * <wag@swl.msd.ray.com> (William Gianopoulos)
  2067. * <whg@inel.gov> (Bill Gray)
  2068. * <wolf@pasteur.fr> (Christophe Wolfhugel)
  2069.  
  2070. Thank you !
  2071.  
  2072.