Symptoms
-
An attempt to remove IP address in Tools & Settings > IP Addresses fails:
PLESK_ERROR: The IP address 203.0.113.2 is already used for hosting
-
This address is not used by any domains or resellers:
# plesk bin ipmanage –ip_list
State Type IP Clients Hosting PublicIP
0 S eth0:203.0.113.2/255.255.255.255 0 0
0 S eth0:203.0.113.3/255.255.255.255 0 3 -
The articles Cannot remove IP address: The IP address 203.0.113.2 is already used for hosting or Unable to remove IP address without any assigned domains: The IP address is already used for hosting have been applied and didn’t fix the issue.
-
DNS service is not installed or disabled on the server:
# plesk bin server_dns –info
The DNS service is not installed. -
This IP address is used for mail hosting for some domains:
# plesk db “SELECT d.name,ip.ip_address FROM DomainServices ds INNER JOIN IpAddressesCollections ipac ON ds.ipCollectionId = ipac.ipCollectionId INNER JOIN domains d ON d.id = ds.dom_id JOIN IP_Addresses ip on ipac.ipaddressid=ip.id WHERE ds.type = ‘mail’ and ipac.ipAddressId = (select id from IP_Addresses where ip_address=’203.0.113.2‘) GROUP BY d.name ASC;”
+————-+—————-+
| name | ip_address |
+————-+—————-+
| example.com | 203.0.113.2 |
+————-+—————-+
Cause
2 Plesk bugs PPPM-5911 and PPPM-11183, which will be fixed in one of the next Plesk updates.
Plesk doesn’t update the records in its database in case the DNS service is disabled/not installed.
Resolution
Until this bug is fixed, use the following workaround to switch mail to another IP address and be able to remove the IP address:
-
Find the domains using the IP address to be removed:
# plesk db “SELECT d.name,ip.ip_address FROM DomainServices ds INNER JOIN IpAddressesCollections ipac ON ds.ipCollectionId = ipac.ipCollectionId INNER JOIN domains d ON d.id = ds.dom_id JOIN IP_Addresses ip on ipac.ipaddressid=ip.id WHERE ds.type = ‘mail’ and ipac.ipAddressId = (select id from IP_Addresses where ip_address=’203.0.113.2‘) GROUP BY d.name ASC;”
+————-+—————-+
| name | ip_address |
+————-+—————-+
| example.com | 203.0.113.2 |
+————-+—————-+ -
Find the IP address used for web hosting on this domain:
# plesk bin domain –info example.com | grep -i “IP address”
IP address: 203.0.113.3 -
Select the option Send from domain IP addresses in Tools & Settings > Mail Server Settings > Send mail from specific IP (and remember the value set).
-
Update the domain to use the same IP for web and mail hosting:
# plesk bin domain -u example.com -mail-service-ip 203.0.113.3
-
Roll back to the previous setting in Tools & Settings > Mail Server Settings > Send mail from specific IP.
Note: The step 4 can be done with one single command…