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'm wondering why I've heard a couple of times that it's bad to enter an IP directly as MX record. Most ISP's advise us to create an A record with the mailserver IP and use that A-record as MX record.

I've entered an IP as MX before and it worked most of the time but there were cases that it didn't work. Can't seem to find why.

Is there a reasonable explanation for this?

share|improve this question
up vote 4 down vote accepted

The various RFCs relating to DNS and mail exchange specify that an MX record consists of a preference value and an domain name with an address (A) record.

See RFC 2181, section 10.3:

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.
share|improve this answer
AAAA is the other common RR in use. – Niall Donegan Feb 22 '11 at 13:09
True, but RFC 2181 predates IPv6 by about 1.5 years, hence AAAA was not specifically mentioned. It is an "other record types giving addressing information" as mentioned in the RFC, so it can be used as an MX record's host part. – ThatGraemeGuy Feb 23 '11 at 5:40

the reson is usually given by the receiving MTA. normally, IP based mx records get blocked, because spammers use them all the time

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.