Question
How to change IP Address for domain in Plesk?
Answer
Note: If you don't have this menu or option, please contact server's administrator or Hosting Provider.
You can make the switch by following these steps:
1. Log into Plesk
2. Go to Domains > example.com > Hosting & DNS > Hosting
3. Find IP addresses in the Webspace settings section
4. Press on the dropdown and choose and IP address from the list of IP addresses that are currently configured for the Plesk server.
Alternatively, the same operation can be performed via commands (CLI) by following these steps:
1. Connect to the server via SSH as the root user
2. Execute the following command:
# plesk bin subscription --update example.com -ip 203.0.113.3
To change IP for multiple subscriptions
To change IP for all subscriptions:
-
Connect to the server via SSH
-
Create the list of all subscriptions:
# plesk bin subscription --list > /root/subscr.txt
-
(Optional) Edit file to remove subscriptions where changing IP address is not required
-
Run the following command to change the IP:
# cat /root/subscr.txt | while read i; do plesk bin subscription -u $i -ip 203.0.113.3 ; done
Assign a specific IP to all subscriptions
-
Connect to the server via SSH
-
Use the
subscription
CLI utility to change the IP addresses for all available subscriptions:-
For IPv4 addresses only:
# for sub in `plesk bin subscription -l`; do plesk bin subscription -u $sub -ip 203.0.113.2; done
-
For both IPv4 and IPv6 addresses:
# for sub in `plesk bin subscription -l`; do plesk bin subscription -u $sub -ip 203.0.113.2,2001:db8:f61:a1ff:0:0:0:80; done
-
Change IP for subscriptions currently assigned to a specific IP address
Warning: In case there are resellers using IP 203.0.113.2, launching the command below will lock them and they will not synchronize with their Service Plans.
Warning: both IP addresses have to be present in Tools & Settings > IP Addresses list.
-
Connect to the server via SSH
-
Create the list of all subscriptions on a server, which IP addresses are equal to 203.0.113.2:
# plesk db -Ne "select d.name from IP_Addresses ipa join IpAddressesCollections ipac on ipac.ipAddressId=ipa.id join DomainServices ds on ds.ipCollectionId=ipac.ipCollectionId join domains d on d.id=ds.dom_id join Subscriptions s on s.object_id=d.id where ds.type='web' and ipa.ip_address='203.0.113.2'" > ip-list.txt
-
Use the
subscription
CLI utility to change the IP addresses for all subscriptions in theip-list.txt
file to 203.0.113.3:# while read i; do plesk bin subscription -u $i -ip 203.0.113.3; done < ip-list.txt
Note: It is not possible to have domains with different IP addresses in on subscription.
Take part in our product improvement and vote for this feature on Plesk UserVoice.
The top-ranked suggestions are likely to be included in the next versions of Plesk.