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.

[root@spr #] ssh root@IPaddress

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.

[root@server #] 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..

Arunlal Ashok

DevOps (Server & Cloud infrastructure) Engineer. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Any questions? Write to arun (@)

You may also like...

Leave a Reply

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