Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a domain, flyh2.com.

I use a CName to forward www.flyh2.com to flyh2.elasticbeanstalk.com where my web site is hosted. This is the only way Amazon allows custom domain names. A records aren't allowed.

I'd like people to simply type http://flyh2.com (without the www) and still have visitors see my web site.

Originally I used CName to forward both the naked and the www records to my web site, but it seemed to cause problems.

Incoming mail was being returned to sender:

Fwd: Returned mail: see transcript for details
<mark@flyh2.com>... Deferred: Connection timed out with flyh2.elasticbeanstalk.com.
Message could not be delivered for 6 hours
Message will be deleted from queue

Seems that the CName on the naked domain was overriding the MX records.

Now I've changed the CName on the flyh2.com record to point to www.flyh2.com and in turn www.flyh2.com to CName to flyh2.elasticbeanstalk.com.

My MX records are set up correctly, but the CName on the naked domain seems to override them. Do I have to use an A record?

Please advise. Apologies for incorrect terminology.

share|improve this question
    
How is your zone set up, I used to put in an A record for my unprefixed domains pointing to the web server that hosted the site.. –  NickW Feb 17 at 11:30
    
I fear you may be quite badly confused. flyh2.com is not an unqualified domain name; www is an unqualified domain name. That said, you may find that looking into MX records helps you solve your problem. And thank you for not redacting the domain name, at least! –  MadHatter Feb 17 at 11:31
    
@NickW I can't use an A record. It has to be a CName. –  Mark van Wyk Feb 18 at 12:57
    
@MadHatter, I changed my terminology to naked domain. I hope that's more correct. –  Mark van Wyk Feb 18 at 12:58
1  

2 Answers 2

up vote 6 down vote accepted

You cannot have a CNAME for the domain.

CNAMEs can only exist as single records and not combined with any other resource records. Since a domain always has a SOA and NS record, you cannot use a CNAME for the domain. This is specified in RFC 1034, section 3.6.2.

The reason that email specifically breaks is found in RFC 5321, section 5.1:

That domain name, when queried, MUST return at least one address record (e.g., A or AAAA RR) that gives the IP address of the SMTP server to which the message should be directed. Any other response, specifically including a value that will return a CNAME record when queried, lies outside the scope of this Standard. The prohibition on labels in the data that resolve to CNAMEs is discussed in more detail in RFC 2181, Section 10.3.

In other words - as long as your provider does not allowed A records, what you want cannot be done.

share|improve this answer
    
This doesn't even apply because 'www' is a subdomain. –  Peter Feb 19 at 8:38
1  
Yes, 'www' is a subdomain. However, the question is how to use a CNAME for the domain itself, in addition to the subdomain. –  Jenny D Feb 19 at 9:09
    
In that case, OP is very bad at explaining this. The sentence "I use a CName to forward www.flyh2.com to flyh2.elasticbeanstalk.com where my web site is hosted. This is the only way Amazon allows custom domain names. A records aren't allowed." conveys that the issue is with the subdomain. –  Peter Feb 19 at 11:39
3  
Try reading the rest of the question. –  Jenny D Feb 19 at 13:26
1  
Now using an A record to point the naked domain to a free redirect service - wwwizer.com/naked-domain-redirect - working like a charm... –  Mark van Wyk Feb 21 at 9:51

It doesn't sound like you know the correct definition of FQDN. It also doesn't sound like you know what a CNAME is for.

You will need to add in an MX record for your domain if you plan on sending mail there. Make sure that is added correctly and that your server is correctly configured to process mail.

share|improve this answer
    
Read up on FQDN. True. I was confused. I have to use CNames. Thats how Amazon Web Services works. The MX records are set up correctly and working. Mostly. –  Mark van Wyk Feb 18 at 13:00
    
I understand CNAMEs. Your post if quite difficult to understand so sorry if I misunderstood you. –  Peter Feb 19 at 9:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.