How to replace IP addresses in Plesk for Linux


2016-11-16 13:07:28 UTC


2017-08-17 00:08:27 UTC


Was this article helpful?

Have more questions?

Submit a request

How to replace IP addresses in Plesk for Linux

Applicable to:

  • Plesk for Linux


How to replace IP addresses with ones specified in Plesk database?


Note: Before manipulating the database, it is strongly recommended to create a backup ( KB #213904125 How to backup/restore a Plesk database dump?).

For Windows, please refer to #213907405 article.

In the simplest case where all domain IPs need to be updated to a single value, use the command below:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -Ns -uadmin -D psa -e 'select name from domains' | awk '{print "/usr/local/psa/bin/domain --update " $1 " -ip <IP address> "}' | sh

Note : replace <IP address> with the IP that needs to switch to. This IP should already exist in the system.

Omit the last | sh directive to preview the output of the command before executing it.

If a more complex IP change is needed (for example, if there are more than one destination IP and switches should be done between multiple IPs), then use script.

The utility ${PRODUCT_ROOT_D}/ is developed to replace IP addresses assigned to objects (domains/clients/resellers) in the Plesk database and to reconfigure object settings with the new IPs:

# /usr/local/psa/bin/
Plesk reconfigurator - utility to change IP addresses used by Plesk

Usage: /usr/local/psa/bin/ { <map_file> | --autoconfigure | --remap-ips | --help }

If <map_file> does not exist, a template will be created. Otherwise, it will be used to map IP addresses.

--autoconfigure option will attempt to create and process IP mapping automatically. Any new excessive or old unmapped IP addresses will retain their status and would need to be handled manually either by rereading IP addresses or by passing a correct map file to this utility.

--remap-ips is an alias for --autoconfigure option.

--help option displays this help page.

Follow these steps to perform the IP address replacement:

  1. Make sure that the new IP addresses are not registered in Plesk on the Plesk > Tools & Settings >  IP Addresses page. If they are, remove them before proceeding further.

  2. Run the utility to create the mapping template file:

    # /usr/local/psa/bin/

Then, edit this file and set the appropriate IP mapping. The mapping file matches the full list of the currently configured IP addresses with new ones in the following format:

   # cat
eth0: -> eth0:
eth0: -> eth0:

Edit the file and replace an IP address in the right part of a string with one from the new set:

   eth0: -> eth0:new_ip_address
  1. Once the mapping file contains an appropriate arrangement, run again:

    # /usr/local/psa/bin/

It will read the mapping file and perform the replacement according to its content.

  1. Repair the configuration for Plesk services:

    # /usr/local/psa/bin/repair -r

For Plesk 12.5 and higher

 # plesk bin reconfigurator --autoconfigure


Please note: script updates IP addresses in Plesk, but does not do anything with server network interface. If old IP address(es) are not needed any more, remove them from the network interface manually.

Additional information

For more details, please refer to Plesk documentation .

In case of any issues refer to KB #213363949 "Changing IP address fails with error: no such network interface".

In case the main IP address on the network interface is needed to be updated, check How to change or remove the main IP address on an interface through Plesk? article.

Have more questions? Submit a request
Please sign in to leave a comment.