Applicable to:
- Plesk for Linux
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.
Log into Plesk and go to Domains > example.com > Hosting & DNS > Hosting > IP addresses and choose from the drop-down list of all available IP addresses on a server.
Alternatively, the same operation can be performed via CLI. Connect to the server via SSH and execute:
# plesk bin subscription --update example.com -ip 203.0.113.3
To change IP for multiple 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
-
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
-
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.
Comments
0 comments
Please sign in to leave a comment.