Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Change IP address of all the accounts on a cPanel server  (Read 3127 times)

0 Members and 1 Guest are viewing this topic.

dustin

  • Guest
Change IP address of all the accounts on a cPanel server
« on: November 03, 2013, 10:44:55 pm »
Script to change IP address of all the accounts.
===

The “Change Site IP Address” option is WHM is not feasible in case you need to change IP address of all the accounts on a server. In order to change IP address of all the domains on a cPanel server, you have to use the “swapip” script provided by cPanel.

The following script will do the needful:

for i in `cat /etc/trueuserdomains | cut -d: -f1`
do
/usr/local/cpanel/bin/swapip OLDIP NEWIP $i;
done;

where,

OLDIP is the current IP assigned to the domain.
NEWIP is the new IP which you would like to assign.
$i is the domain names read per line from the /etc/trueuserdomains file.

===