Understanding localdomain and remotedomain
In order to send the mails the website and email for a domain need not be in same server. DNS is used to point the services to the correct place. Exim, cPanel SMTP service needs a little help beyond DNS in order to know how to handle mail that is generated locally. This is where /etc/localdomains and /etc/remotedomains are usefull.
/etc/localdomains :
If the MX record of the domain is pointed to same server then there must be entry for that domain under /etc/localdomains file for local delivery of email.
/etc/remotedomains :
If you are using remote mail server then entry for that domain must be removed from /etc/localdomains files and should added in /etc/remotedomains files for proper routing of emails.
Setting this option during account creation
——————————————-
Local Mail Exchanger:-cPanel will place the domain in localdomains.
Remote Mail Exchanger :- It will place the domain in remotedomains.
Backup Mail Exchanger:- The domain will be added to localdomains but will only accept mail if there are no other mail servers available.
Automatically Detect Configuration:- It will check the DNS Mail Exchanger records to see where the DNS is pointed, and make the configuration based off of that.
Changing the exchanger after account creation in WHM
—————————————————–
In WHM, navigate to “Edit MX Entry” under “DNS Functions” in the left menu list.
From there, simply select the domain name you wish to edit, and then select the desired mail exchanger (Local Mail Exchanger, Backup Mail Exchanger, or Remote Mail Exchanger) to change the mail routing settings for the domain:
Changing the exchanger after account creation via SSH
———————————————————-
Modifying a domain to use a different exchanger is as simple as SSHing into the server and editing the files; simply remove the domain from one file and add it to the other. It is that simple. No need to restart services afterward.
How to change sites MX record to point mail to another domain or server.
————————————————————————-
An MX Record is used by a mail server to route incoming email. Changing your MX record is usually done to redirect email to a remote server.
To point the MX to another domain do the following.
1. Log into your WHM.
2. Click the Edit DNS Zone.
3. Select the domain name from the drop-down list.
4. Change the MX from domain.com to mail.domain.com.
5. Click the save button.
If you want to point it to another server using the same domain:
1. Log into your WHM.
2. Click the Edit DNS Zone.
3. Pick the domain you wish to edit.
4. Change the MX from domain.com to mail.domain.com.
5. mail.domain.com should have the A entry of the external mail server IP address.
6. Click the save button.
Note: You need to change the domain from /etc/localdomains to /etc/remotedomains for sending mails when your mail service is hosted on another server.
Leave a Reply