Plesk

Unable to remove IP address from Plesk: Error The IP address 203.0.113.2 is already used for hosting.

Symptoms

Unable to remove a specific IP address under Tools & Settings > IP Addresses, the following error is displayed.

Error: The IP address 203.0.113.2 is already used for hosting.

Cause

One or several domains have the IP address 203.0.113.2 assigned.

Resolution

For a Windows server

  1. Connect to the server via RDP and open a command prompt.

  2. Display the list of domains which have the IP address 203.0.113.2 assigned:

    C:> plesk db -Nse "SELECT d.name 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 = 'web' OR ds.type = 'mail') and ipac.ipAddressId = (select id from IP_Addresses where ip_address='203.0.113.2') GROUP BY d.name ASC"

  3. Log in to Plesk.

  4. Change the domain IP address under Domains > example.com > Web Hosting Access > IPv4 address for every domain listed in the output of the command in step 2. Click Apply to apply the change.

  5. Remove the IP address under Tools & Settings > IP Addresses > Select the IP address > Remove.

For a Linux server

  1. Connect to the server via SSH.

  2. Display the list of domains which have the IP address 203.0.113.2 assigned:

    # plesk db -Nse "SELECT d.name 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 = 'web' OR ds.type = 'mail') and ipac.ipAddressId = (select id from IP_Addresses where ip_address='203.0.113.2') GROUP BY d.name ASC"

  3. Log in to Plesk.

  4. Change the domain IP address under Domains > example.com > Web Hosting Access > IPv4 address for each domain listed in the output of the command in step 2.

  5. Once done, remove the IP address under Tools & Settings > IP Addresses > Select the IP address > Remove.