2

I have a webserver running on an EC2. On that EC2 I'm receiving email.

I've created a load balancer (ELB) directing traffic to EC2

In route 53:

  • UPDATED A record for example.com to point to ELB
  • UPDATED CNAME record for @.example.com to point to ELB

I kept the following records:

  • MX record: *.example.com to point to 10 mail.domain.com
  • CNAME record: mail.example.com points to EC2

In this setup the load balancer is working, directing traffic to EC2.

However, if I send an email to user@example.com it doesn't reach EC2.

I'm pretty sure, I can set it up with a subdomain pointing to the loadbalancer, but I would prefer to have my main domain main point to the loadbalancer.

2

MX record: *.example.com matches everything but the naked (no subdomain) domain. So no MX for example.com. Aparently a friendly MTA will try the A record, which used to work for me, since it pointed to the EC2 handling my email.

Long story short. Removed the *. from the MX record and it worked.

I hope this will save someone a couple of hours of trying stuff...

  • 1
    Kudos for solving it yourself... but note that you have a second misconfiguration that also works, by accident. The target of an MX record is not technically allowed to be a CNAME. MX 10 foo.example.com. requires that foo.example.com. is NOT a CNAME, but an actual A record with the IP address of the host that accepts the mail. See RFC-2181 Section 10.3. – Michael - sqlbot Mar 8 '17 at 2:36
  • Thanks for pointing that out Michael! Will fix that too! – Ingcur Mar 8 '17 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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