Celebrate Our 22nd Anniversary with Huge Savings! Up to 70% Off

How to Delete a DNS Zone in WHM?

The DNS Zone Manager in WHM is a useful tool for managing DNS settings for domains on your server.

You might want to remove a DNS zone from your server at some point. This isn't as simple as deleting your web server's DNS entries. On cPanel servers, there could be more DNS entries than you realize. That's why cPanel (and WHM) offer a few ways to remove a DNS zone. 

1) Remove a DNS Zone via the cPanel account

2) Delete a Zone by domain name

3) Delete a DNS Zone using killdns Script

 

Removing a DNS Zone via cPanel Account

The simplest way to remove a DNS zone in cPanel is to delete the account that created it. When a cPanel account is created, it creates several DNS entries, including ones for add-on domains and subdomains. Deleting the account will remove all of these DNS entries.

However, this method is very drastic, as it will remove other domains you might not want to delete. Using the "Delete a DNS Zone" function is better if you only need to remove one DNS zone.

 

Delete a DNS Zone by Domain

If you don't want to (or can't) delete a DNS zone by removing the entire cPanel account, you can delete it by domain.

Step 1: Log in to WHM as the root user.

Step 2: In the menu, go to DNS Functions.

Step 3: Click Delete a DNS Zone.

Step 4: You'll see a list of DNS zones. Select the one(s) you want to delete, then click Delete.

Step 5: A confirmation list will appear. You can review it and adjust which DNS zones to keep or delete. Once you're ready, click Delete again.


Step 6: Once you click on the Delete button, WHM will then remove the selected DNS zones from your server.

If the selected DNS zone is for the primary domain, you can't delete it. You'll get an error message. 

To delete it, you need to either change or delete the primary domain first. After that, you can delete the DNS zone.

 

Using the killdns Script

If you're experiencing ongoing DNS problems, the issue might be with a DNS zone not linked to a cPanel account.

For users who are comfortable using the command line, there's a script called killdns. This powerful script should be used carefully. It will delete all DNS entries related to the domain you specify.

If the domain is part of a cPanel account, deleting it using the WHM interface, as described earlier is better. The killdns script is best for cases where a cPanel account does not manage the DNS.

To use it, log in to your server via SSH and run the command with the domain name:

/scripts/killdns demovpstest.com

 

Conclusion:

To delete a DNS zone in WHM, go to the DNS Functions section in the WHM dashboard and click on Delete a DNS Zone. Select the domain you want to delete from the list, then confirm the deletion. This will remove the DNS records for that domain, so it won't work through your server's DNS anymore. Be careful, as this cannot be undone, and the domain will stop working unless set up again elsewhere.


Was this answer helpful?

« Back

chat