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 have a subdomain of a site, lets say foo.example.com which has an A record to the IP of another server, lets say example2.com. Ideally, I would like to have the example2's server also take care of the MX record for the foo.example subdomain, but I'm not sure how this would work.

I'm wondering what the options are for doing this, whether this will work:

example.com DNS:
    foo   A    xx.xx.xx.xx
    foo   MX   mx.example2.com

example2.com DNS:
    mx    MX   mx.thirdserver.com

Or could I set up a new dns zone on the example2 server which would just handle the MX record for the foo.example.com domain, where any mail sent to foo.example.com would be handled by these mx records.

Or, alternately, should I solve this with a cname or dname record

share|improve this question
    
I'm curious as to why you don't have both MX records poing to mx.thirdserver.com. –  mdpc Jun 20 '11 at 19:58
    
because I wouldn't have continued access to the example.com DNS, and would like to just set one record and have the ability to change the MX on the second server, without requiring a change on the first. –  tgriesser Jun 20 '11 at 20:00

1 Answer 1

up vote 3 down vote accepted

Delegating the DNS zone for the subdomain is probably more effort than it's worth in this case.

Your first example is fine, with the exception that your MX record is badly formatted. You'll need a priority for the MX server, eg

    foo    A    10 mx.example2.com

However:

  • If you have an A record for a host (foo.example.com), and you address mail to someone@foo.example,com, in the absence of any MX records delivery will be attempted to the A record. So, you don't technically need an MX record for this use case, assuming that the IP address of foo.example.com is the same as the intended MX.

  • I'm not sure that chaining the MX as you have will work (eg, as your example suggests). It may do, I've never tried it. I'd strongly suggest skipping the chaining that you have, and just have the MX record for foo.example.com point strait to mx.thirdserver.com instead.

EG, if you do want the MX to ultimately be mx.thirdserver.com, just do this instead:

example.com DNS:
    foo    A    xx.xx.xx.xx
    foo    A    10 mx.thirdserver.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.