How to remove parked domain through command line – cpanel

In control panels like cPanel you can simply remove a parked domain via control panel options. Here I will explain how do we can remove a parked domain via command line.

Step 1: SSH to your server as root user.

[[email protected] #] ssh [email protected]

Step 2: Find out all details about the account from ‘/var/cpanel/users’. From that file you can simply find out all of the information including owner ship.

[[email protected] #] grep $username /var/cpanel/users
And remove it.

Step 3:

Remove the domain entry from /etc/named.conf and the cooresponding .db file from /var/named and restart your bind server.

Step 4:

Remove the virtual host or ServerAlias (whichever is applicable) from the /etc/httpd/conf/httpd.conf file and restart Apache

Step 5:

Remove files with that domain name as the filename from /etc/valiases, /etc/vdomainaliases, and /etc/vfilters.

Step 5:

If the domain is in /etc/localdomains or /etc/remotedomains then remove it from those files as well. Same goes for /etc/userdomains.

That’s it..

Post navigation

Arunlal Ashok

DevOps Engineer. Linux lover. Traveller.
Always happy for an open discussion! Write to arun ((@)) crybit ((dot)) com.

Leave a Reply

Your email address will not be published. Required fields are marked *