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 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
3  
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

4 Answers 4

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 example.com, create a subdomain www.example.com

2) Use CNAME records to alias wwww.example.com to example-yournamespace-rhcloud.com

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

redirect 301 / http://www.example.com

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 mail.otherserver.com.

share|improve this answer

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.