Question: What does /etc/remotedomains and /etc/local domains mean on my Linux server? Should my domain be inside these files?
You have been brought here because you want to find out more information about the localdomains and remotedomains files located in the /etc/ folder (/etc/localdomains /etc/remotedomains) on a Linux server using (Apache).
Here are their standard definitions:
File: /etc/remotedomains - A simple file that contains a list of domains that will have their email hosted at another server or specified IP location. These foreign locations are listed and specified in the domains DNS Zone file. A domains DNS Zone file is normally located in /var/named/ and can be accessed with a pico command such as: pico /var/named/computerquestionhelp.com.db
So you may be asking, why don't you just change your domain's nameservers to the host that is handling the mail a domain that is listed in /etc/remotedomains? This is because this person might wish to have their website's hosted at the current host but have their email handled elsewhere. This is a common setup when dealing with google mail and some scripts designed to handle email.
By adding a domain to the /etc/remotedomains file the domain's web documents are being served at the current host while the domains email is being dealt with at another server.
File: /etc/localdomains - A simple file that contains a list of domains that will have their email hosted at the same host where there domains web documents are hosted. The MX record in the domains DNS Zone will still point to the current servers IP address even though email is being dealt with at the current server.
By adding a domain to the /etc/localdomains file this will ensure that all email is to be handled by the local server. (Where the website documents are served and hosted)
It is very important that you make sure that a domain resides in either one or the other file(s). If a domain is listed in both the remotedomains and localdomains file, you will have major email problems as Exim will not know where your email for this domain is to be routed too. If a domain is not listed in either of these files, the same actions will happen. Exim will not deliver email successfully to your domain because it doesn't know it's route path.
When do shared server migrations it is a easy thing to forget to add domains using mail remotely to the remotedomains file. By default actions of a migration you will find that it will place all listed domains into the local domains folder as this makes sense. When this happens scripts will break for these clients and you will get clients who are complaining their emails are bouncing back to themselves or back to the senders.
Questions and concerns can be addressed at the bottom of this blog page. I would love to hear others input on this so I can add more information to this blog in regards to these two files.