Linode Forum
https://forum.linode.com/

CNAMEs pointing to @?
https://forum.linode.com/viewtopic.php?f=19&t=5774
Page 1 of 1

Author:  Guspaz [ Mon Jul 05, 2010 5:15 pm ]
Post subject:  CNAMEs pointing to @?

I recently experimentally moved one of my domains over from GoDaddy's name servers to Linodes. At GoDaddy, I had created a single A record (@) pointing to my IP, and then various CNAMEs for my subdomains which aliased @.

Looking at my zone file, it appears that the default (no host specified) type of A record creates an @ entry, but it won't let me specify @ as the alias for the CNAME.

Am I doing something wrong? How would I achieve this?

Author:  jed [ Mon Jul 05, 2010 5:32 pm ]
Post subject: 

I initially answered this question as if you were putting "@" as the target of the record, but rereading it sounds like you're trying a CNAME called "@". So, I'll answer both ways - a CNAME named @ and a CNAME with @ as the RDATA.

A CNAME called @ is illegal by the RFCs. There are implementations that allow it, but it is expressly forbidden by RFC 1912. The reason for this is that a canonical name is not allowed to coexist with any other records. When you render a zone in the DNS Manager, we inject SOA and NS records called "@", and RFC 1912 specifically mentions that case:

Code:
   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 CNAMEs and NS
   records like this!:

           podunk.xx.      IN      NS      ns1
                           IN      NS      ns2
                           IN      CNAME   mary
           mary            IN      A       1.2.3.4


As for "@" as the target of a record, just use the domain name itself. I don't know what will happen if you try to use "@", and my gut reaction is to say that "@" is only valid as the name of a record, and not the RDATA. I might be wrong.

Author:  Guspaz [ Mon Jul 05, 2010 5:40 pm ]
Post subject: 

Well, to try to be more clear, what I used to have, for fixppp.org

Type: A
name: @
data: IP_goes_here

Type: CNAME
name: www
data: @

Type: CNAME
name: hoth
data: @

etc.

In this manner, I pointed various subdomains at the same IP for vhost purposes, but only ever had the IP entered once.

I think you're saying that I do more or less the same thing, but instead of having the CNAMEs have "@" as data, they'd have "fixppp.org" as the data?

Author:  glg [ Mon Jul 05, 2010 5:53 pm ]
Post subject: 

Guspaz wrote:
I think you're saying that I do more or less the same thing, but instead of having the CNAMEs have "@" as data, they'd have "fixppp.org" as the data?


That's how I have mine setup.

Author:  jed [ Mon Jul 05, 2010 6:45 pm ]
Post subject: 

Guspaz wrote:
I think you're saying that I do more or less the same thing, but instead of having the CNAMEs have "@" as data, they'd have "fixppp.org" as the data?

Precisely.

Author:  Guspaz [ Sun Jul 11, 2010 8:52 pm ]
Post subject: 

jed wrote:
Guspaz wrote:
I think you're saying that I do more or less the same thing, but instead of having the CNAMEs have "@" as data, they'd have "fixppp.org" as the data?

Precisely.


I've gone ahead and done this, but I pulled the zone file from godaddy for another domain I have, here's an abbreviated copy:

Code:
; SOA Record
TEKNEWS.NET.   3600   IN   SOA   ns13.domaincontrol.com.   dns.jomax.net. (
            2004111500
            28800
            7200
            604800
            3600
            )

; A Records
@   1800   IN   A   68.234.14.10
ut2004   1800   IN   A   68.234.14.10

; CNAME Records
forums   1800   IN   CNAME   @
mail   1800   IN   CNAME   @
roughrider   1800   IN   CNAME   @
www   1800   IN   CNAME   @

; MX Records
@   3600   IN   MX   0   mail.teknews.net

; NS Records
@   3600   IN   NS   ns13.domaincontrol.com
@   3600   IN   NS   ns14.domaincontrol.com


It looks like this is valid and does what is intended. It's not a big deal, since entering the domain itself as the data of the CNAME like you suggested seems to do just what I want, but putting @ is slightly less annoying (works on any domain, don't need to keep track of what domain you're working on). Might want to confirm if it's valid; godaddy's zone file validator seems to think it's OK.

Author:  hoopycat [ Sun Jul 11, 2010 10:10 pm ]
Post subject: 

Names that point at other names should not (RFC 1034 sec 3.6.2) point at a CNAME, especially not MX records (RFC 974, "Minor Special Issues"):

Code:
@   3600   IN   MX   0   mail.teknews.net 
mail   1800   IN   CNAME   @

Author:  Guspaz [ Mon Jul 12, 2010 10:14 am ]
Post subject: 

hoopycat wrote:
Names that point at other names should not (RFC 1034 sec 3.6.2) point at a CNAME, especially not MX records (RFC 974, "Minor Special Issues"):

Code:
@   3600   IN   MX   0   mail.teknews.net 
mail   1800   IN   CNAME   @


RFC 974 specifically says that MX records pointing to CNAMEs is perfectly fine. The special case that you cite has to do with the local and remote host sharing aliases, which is pretty difficult for a host like teknews that is receive-only.

RFC1034 section 3.6.2 also does not forbid this, as it states that "Domain names in RRs which point at another name should always point at the primary name and not the alias.", and the MX record points at a CNAME belonging to the same domain rather than a different name.

Author:  hoopycat [ Mon Jul 12, 2010 5:40 pm ]
Post subject: 

The wording in the source RFCs is a little ambiguous, but RFC 2181 section 10.3 is quite direct:

Quote:
The domain name used as the value of a NS resource record, or part of the value of a MX resource record must not be an alias. Not only is the specification clear on this point, but using an alias in either of these positions neither works as well as might be hoped, nor well fulfills the ambition that may have led to this approach. This domain name must have as its value one or more address records. Currently those will be A records, however in the future other record types giving addressing information may be acceptable. It can also have other RRs, but never a CNAME RR.


(See also section 10.1.1 for definition of "alias" as the label of a CNAME resource record and justification for this choice of wording; see section 3 for definition of "must not" in this RFC, which differs from the standard RFC "MUST NOT".)

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/