In Progress [CPANEL-23579] Null MX record

Dan Garrow

Registered
Jan 24, 2017
2
0
1
United States
cPanel Access Level
Root Administrator
I would like to null route email at DNS level for domains that do not accept email.

RFC7505 specifies that adding a "Null MX" record with "with an RDATA section
consisting of preference number 0 and a zero-length label, written in
master files as ".", as the exchange domain, to denote that there
exists no mail exchanger for a domain."

Unfortunately cPanel gives an error "Unable to parse zone: Invalid DNS record: Supplied exchange for MX record is invalid" when trying to add the Null MX record.

CENTOS 6.9, WHM 70.0.34, BIND 9.8.2

I realize that it can be dropped at MTA and/or set to remote.

Has anyone had any luck with setting Null MX records?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,262
313
Houston
Hello,


Because of the DNS lookup that occurs when you modify the IP address associated with the MX record this won't function as you're intending. You can remove the MX record entry though.


Thanks!
 

ottdev

Well-Known Member
Oct 1, 2013
129
4
68
cPanel Access Level
Root Administrator
I submitted this a couple of months ago on Feature Requests requesting that you support Null MX per RFC. My feature request was removed by an admin stating that this error message is actually unintended, that it is a BUG - it *IS* supposed to support null mx records. The feature request was removed and IIRC the private message to me referred me to a bug tracker. I can not find ANY trace whatsoever in the feature request site within my profile where to re-read this message so I can follow that bug progress.

Please help ?!
I had hoped it was done before now and we have to decide whether to wait or take our DNS elsewhere.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,262
313
Houston
Hi @ottdev


As it turns out we do have a case opened for this CPANEL-23579. It appears this spawned due to the feature request. It looks like the workaround is to add it manually. Here's what the case notes for replication steps (posting in its entirety as i feel it's relevant)

Replication Steps:
1) Check current status of the MX record and zone:

Code:
# grep MX /var/named/domain.tld.db
domain.tld. IN MX 0 domain.tld.
# dig MX domain.tld +short @"$(hostname -i)"
0 domain.tld.
# named-checkzone domain.tld /var/named/domain.tld.db
zone domain.tld/IN: loaded serial 2018101600
OK
2) Attempt to add a '.' for the rdata in WHM > Edit DNS Zone, see that it fails


3) Add it manually and verify that named see's it as valid:

Code:
# sed -i -r '/MX/{s/ [^ ]+$/ ./}' /var/named/domain.tld.db
# /scripts/rebuilddnsconfig
# dig MX domain.tld +short @"$(hostname -i)"
0 .
# named-checkzone domain.tld /var/named/domain.tld.db
zone domain.tld/IN: loaded serial 2018101600
OK
Step 3 here is also the workaround for this until the case is addressed. I'll also update this thread when there is more information on the case or its status has been changed.


Thanks!