Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
It is impossible to delete the IP address via Tools & Settings > IP Addresses > 203.0.113.2 > Remove:
PLESK_ERROR: Error: The IP address
203.0.113.2
is already used for hosting. -
There are no domains assigned to this IP address
-
Previously, there were domains on this IP address, but they were switched to Forwarding or No Hosting hosting type in Domains > example.com > Hosting Settings
-
In Tools & Settings > Mail Server Settings > Outgoing mail mode is set to Send from domain IP addresses.
Cause
It is a Plesk bug #PPPM-8945 which is going to be fixed in future updates.
Resolution
Until a fix becomes available, use the following workarounds to switch mail to another IP address:
- Connect to the server via SSH
-
Create a list with the subscriptions assigned to the old IP address:
# OLDIPADDRESS="203.0.113.2"; 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='$OLDIPADDRESS') GROUP BY d.name ASC" > subscriptions.list
Note: Replace
OLDIPADDRESS
value with the IP address that is needed to be removed from Plesk. -
Change affected subscriptions with the new IP address:
# cat subscriptions.list | xargs -i plesk bin subscription -u {} -ip <new-ip-address> -mail-service-ip <new-ip-address>
Note: Where <new-ip-address> is one of the IP addresses existing in Plesk, and not the one that is needed to be removed.
Comments
4 comments
This doesnt seem to work with IPv6 Adresses, is there a way for IPv6 Adresses?
Hi @Johannes Hartmann,
The article works for IPv6 as well
I suppose, you have the selected "Send from the specified IP addresses" option with the affected IPv6 for the "Outgoing mail mode" directive at the "Plesk > Tools & Settings > Mail Server Settings" page
If so, switch the affected IPv6 from the "Send from the specified IP addresses" option to another value
Via CLI the switching can be done via next command:
# plesk bin mailserver --set-outgoing-email-mode explicit-ip -explicit-ipv4 203.0.113.2 -explicit-ipv6 2001:db8:f61:a1ff:0:0:0:80
After this, you have to be able to remove the IP address via "Plesk > Tools & Settings > IP Addresses > 1111:db8:f61:a1ff:0:0:0:11 > Remove"
Hi @Nikita thank you I totally forgot that, worked like a charm. But to lessen confusions you should swap the last IP in your answer to IPv6! Thank you very much for the help and have a great day!
Hi @Johannes Hartmann,
Glad to know that it did the trick!
And yes, a typo was in my command. Already changed it! Thanks and have a wonderful day as well!
Please sign in to leave a comment.