Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mass change to Remote Mail Exchanger

Discussion in 'E-mail Discussions' started by smartypantsii, Dec 21, 2012.

  1. smartypantsii

    smartypantsii Registered

    Dec 21, 2012
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    We have several hundred domains on our various cPanel/WHM servers running 11.34.1. We have a separate email server solution and are not using cPanel email. Most of the domains are set to use the Local Mail Exchanger or Automatic. These settings stop php mail and email generated on the server from sending to the correct location. We have found that changing to use the Remote Mail Exchanger in the DNS editor or MX editor resolves this problem.

    We are looking for a way to change this setting on all of our domains on the server. I found that you can remove the domains from the /etc/localdomains and add it to /etc/remotedomains; However, the DNS zone editor does not pick up on the change. The DNS zone editor still shows the local mail exchanger setting. Is there another way this needs to be done or is there a script we should run after moving the domains to remotedomains?

    Thank you in advance.
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    The following command should be useful:

    # /scripts/checkalldomainsmxs
    This script will check the DNS Zones on your server and adjust the following files according to its findings:


    Aside from adjusting the MXCHECK value by hand (through the "WHM -> Edit DNS Zone" feature) the only other feasible solution would be if you choose to custom write your own script which used the cPanel API. Through this API, you would be able to take advantage of the following function:


    You could then utilize it to loop through all domains on the server and set their mxcheck value accordingly to "remote".

    Thank you.

Share This Page