Mass Update /etc/localdomains and /etc/remotedomains

acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
I understand that when you edit the DNS zone in WHM, WHM will automatically check the MX record and place the domain in the correct file, localdomains vs. remotedomains. I would like to run this from the command line for all domains on the server. Is the script which WHM uses available to us on the command line? I've tried searching the forums and our /scripts directory but have been unable to locate it.
 

jandafields

Well-Known Member
May 6, 2004
435
4
168
USA
cPanel Access Level
Root Administrator
Would there be any problem adding "/scripts/checkalldomainsmxs" to daily cron? This would be beneficial because clients sometimes change their nameservers at the registrar, and the cPanel server does not know about the change, causing email problems. If this script is run daily, cPanel will know to stop handling emails for that domain.

I see that as an advantage. Are there any disadvantages???
 

jandafields

Well-Known Member
May 6, 2004
435
4
168
USA
cPanel Access Level
Root Administrator
I noticed that this script adds all "fake" domains to remotedomains. (Domains that are not registered at any official registrar, but are in the servers dns.)

I think it may be better to leave those domains in localdomains, or leave them out completely, and only put domains into remotedomains that have mx's that are actually pointing off of the server.

Also, this might also depend on whether or not resolv.conf points at your own server. Mine does not, which might explain this.

A bit off topic, but is it still a bad idea to point resolv.conf to your own server?