Due to the nature of the Internet, services for one domain do not need to be on one server. The website and email for a domain do not need to be on the same physical server. DNS is used to direct the traffic to the correct place, but DNS alone will not get all the bits to where they are supposed to be. Exim, cPanel’s 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 come into play.
How it works
When an email is sent out from a cPanel server, exim checks /etc/localdomains and /etc/remotedomains in order to send the email to the correct place. If the domain is in /etc/localdomains, the mail is routed locally to the machine. If the domain is in /etc/remotedomains, the email is routed out to the Internet.
This is useful if the domain has some software installed that sends email notifications, such as a content management system like WordPress. This ensures that mail will get sent to the correct location. If a domain uses a remote server for email and the domain is not in remotedomains, notifcations from the CMS will not be delivered.
Setting this option during account creation
At the bottom of the account creation page in the Webhost Manager, you will see a section like the following image:
When set to Local Mail Exchanger, cPanel will place the domain in localdomains. If Remote Mail Exchanger is selected, it will place the domain in remotedomains. If Backup Mail Exchanger is selected, the domain will be added to localdomains but will only accept mail if there are no other mail servers available.
Automatically Detect Configuration will check the DNS Mail Exchanger records to see where the DNS is pointed, and make the configuration based off of that. Most of the time, this is the best option to select. However, if DNS has not been setup for the domain yet, you may wish to set the Exchanger manually.
Changing the exchanger after account creation
Changing the mail exchanger on the server is relatively easy. They are controlled by two files on the server, /etc/localdomains and /etc/remotedomains. Modify a domain to use a different exchanger is as simple as SSHing into the server and editing the files. Simply remove the domain from file and add it to the other file. It is that simple. No need to restart services afterward. The files will look something like the following.
root@host [~]# cat /etc/localdomains
domain.com
example.com
test.com
root@host [~]#
Making sure domains are in the correct file will help keep mail moving on its intended path. Localdomains and remotedomains are an often overlooked part of email administration, but is easy enough to fix. If you have any questions, or are unsure of which file a domain should be in, please give Heroic Support a call.
===
Liquid Web’s Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Toll Free 1.800.580.4985
International 517.322.0434
support@liquidweb.com
https://manage.liquidweb.com/
Related Articles






