Cobra Forum

Plesk Panel => Plesk Service/Interface => Topic started by: mahesh on Dec 26, 2023, 07:16 AM

Title: Unable to remove IP address from PLesk:
Post by: mahesh on Dec 26, 2023, 07:16 AM
Question:
Unable to remove IP address from PLesk: IP address 203.0.113.3 cannot be removed because it is used by one or more domains with no hosting.
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
1.Log in to the server via SSH/RDP.

2.Back up Plesk database:

#plesk db dump > ~/psa_$(date +%F).sql
3.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 |
+----+---------------------+
4.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 |
+------------+------+------------------------+
5.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;"