Plesk

How to change the main (primary) IP address in Plesk for Linux?

Question

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).

To change it, you need to update the corresponding database entries by following these steps:

  1. Log into your server via SSH
  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

Exit mobile version