Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 subdomain of a site, lets say which has an A record to the IP of another server, lets say 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: DNS:
    foo   A    xx.xx.xx.xx
    foo   MX DNS:
    mx    MX

Or could I set up a new dns zone on the example2 server which would just handle the MX record for the domain, where any mail sent to 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 – mdpc Jun 20 '11 at 19:58
because I wouldn't have continued access to the 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
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


  • If you have an A record for a host (, 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 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 point strait to instead.

EG, if you do want the MX to ultimately be, just do this instead: DNS:
    foo    A    xx.xx.xx.xx
    foo    A    10
share|improve this answer

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.