What is local domain or remote domain? How it affects the mail service?


Because of the architecture of the Internet, domain services are not inherently bound to a single server. The website and email services associated with a domain can operate on separate physical servers. DNS plays a pivotal role in directing traffic to the appropriate destinations, but DNS alone cannot ensure the complete delivery of data. Exim, which serves as cPanel's SMTP service, requires supplementary configuration beyond DNS to effectively manage locally generated mail. This is where /etc/localdomains and /etc/remotedomains come into play.

In the world of emails and mail services, we have two special names for different types of email domains: "local domain" and "remote domain. These words matter because they affect how emails go out and come in. Let's take a closer look at what each of these means:

Local Domain:

A local domain typically refers to the domain name associated with the email server or system that you are currently using or managing. This domain is like your email server's home, and it shows that the email addresses belong to your organization.

Imagine you're the one responsible for managing your company's email system. The special name for your company's emails, like 'example.com,' is what we call the local domain. When an email address includes this name, like '[email protected],' it's like it's inside your email system's own network.

Remote Domain:

A remote domain, on the other hand, refers to any email domain that is external to your email server. These are email domains overseen by various email servers or services, such as Gmail (gmail.com) or Yahoo (yahoo.com).

When you send an email from your own domain to someone whose email address belongs to another domain, your email server has the task of determining the correct destination for delivering the message.

How it works:

When an email is sent from a cPanel server, a program called exim looks at two files, /etc/localdomains and /etc/remotedomains, to figure out where to send the email. If the domain is listed in /etc/localdomains, the email goes to a destination on the same server. If the domain is listed in /etc/remotedomains, the email is sent outside to the Internet.

It can be helpful when a website's software, like WordPress, sends email notifications. In this manner, it ensures that emails will be delivered accurately. If a website uses an external email server and isn't listed in the 'remotedomains' list, notifications from the CMS won't reach their destination.

How to set this option from your cPanel:

Step 1: Log in to your cPanel account

Step 2: Once you log in, find the option Email Routing under the Email section. Open it.

Step 3: Here, you will see a section like the following image:

In cPanel, once you select 'Local Mail Exchanger,' the domain will show up under 'localdomains.' On the other hand, if you go for 'Remote Mail Exchanger,' it will be found in 'remotedomains.' Now, if you decide on 'Backup Mail Exchanger,' the domain will be included in 'localdomains' as well. However, it will only receive emails in case no other mail servers are accessible.

Automatically Detect Configuration examines the DNS Mail Exchanger records to find out where the DNS is directed, and it configures settings accordingly. This is usually the recommended choice. But if the domain's DNS hasn't been configured yet, you can manually specify the Mail Exchanger settings.

How it affects mail service:

1. Routing: The distinction between local and remote domains is important for email routing. When an email is sent within your local domain, your email server typically handles the delivery directly without involving external servers. However, when the email is destined for a remote domain, your email server needs to determine the recipient's mail server's location and route the message accordingly.

2. Configuration: Email servers are configured to handle local and remote domains differently. Local domains are usually configured within the server's settings, and the server knows that it's responsible for delivering emails to addresses within that domain. Remote domains require DNS (Domain Name System) lookups to find the recipient's mail server, and the server communicates with the remote server to deliver the email.

3. Spam and Security: Email servers often apply different spam filtering and security measures to emails from local and remote domains. Suspicious emails from remote domains may undergo more rigorous checks to prevent spam and phishing attempts.

4. Authentication: Email authentication protocols like SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail) are used to verify the authenticity of email messages. Using these methods helps make sure that emails sent from your email address are less likely to be marked as spam or faked by malicious actors.


In summary, it's really important to know the difference between local and remote domains if you want to handle email services well. When you configure everything correctly to ensure emails reach their intended recipients seamlessly, it keeps everything running smoothly. At the same time, it's really important to put strong security measures in place to protect against unwanted spam and tricky phishing tricks.

Was this answer helpful?

« Back


/* */