1

I'm very new to this so bear with me. I have a NameCheap account for DNS, an Amazon AWS Elastic Beanstalk account for hosting, and a Google GSuite account for email.

I want to set up my DNS so traffic from both mydomain.com and www.mydomain.com goes to my AWS site. At first, only www traffic was getting through. Then I added the "@" record below and it started working, but I think it might have broken my email because now I'm not receiving anything. It used to work and I didn't modify any of the MX records.

Type            Host   Value
CNAME Record    @      mydomain-prod.us-east-2.elasticbeanstalk.com.
CNAME Record    www    mydomain-prod.us-east-2.elasticbeanstalk.com.

How do I configure my DNS so traffic from both mydomain.com and www.mydomain.com goes to my AWS site and my email still works?

Edit - I don't think that this question is a duplicate. I'm asking how to make my email work with forwarding my bare domain to www. The linked question doesn't mention email and doesn't answer my question.

adam0101
  • 131

1 Answers1

3

You cannot have a cname record at your top level domain. This is a violation of RFC1912

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

Remove the Cname from the top level or @ record and add an a record that points to the ip address of your AWS domain.

Edit: Basically what is happening is you MX records are getting ignored with a CNAME at your top level domain. Most DNS services will not even allow a CNAME at the top level since it will break all other record types at the same level.

Your fix is to set your elastic beanstalk app to have a public ip address and then assign that as an A record to your DNS after removing the cnames. This will restore your email as the MX record will no longer be ignored. AWS

Joe
  • 1,190