how to prevent changes at /etc/localdomains during DNS editing at WHM. Cpanel 11

Nick

Member
Dec 27, 2001
17
0
301
Hello Guys,

We are using the dedicated mail server which forwards emails to the cpanel server
so MX entries of all our domains are not pointed to the cpanel server.
I have upgraded to Cpanle 11 and have probles with DNS editing now
each time when I edit the DNS zone at whm (any changes for exmapl just add SPF) it removes the domain from /etc/localdomains and add it to /etc/remotedomains
It shows the message
Reconfiguring Local Mail: This server will NOT serve as a mail exchanger for <domainname>

Please help me to disable this feature because I tired to edit localdomains each time
 

Rodney-E2

Member
PartnerNOC
Jun 25, 2005
24
0
151
Houston, TX
Same here, we have a spamAppliance and it is doing the same when we make any DNS change, it simply removes it from localdomains and adds to remotedomains.

Is there some feature to disable this?

This is a great feature for people switching to a exchange box or gmail or such, but this looks like it will be very very problematic for our application.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
79
458
cPanel Access Level
Root Administrator
Make certain you tick this box in the DNS Zone Editor before szving your changes:

"Always accept mail locally even if the primary mx does not point to this server"

That is available in Current, I don't know if it's in Release yet.
 

sloop

Well-Known Member
May 4, 2003
68
0
156
north carolina
Make certain you tick this box in the DNS Zone Editor before szving your changes:

"Always accept mail locally even if the primary mx does not point to this server"

That is available in Current, I don't know if it's in Release yet.
Thanks for your response. I'm running the latest RELEASE, its not in there. I will look forward to the next RELEASE and hopefully it will be there.
 

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,488
35
208
cPanel Access Level
DataCenter Provider
Thanks for your response. I'm running the latest RELEASE, its not in there. I will look forward to the next RELEASE and hopefully it will be there.
The domain has to be owned by a user for the box to appear. If the box is part of a dns cluster, you will have to check it on the server the user is on.
 

sloop

Well-Known Member
May 4, 2003
68
0
156
north carolina
The domain has to be owned by a user for the box to appear. If the box is part of a dns cluster, you will have to check it on the server the user is on.
Ok that makes sense. But if the domain is not owned by a user, why would it try to disable local mail delivery for that domain? It seems like it should check to see if the domain is hosted locally before trying to disable email delivery.
 

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,488
35
208
cPanel Access Level
DataCenter Provider
Ok that makes sense. But if the domain is not owned by a user, why would it try to disable local mail delivery for that domain? It seems like it should check to see if the domain is hosted locally before trying to disable email delivery.
If the domain resolves to any ip on the server it will be added to localdomains, if not it will be added to remotedomains.
 

Rodney-E2

Member
PartnerNOC
Jun 25, 2005
24
0
151
Houston, TX
If the domain resolves to any ip on the server it will be added to localdomains, if not it will be added to remotedomains.
Do you guys plan on making a option so that it will never goto the remotedomains file in case we are using a spam filtering appliance or such that will then relay mail to the server?
 

Nick

Member
Dec 27, 2001
17
0
301
The domain has to be owned by a user for the box to appear. If the box is part of a dns cluster, you will have to check it on the server the user is on.
Could you add this box to the WHM editor or add some optiont to the Tweak Settings?
my support is tired to remove domains from /etc/remotedomains each time
 

scottc

Well-Known Member
Apr 21, 2002
49
0
306
If the domain resolves to any ip on the server it will be added to localdomains, if not it will be added to remotedomains.
This doesn't seem to be true, regardless of whether "Automatically setup /etc/localdomains, /etc/remotedomains, /etc/secondarymx based on where the mx entry is pointed." is checked in Tweak Settings or not.

If we edit the DNS on domain for which no changes have been made since CP 11, the "Always accept mail locally even if the primary mx does not point to this server. " box is always unchecked. So ANY change made to the DNS settings halts local mail delivery unless the person doing the editing happens to notice the incorrect status of the checkbox. This also happens by simply opening the Edit DNS page and then clicking save without making any changes.

If we edit the DNS on domain that has been edited after CP 11 installation it will correctly report the status in the "Always accept mail locally even if the primary mx does not point to this server." checkbox.

Those behaviors do not change after changing the Tweak Settings checkbox.

We are using 11.4.18-C14158.

Scott
 

ianmarie

Well-Known Member
Mar 27, 2006
56
0
156
Same Here

My guess is that maybe if you use the default whm dns behaviour of making the primary mail server the same as the domain name
eg domain. mx 0 domain.
instead of what many people use
eg domain. mx 0 mail
then possibly the problem will go away (untested yet)

Not sure that the info in an earlier post is true; ie "that as long as your lowest numbered mx is pointing to an ip on that server" (or something like that); as this is the case on mine, but definitely moved the domain from locadomains to remotedomains when I did one edit of the customer's dns.
 

ianmarie

Well-Known Member
Mar 27, 2006
56
0
156
If the domain resolves to any ip on the server it will be added to localdomains, if not it will be added to remotedomains.
this statement does not prove as correct on my cpanel server

so dns says

domain. MX 0 mail
mail A serverip

serverip is an aliasip on the server

took the domain out of localdomains and put it in remotedomains when dns was updated with an unrelated new entry
 

jfgarcia

Registered
Aug 27, 2008
2
0
51
My guess is that maybe if you use the default whm dns behaviour of making the primary mail server the same as the domain name
eg domain. mx 0 domain.
instead of what many people use
eg domain. mx 0 mail
then possibly the problem will go away (untested yet)
Well, In my case, putting:
domain. mx 0 mail.

solves the problem. After save the data I get "This server will serve as the primary mail exchanger" and is listed in localdomains.

Thank you very much for the tip.