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

I want to host my website on EC2 and my mail servers on Google Apps. This would seem to be simple but I can't get the receiving of Mail to work due to a DNS issue. I have changed the MX records as required for my host but they aren't being picked up because my CNAME which is required for EC2 makes the DNS search for the MX on Amazon which is not what I want.

http://www.dnsstuff.com/tools/legacy/?formaction=DNSLOOKUP&ToolFormName=customlookup&name=kodental.co.uk&detail=0&type=MX

There are a couple of folks having similar mail issues which they solve by using A records not CNAMEs e.g. Setting up CNAME at DirectNIC.com caused gmail in Google Apps for Businesses to stop working "For compatibility reasons, you can't put a CNAME in the root domain; doing so will break email. Use an A record instead. "

But you can't use an A record with EC2 - you have to use a CNAME as the IP changes.

Are these services just incompatible and I have to move the sites web hosting to somewhere I can add an A record to an IP?

This is a bit of a pain so I thought I'd ask here if anyone has an alternative before I wade in.

Thanks

share|improve this question

migrated from stackoverflow.com Oct 8 '11 at 16:34

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

    
It's not clear what you're trying to point at. If it's an EC2 instance, you can associate an Elastic IP address with it, and use that for your A record. What you can't do is point an A record at an Elastic Load Balancer instance. This limitation is a PITA when you want foo.com (as opposed to www.foo.com) to resolve to the ELB. As @Eric rightly points out, the only known solution for that problem is to use Amazon's DNS service. And that is a problem if you're hosting a site for someone but not managing their DNS too. –  Jeff Oct 29 '11 at 20:00

1 Answer 1

up vote 3 down vote accepted

You cannot use a CNAME on the bare domain name (what you are calling the "root domain"). This is a known limitation of ELB (elastic load balancer) on EC2.

The solution, released recently by Amazon, is to use Amazon Route53 to host your DNS. This integrates with ELB to handle bare domains without CNAME. Your MX records can still be pointed at Google with Route53.

share|improve this answer
    
Thanks @Eric. As Route53 is not free it is cheaper for me to simply move the whole site to a server out of the cloud. Good to know how to approach this if I do a project where EC2 is a requirement. Best, Rob –  Rob Sep 26 '11 at 13:10
    
I'd be interested to know how much Route53 would cost for you. It seems pretty cheap to me unless you have hundreds of domains that don't get traffic: aws.amazon.com/route53/pricing –  Eric Hammond Sep 26 '11 at 17:42
    
Probably very little for Route53 but the cost for me personally is related the the otherwise unused EC2 instance ECU's not the Route53 cost. Others may find that the way to go. Thanks for your time. –  Rob Oct 5 '11 at 14:17

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.