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

Operations Engineer at Endurance International Group. Linux lover. Like to play on Linux console. I started this blog to share and discuss Linux thoughts.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team CryBit.com
We like to travel. Our travelogues are published at Trip Mentor

Leave a Reply

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