Change Domain Name for cPanel Account from SSH Terminal

This article provides a quick solution for changing the domain name of a cPanel account. Root level access is required.

In the case that the cPanel account domain name should be quickly modified (such as ->, the following procedure can solve the issue.


  • Requires full root access
  • cPanel installed on server
  • Recent backup of account which is to be modified


As root user, access the server via SSH and run the following commands:

/scripts/removeacct --force username
/scripts/restorepkg --force /home/backupuser/backup/cpmove-username.tar.gz
mv /var/cpanel/userdata/username/ /var/cpanel/userdata/username/
mv /var/cpanel/userdata/username/ /var/cpanel/userdata/username/
sed -i -e 's/username\.com/username\.net/g' /var/cpanel/userdata/username/
rm -f /var/cpanel/userdata/username/cache
sed -i -e 's/username\.com/username\.net/g' /var/cpanel/userdata/username/main
rm -f /var/cpanel/userdata/username/main.cache
sed -i -e 's/username\.com/username\.net/g' /var/cpanel/users/username
mv /var/named/ /var/named/
sed -i -e 's/username\.com/username\.net/g' /var/named/
sed -i -e 's/username\.com/username\.net/g' /etc/named.conf
/scripts/updateuserdatacache --force username
rndc reload
#Changing Password
/scripts/chpass username myhardpassword
#Synching FTP pass
  • Substitute the cPanel account username for "username"

  • Substitute existing domain name for ""

  • Substitute the new domain name for ""

Was this answer helpful?

 Print this Article

Also Read

Operating System Requirements for Control Panel Software

This article provides the Operating System compatibility requirements for the Web...

Disable Network Manager on CentOS 7

This article will provide the steps to disable Network Manager in CentOS 7. Network Manager is...

How to Bind Additional IPs to Network Interface Card - CentOS

This article explains the process of binding multiple IP addresses to the Network Interface Card...

Do You Offer a Hardware Firewall Solution?

Yes, we have Cisco ASA 55XX serviWith the Cisco ASA firewalls, multiple services can be...

Assigning a Dedicated IP Address to a Subdomain using WHM

To assign a dedicated IP address to a subdomain, perform the following steps: Step 1: Add the...