Invalid DNS record: IP addresses are not allowable exchange values.

sehh

Well-Known Member
Feb 11, 2006
579
6
168
Europe
I'm trying to add a second MX entry to a domain with priority 10, via the WHM "Edit DNS Zone" page.

Unfortunately, I get the following error:

Invalid DNS record: IP addresses are not allowable exchange values.

The first MX entry is for mail.domain.com and the second MX entry that I'm trying to add is a plain IP address.

Any help would be appreciated.

Thank you.
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
25
143
Houston, TX
cPanel Access Level
Root Administrator
An MX record cannot point to an IP address or a CNAME record. An MX record must point to an A record, and the A record then points to an IP address. Trying to add an MX record that points to an IP address is invalid, and this is why the DNS editor is denying it.
 

sehh

Well-Known Member
Feb 11, 2006
579
6
168
Europe
First of all, thank you for the prompt reply, much appreciated.

So, in order for me to add a secondary MX server, I have to:

1) Create an A record (eg "mail2") which points to my IP address.
2) Create the secondary MX record to point to the above A record ("mail2.domain.com").

I'll give that a try. Thanks again.

PS:
Looking at various configurations, it seems that there ARE MX records which point to a CNAME. Maybe there is an exception to the rule? (MX points to mail.domain.com, which is a CNAME for the A record of domain.com).
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
25
143
Houston, TX
cPanel Access Level
Root Administrator
According to this RFC, the use of a CNAME in an MX record is discouraged, if not invalid:

http://www.rfc-editor.org/rfc/rfc2181.txt

I also found the following, which discuss the issue in some detail:

Exchangepedia: Should MX record point to CNAME records (aliases)?
Chapter 8 - CNAME Record

One important consideration is that, if an MX record points to a CNAME, then an addition DNS lookup must be done: one to find the MX record(s) for the domain, then another to get an A record for the CNAME, then yet another to get an IP address for the A record. Not using a CNAME prevents an additional DNS query.

It does appear that pointing an MX record to a CNAME, while it may work in some situations, should be avoided, if for no other reason than to avoid an extra DNS query.
 

sehh

Well-Known Member
Feb 11, 2006
579
6
168
Europe
Perfectly understood, nice explanation, thank you!