Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site hosted on Openshift and it allows users to add domain name aliases using an external DNS provider. I'm using Cloudflare for my DNS. However, since Openshift's IP addresses are known to change, you have to use CNAME records instead of A records. (Bad, I know!)

However, this then breaks my MX records and I want to use my domain host's free email redirection service.

Is there any workaround for this problem?

share|improve this question
Don't use their email service? Go third-party, Google Apps maybe? – Bart De Vos May 3 '12 at 8:50
But I'd still have to use their MX records right? So same problem still? – EddyR May 3 '12 at 8:54
No, you can just set them to Google's MXes then. – Bart De Vos May 3 '12 at 9:08
I'm not sure I see the difference without an A record. If you can explain further how Google Apps works in an answer I'd be happy to vote for it. – EddyR May 3 '12 at 9:32

From RFC 2181:

10.3. MX and NS records

The domain name used as the value of a NS resource record, or part of the value of a MX resource record must not be an alias. Not only is the specification clear on this point, but using an alias in either of these positions neither works as well as might be hoped, nor well fulfills the ambition that may have led to this approach. This domain name must have as its value one or more address records. Currently those will be A records, however in the future other record types giving addressing information may be acceptable. It can also have other RRs, but never a CNAME RR.

The reason for this is that you will need to do additional queries:

  • ask the IP for the MX record -> CNAME
  • ask the IP for this CNAME -> A record
  • ask the IP for that A record -> finally the IP

This causes a lot of overhead

share|improve this answer
I'm totally aware of this and so is Openshift I believe but it's just the way it's done for now. – EddyR May 3 '12 at 9:16
btw I'd go with Bar de Vos his solution and use google apps – Lucas Kauffman May 3 '12 at 10:20

I'd simply use a smarthost.

Besides, OpenShift is being developed very rapidly, if you have an issue, post it in the community, and it will be addressed

share|improve this answer

There is a workaround, like the guys in heroku state implicitly when talking about avoiding naked domains. I have tried in OpenShift and it works the same.

1) If you own the domain, create a subdomain

2) Use CNAME records to alias to

3) Redirect permanently (301) to For example, with .htaccess:

redirect 301 /

4) You haven't touch CNAME neither A records, so you can configure freely your MX records.

share|improve this answer

You can have an MX record without an A record, like below:

yourdomain. IN MX 50

share|improve this answer
But not with a CNAME, which he needs in order to use OpenShift – Nathan Fig Oct 12 '15 at 4:46

Your Answer


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.