Symptoms
Unable to remove IP address from IP addresses list at Tools & Settings > IP Addresses page:
IP address 203.0.113.3 cannot be removed because it is used by one or more domains with no hosting.
Cause
There are records in the Plesk database that contain the IP address regarding domains with no hosting.
Resolution
-
Back up Plesk database:
# plesk db dump > ~/psa_$(date +%F).sql
-
Find server's IP addresses id:
plesk db "select id,ip_address from IP_Addresses;"
+----+---------------------+
| id | ip_address |
+----+---------------------+
| 1 | 203.0.113.2 |
| 4 | 203.0.113.3 |
+----+---------------------+ -
Find which domain is using the required IP address:
plesk db 'select dp.param, dp.val, d.name from dom_param dp inner join domains d where dp.param="ip_addr_id" and dp.val="4" and dp.dom_id=d.id and d.htype not like "vrt_hst";'
+------------+------+------------------------+
| param | val | name |
+------------+------+------------------------+
| ip_addr_id | 4 | example.com |
+------------+------+------------------------+ -
Update this record and set one of the existing IP Addresses 203.0.113.2 for example:
plesk db "update dom_param set val=1 where param='ip_addr_id' and val=4;"