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 Server Information section in Plesk for Linux?
- Is it possible to adjust the IP address that is displayed in the Server Information section of the Plesk dashboard?
Answer
The IP address displayed in the Server Information 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
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.
This article provides the workaround but doesn't address the root cause: the "Reread IP" function (and any process that triggers it, including maintenance tasks) resets ALL IPs to main=false when the primary IP of the network interface is not registered in Plesk.
This is a common scenario for anyone using a failover IP as their main Plesk IP (e.g. Hetzner failover IPs) while the server's primary interface IP has been removed from Plesk.
The impact is significant: since Plesk auto-updates run a pre-upgrade check that fails on missing main IP, this silently breaks automatic updates, leaving servers without security patches.
Current workaround: a cron job that periodically runs the SQL UPDATE from this article. This is not a proper solution.
Please consider:
1. Adding a -main flag to `plesk bin ipmanage` so this can be managed properly via CLI
2. Fixing the Reread IP logic so it doesn't reset the main flag when the flagged IP still exists in the database
Related forum thread confirming the same behavior… and it's an old thread about Plesk 12: https://talk.plesk.com/threads/pre-upgrade-check-from-12-0-18-to-12-5-30-warning.335768/
Please sign in to leave a comment.