No, there is not. This is actually considered as an error, explained below.
In this case, where you want to redirect www to a completely different site, you'd remove both the CNAME
and the A
and replace it with another record of either the type A
or CNAME
, but not both.
Also notice that CNAME
works merely as an alias for the canonical name. It won't perform any actual redirection, as redirection is a function of the HTTP protocol, instead of DNS.
If a hostname has a CNAME
record, it must not have other resource records of other type. References:
RFC 1912, 2.4 CNAME records
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. Especially do not try to combine CNAME
s and NS
records
If you use a CNAME
, the DNS server should return both CNAME
record and the A
record for the canonical hostname it's pointing to. The same applies to IPv6 AAAA
records.
RFC 1034, 3.6.2 Aliases and canonical names
For example, suppose a name server was processing a query with for
USC-ISIC.ARPA
, asking for type A
information, and had the following
resource records:
USC-ISIC.ARPA IN CNAME C.ISI.EDU
C.ISI.EDU IN A 10.0.0.52
Both of these RRs would be returned in the response to the type A
query, while a type CNAME
or * query should return just the CNAME
.
The only exception is DNSSEC.
RFC 2181, 10.1 allowed SIG
, NXT
, and KEY
records, while the currently used definition is:
RFC 4035, 2.5 Changes to the CNAME Resource Record
If a CNAME
RRset is present at a name in a signed zone, appropriate
RRSIG
and NSEC
RRsets are REQUIRED at that name. A KEY
RRset at that
name for secure dynamic update purposes is also allowed ([RFC3007]).
Other types MUST NOT be present at that name.
This is a modification to the original CNAME
definition given in
[RFC1034]. The original definition of the CNAME
RR did not allow any
other types to coexist with a CNAME
record, but a signed zone requires
NSEC
and RRSIG
RRs for every authoritative name. To resolve this
conflict, this specification modifies the definition of the CNAME
resource record to allow it to coexist with NSEC
and RRSIG
RRs.