Changing the Outgoing Mail IP Address in cPanel/WHM
You may need to change the IP address your cPanel & WHM server uses to send outgoing mail. This guide explains how to configure it. Note: root access to the server is required to apply these changes.
Procedure
- Log in to WHM.
- Navigate to Exim Configuration Manager.
- Make sure the option Reference /etc/mailips for outgoing SMTP connections is enabled.
- Access your server via SSH and edit the
/etc/mailips
file. - Add the following line, replacing
203.0.113.33
with the IP address you want to use:
Note: If you are running a NAT network configuration, enter the private IP address instead.*: 203.0.113.33
This will configure Exim to send outgoing mail for all domains using the specified IP address.
Multiple IP configuration
If you have multiple IP addresses and want to assign different IPs to specific domains, configure /etc/mailips
as follows:
domain1.tld: 203.0.113.11
domain2.tld: 203.0.113.22
*: 203.0.113.33
In this example:
- domain1.tld will use IP
203.0.113.11
. - domain2.tld will use IP
203.0.113.22
. - All other domains will use IP
203.0.113.33
.