MX lookup for all accounts

paulw32

Member
Jul 5, 2020
19
6
3
Australia
cPanel Access Level
Root Administrator
Is there a way to export MX of all mx records on the server? Possible through terminal?
And also to check which accounts are set up to handle mail locally or remotely?
 
Last edited:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Is there a way to export MX of all mx records on the server?
Can you clarify what you mean by this? Are you asking if there is a way to get all MX records for domains on your server in a list or?

If it's just the list of MX records the domains on your server use the following API function would get it for you https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+listmxs
in order to get all accounts you'd need to create a script that loops through the users.

And also to check which accounts are set up to handle mail locally or remotely?
When you set your mail exchanger to be local or remote (or auto) in the DNS zone file through WHM the domain is placed in either /etc/localdomains or /etc/remotedomains