I'd like to set a domain's root name to a CNAME instead of the usual A record.

Here's a perfect example of what I'm trying to do:

dig lrnskls.com

Notice the answer section:

;; ANSWER SECTION:

lrnskls.com. 300 IN CNAME partner.adjix.com.

partner.adjix.com. 300 IN A 67.121.212.61

The reason I'm trying to do this is so I can point a domain's root name, via a CNAME alias, to Amazon's S3. Using an A record doesn't work because S3's IPs change every few minutes for load balancing purposes.

Thanks, Joe

PS - This seems to be legal under section 3.6.2 of RFC 1034 (note the USC-ISIC.ARPA example): http://www.faqs.org/rfcs/rfc1034.html

link|improve this question
2  
Good point about it seemingly being legal according to the example in section 3.6.2. RFC1034 is from 1987, and should be read with an eye to present day needs. Some people / many people take it to be illegal in a modern day context, see serverfault.com/questions/55528/… . The best is IMHO to err on the side of caution, i.e. don't try to push DNS by using a config that some DNS servers could reject. – Jesper Mortensen Sep 4 '09 at 21:01
1  
@jesper - the RFC 1034 example is irrelevant. It shows a CNAME as a standalone record. A delegated .com domain must have an SOA record and NS records. The lrnskls.com configuration is technically invalid. – Alnitak Sep 4 '09 at 23:05
You should fix your terminology, "root name" is not a common term for what you describe (which seems to be the name of the apex of your zone). – bortzmeyer Sep 7 '09 at 10:02
feedback

migrated from stackoverflow.com Sep 4 '09 at 17:14

This question came from our site for professional and enthusiast programmers.

4 Answers

Amazon is aware of the problem with root domains and the Elastic Load Balancer. They recommend this workaround:

  • Configure the root domain to a service that redirects mydomain.com to www.mydomain.com (or any other subdomain of your choice)
  • Set up a CNAME record that maps the load balancer DNS name to "www.mydomain.com".

I don't like this solution, but is more "clean" that the "force root domain to CNAME" solution.

link|improve this answer
3  
+1 for pointing to the compliant way of doing this. To re-phrase this solution (also see the linked Amazon answer): You make a valid A record for the root domain, with valid SOA. That A record points to a 3rd party service that you have contracted to send HTTP level 301 / 302 redirects to www.mydomain.com . – Jesper Mortensen Sep 4 '09 at 20:48
feedback

No, it is not legal. CNAME is not allowed to coexist with other records and you need at least SOA here.

The example does not prove otherwise, because it does not imply having any other records there.

link|improve this answer
So, the real point of my question is how do I do this? How do I set up a domain's root name as a CNAME and not an A record? The "dig lrnskls.com" example works exactly as I'd expect it to work. Or, am I missing something is the dig example? – Anonymous Sep 4 '09 at 16:34
you can put it exactly like it's done for lrnskls.com — just put a CNAME record there, but it is illegal to have no SOA ;-) – Michael Krelin - hacker Sep 4 '09 at 16:42
So I'm guessing that there's no legal way to have a domain's root name point to S3 as a CNAME? – Anonymous Sep 4 '09 at 16:57
There's a legal way to have host, like s3stuff.example.com legally pointing to S3. – Michael Krelin - hacker Sep 4 '09 at 17:00
3  
Indeed, the proper solution is to have example.com NOT delegated and convince the .COM registry, Verisign, to add a CNAME in the .COM zone... Technically sound but Verisign and ICANN will certainly find non-technical reasons to refuse it. – bortzmeyer Sep 7 '09 at 10:04
show 5 more comments
feedback

But, my DNS server doesn't allow this; nor goes GoDaddy's DNS manager. So, I'm looking to do exactly what the owner of lrnskls.com did. Anyone know how he did it?

You are probably going to need to do some search into DNS servers. Most DNS servers do not allow you to do this. I think I remember seeing another question on serverfault where someone posted which DNS server someone used to setup a cname at the root, but I can't find it.

See also: - http://serverfault.com/questions/59760/root-cname-whm - http://serverfault.com/questions/55528/set-root-domain-record-to-be-a-cname

link|improve this answer
It was 1and1 according to this question serverfault.com/questions/55528/… – HD. Sep 4 '09 at 19:09
feedback

Hey, guys, we're getting off topic.

I'm looking for a way to point a domain's root name to AWS S3. I'm guessing that the best way to do this is to have the domain's root name set up as a CNAME to S3.amazonaws.com. But, my DNS server doesn't allow this; nor goes GoDaddy's DNS manager.

So, I'm looking to do exactly what the owner of lrnskls.com did. Anyone know how he did it?

link|improve this answer
You really should link your stackoverflow and serverfault accounts. Then you could edit the question instead of adding an answer. – Zoredache Sep 4 '09 at 18:50
As Hacker and HD have pointed out, there is no standards-compliant way of doing that within DNS. So don't do it. There is the way that HD described, in which you make your root domain entry a valid A record that points to a HTTP level 'forwarder', which issues HTTP 301 / 302 redirects. – Jesper Mortensen Sep 4 '09 at 20:44
lrnskls.com is interesting. Yes, it is invalid but it works in some cases. .COM does not have any technical checks on delegated domains so any crap you do in the zone is accepted. I assume that most registrars of .COM would not allow it. – bortzmeyer Sep 7 '09 at 10:08
feedback

Your Answer

 
or
required, but never shown