In my domain name control I have the following set:

@.domain.name MX <XX.XXX.XXX.XX>
@.domain.name A <XX.XXX.XXX.XX>

It used to be that both e-mail server for the domain, as well as the web server were on the same machine and had the same IP.

Now I am moving a web site to a different server. Will setting

@.domain.name A <YY.YYY.YYY.YY>

anyhow affect my email flow, or do only MX records relate to that?


MX records determine where mail is delivered to. In theory (and in 99+% of practice) you can change the A records for your machines all you want and mail will go to the right place (the caveat being if you're changing the A record for the host the MX record points to the mail will (obviously) go to the address that A record points to.

Your example seems to indicate that your MX record points to an IP address. If that is actually the case DON'T DO THAT -- MX Records are supposed to point to a hostname (A record). Pointing them at an IP address may result in undeliverable mail if the remote MTA is pedantic about such things.
Create a hostname first, and specify that in your MX records. e.g.

mail.mydomain.com.  IN  A
mydomain.com.       IN  MX mail.mydomain.com.
| improve this answer | |
  • 1
    Rejecting an MX record that contains an IP address literal is hardly pedantic. Such a record is just plain wrong! – Alnitak Nov 3 '11 at 9:14
  • @Alnitak "Be conservative in what you send ; Be liberal in what you accept." - If mail hosts rejected everything that was just plain wrong nobody would ever get email. Come to think of it that may not be such a terrible idea... – voretaq7 Nov 3 '11 at 14:43
  • I write RFCs for a living - no need to quote Postel's Law at me. The fact is though that unless your libraries automagically treat a dotted-quad in a string as a "valid" hostname you'd have to go out of your way to recognise the error and code around it. gethostbyname() does this, but res_query() doesn't. – Alnitak Nov 3 '11 at 16:39
  • @Alnitak I'm not disputing the wrongness of the behavior (it violates at least 2 generations of RFCs, as well as common sense - I'd be surprised if it isn't in the "common DNS errors" RFC), but there are some MTAs out there (exim) that can be configured to allow it, and probably others that log an error and still go out of their way to handle the brokenness & deliver the mail. All we good citizens can do is jump up and down and tell people not to do bad things. – voretaq7 Nov 3 '11 at 17:44

This is where MX records are for: http://tools.ietf.org/html/rfc5321#section-3.6.1 and http://tools.ietf.org/html/rfc1035 (section 3.2.2)

| improve this answer | |

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.