Multiple CNAMEs disallowed?

Anne Bennett anne at alcor.concordia.ca
Wed Jul 7 19:14:08 UTC 1999


Well, I've pored over several RFCs and I've convinced myself that I can't
have multiple CNAMEs.  This posting was originally meant to check my
interpretation with the gurus, but now I've answered my own question.
I'm posting this anyway since someone else might have been wondering
the same thing, and I might save them a bit of work if so. :-/


I wanted to use several CNAME records to permit a service to fall back
automatically if one of the servers fails -- I realize that the order
in which RRs are given in a response is undetermined, and that's not a
problem.  I wanted something like this:

   serverhost CNAME realhost1
   serverhost CNAME realhost2

(all of them under the same origin).  I also realize that I would need to
test that the client program really will try the "second" server if the
"first" one doesn't respond, but that's a separate issue.

However, it was not clear to me whether I am allowed to have multiple
CNAME records.

RFC 1034 (Domain Concepts and Facilities) states:

  If a CNAME RR is present at a node, no other data should be
  present; this ensures that the data for a canonical name and its
  aliases cannot be different.

The rationale suggests that multiple CNAMEs would be OK, since the
actual data goes with the canonical name.  Hmm, no it doesn't, since
multiple canonical names could then have conflicting data.  Drat.

RFC 1912 (Common DNS Operational and Configuration Errors) tries to
clarify:

  A CNAME record is not allowed to coexist with any other data.  In other
  words, if suzy.podunk.xx is an alias for sue.podunk.xx, you can't
  also have an MX record for suzy.podunk.edu, or an A record, or even
  a TXT record.

If I can't have "any other data", this should disallow multiple
CNAMEs, but the subsequent enumeration of other RR types suggests that
the author had not considered the possiblity, so it remained unclear in
my mind.  Wishful thinking?

RFC 2136 (DNS UPDATE), however, is depressingly clear:

  The following RR types cannot be appended to an RRset.  If the following
  comparison rules are met, then an attempt to add the new RR will result
  in the replacement of the previous RR:
  [...]
          CNAME  compare only NAME, CLASS, and TYPE -- it is not
                 possible to have more than one CNAME RR, even if their
                 data fields differ.

So even if I could get it to work now, if I were to start using
dynamic updates, it would all break.   Sigh. :-(

Oh, well, I'll try to use A records instead for my multiple names.

Hope this is useful to someone (other than me!).


Anne.
-- 
Ms. Anne Bennett          anne at alcor.concordia.ca           +1 514 848-7606
Senior Analyst,  IITS,  Concordia University,  Montreal QC,  Canada H3G 1M8


More information about the bind-users mailing list