Applicable to:
- Plesk for Linux
Question
- How to change the main (primary) IP address on a Plesk for Linux server?
- Can I switch the IP address that is displayed in the System Overview section in Plesk for Linux?
- Is it possible to adjust the IP address that is displayed in the System Overview section of the Plesk dashboard?
Answer
The IP address displayed in the System Overview section of the Plesk GUI is marked as the primary IP address in the Plesk database (psa).
Currently, a way to change what IP address is shown is not available via the Plesk GUI, however if you wish to have such a feature in Plesk in the future, you may vote for this feature suggestion on the following link:
Ability to set IP address on Plesk home page – Your Ideas for Plesk
For the moment, the only way to change the visible IP address is to update the corresponding database entries by following these steps:
1. Log into your server via SSH as the root user
Note: As a precaution, make a backup of the Plesk database (psa) by executing the following command:
# plesk db dump > /root/psa_dump"$(date -I)".sql
2. Access the Plesk database (psa):
# plesk db
3. Get a list of Plesk server IP addresses and their IDs:
# MariaDB [psa]> SELECT id, ip_address, main FROM IP_Addresses;
+----+-----------------------+-------+
| id | ip_address | main |
+----+-----------------------+-------+
| 1 | 203.0.113.2 | true |
| 2 | 2001:db8:f61:a1ff:0:0:0:80 | false |
+----+-----------------------+-------+
4. Change the main
value of the current main IP address to false
:
# MariaDB [psa]> UPDATE IP_Addresses SET main = 'false' WHERE id = '1';
Query OK, 1 row affected (0.002 sec)
Rows matched: 1 Changed: 1 Warnings: 0
5. Set the main
value of the new IP address that you wish to display in its place to true
:
# MariaDB [psa]> UPDATE IP_Addresses SET main = 'true' WHERE id = '2';
Query OK, 1 row affected (0.002 sec)
Rows matched: 1 Changed: 1 Warnings: 0
6. Check the IP addresses were updated correctly:
# MariaDB [psa]> SELECT id, ip_address, main FROM IP_Addresses;
+----+-----------------------+-------+
| id | ip_address | main |
+----+-----------------------+-------+
| 1 | 203.0.113.2 | false |
| 2 | 2001:db8:f61:a1ff:0:0:0:80 | true |
+----+-----------------------+-------+
2 rows in set (0.000 sec)
7. Exit the Plesk database editing screen:
# MariaDB [psa]> exit
Comments
1 comment
There is a difference between changing a value and switching which one is the main address. The values are still exactly the same, these instructions merely switch which one is the main address. Please either change your description of what this tutorial does or add instructions on actually changing the IP address which is what I was looking for.
Please sign in to leave a comment.