/etc/mailips, for example *: 203.0.113.20. Set the matching host name in /etc/mailhelo, and make sure every IP has a PTR record and is in SPF.Why change the outgoing IP
- Reputation: keep a busy or risky account’s mail away from the IP the rest of the server uses.
- Separation: send transactional mail and newsletters from different IP addresses.
- Recovery: move mail to a clean IP while a blocklisted one is being delisted. Fix the cause first, or the new IP will be listed too.
Before you start
- ✓ Extra IPv4 addresses assigned to the server. Check WHM > IP Functions > Show IP Address Usage.
- ✓ A reverse DNS (PTR) record for each sending IP that matches the host name it uses. Your host sets PTR records.
- ✓ Access to each domain’s DNS, to update SPF.
Option 1: send from each account’s own IP
If accounts already have dedicated IP addresses (set in Account Functions > Change Site’s IP Address), this is the simplest option:
- In WHM, open Service Configuration > Exim Configuration Manager.
- In the Basic Editor, open Domains and IPs.
- Turn on Send mail from the account’s IP address.
- Save. WHM rebuilds the Exim configuration.
Accounts on the shared IP keep sending from the main IP.
Option 2: choose the IPs with /etc/mailips
For full control, list the outgoing IP for each domain in /etc/mailips. A * line sets the default for all other domains:
# /etc/mailips
example.com: 203.0.113.21
shop.example.net: 203.0.113.22
*: 203.0.113.20
Then set the host name Exim announces for each IP in /etc/mailhelo. It should match the PTR record of the IP:
# /etc/mailhelo
example.com: mail1.example.org
shop.example.net: mail2.example.org
*: server.example.org
Finally, in Exim Configuration Manager > Basic Editor > Domains and IPs, turn on Reference /etc/mailips for outgoing SMTP connections and Reference /etc/mailhelo for outgoing SMTP HELO, then save.
Do not edit the remote_smtp transport by hand:
Changing interface in the Advanced Editor or in /etc/exim.conf bypasses cPanel’s IP selection and can be lost on rebuild. Use the options above.
Update DNS for each sending IP
| Record | What to set |
|---|---|
| PTR (reverse DNS) | The sending IP must point to the host name in /etc/mailhelo, and that host name must point back to the IP. |
| SPF | Add the new IP to the SPF record of every domain that uses it, for example ip4:203.0.113.21. |
| DKIM | No change needed: DKIM signs by domain, not by IP. |
WHM’s Email Deliverability page checks SPF and DKIM for each domain. See our Email Deliverability guide.
Test the change
# Send a test and watch which IP Exim uses
echo "IP test" | mail -s "Outgoing IP test" you@example.org
tail -f /var/log/exim_mainlog
At the receiving end, open the message headers. The first Received: line added by the recipient’s server shows the IP address your message came from. Check that SPF passes for it.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| Mail still leaves from the main IP | The Reference /etc/mailips option is off, or the domain is not listed | Turn the option on and add the domain or a * line. |
| Receiving servers reject the mail | No PTR record, or it does not match the HELO name | Ask your host to set the PTR record to match /etc/mailhelo. |
| Messages fail SPF | The new IP is not in the domain’s SPF record | Add the IP to SPF. |
| The new IP is blocklisted soon | The account that caused the problem still sends spam | Find the source first. See our spam tracing guide. |
Need help with this?
Need extra IPs or help with mail reputation? Our team can set up sending IPs, PTR records and SPF for you.
Frequently asked questions
How do I change the IP Exim sends mail from on cPanel?
List the IPs in /etc/mailips and turn on Reference /etc/mailips for outgoing SMTP connections in Exim Configuration Manager.
Can each domain send from a different IP?
Yes. Add one line per domain to /etc/mailips, or turn on Send mail from the account’s IP address for accounts with dedicated IPs.
What is /etc/mailhelo for?
It sets the host name Exim announces for each IP. It should match the IP’s PTR record.
Do I need to change SPF after changing the IP?
Yes. Add the new IP to the SPF record of every domain that sends from it.
Will changing the IP fix a blocklisting?
Only temporarily if the cause remains. Stop the source of spam first, then request delisting.
Related guides
