How to set a separate IP address for your domain and mailserver
If you change the IP address of your domain's A record, the IP address of your mail server automatically changes as well. This happens because the standard zone template uses a CNAME record to point mail
to the A record of a domain. If you wish to assign an IP address to the mailserver which is different from the IP address for the domain's A record, follow these steps:
-
Change the MX record to
mail.$domain.
, where$domain.
represents your domain. For example,example.com.
would change tomail.example.com.
-
Change the CNAME for mail into an A record to the IP address of the mail server.
-
Click Save.
* Note: You must include the trailing period after mail.example.com.
To change the zone template so that all new domains will create MX records which assign your mailserver a different IP address, follow these steps:
-
Navigate to the Edit Zone Templates scren in WHM. ( Home >> DNS Functions >> Edit Zone Templates ).
-
Click standard.
-
Change
%domain%. IN MX 0 %domain%.
to%domain%. IN MX 0 mail.%domain%.
-
Change
mail IN CNAME %domain%.
tomail IN A %IP%
. -
Click Save.
Your mailserver's IP address is now different from your domain's main A record.