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..

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

Leave a Reply

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