cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Add a feature to remove residual DNS entries from a server

Marcelo Pedra shared this idea 4 years ago
Open Discussion

As a system administrator I would like cPanel to add a tool that will remove DNS zone entries from the server that are for domains not associated with a cPanel account on that server, to avoid the work and potential for human error if I need to remove those zones manually.

This would be most useful in the situation where I have removed a server from a DNS cluster, and that server still has residual zone files from the other servers in that cluster.

Replies (2)

photo
2

This is definitely something that we have discussed internally as being a good feature to add. Currently there is a, potentially dangerous, workaround. I'll post it here with the caveat that if you (the reader, not necessarily the feature request submitter) are not familiar with the command line you may want to avoid this.

---------

Warning! IT IS IMPERATIVE THAT THIS DONE ON A MACHINE THAT IS NOT PART OF A CLUSTER at the time of this execution.

1) Step one is to run the unmanaged_zones autofixer. You do that by navigating to this URL in your browser, replacing ip.ip.ip.ip with your server's IP address or hostname.


  1. https://ip.ip.ip.ip:2087/scripts2/doautofixer?autofix=unmanaged_zones

Doing so creates two files on the system - /etc/managed_zones and /scripts/unmanaged_zones. The one we're concerned with here is unmanaged_zones.

2) Edit /etc/unmanaged_zones and remove any zones that should be removed from the server. Zone names listed in that file indicate that the zone should be on the server, even though it is not associated with a local cPanel account, and will be retained. Remove the zone names that you would like to be deleted.

3) If you haven't yet, remove the server from your DNS Cluster. Failure to do so will result in the zones not listed in 'unmanaged_zones' being removed from the entire cluster.

4) Run this script:


  1. /scripts/unmanaged_zones

The script will confirm for you which zones will be removed and then remove them.

---------

If you have questions about this workaround, please post those questions in the cPanel forum or ask your support team.

photo
1

It would be great if it could remove zones without removing them from the cluster.

We use separate nameservers and when moving an account from one server to another I think I have to leave the DNS on that server to not completely delete it from the cluster or delete it from that server and then on the new server push that zone back to the cluster.

I don't know if that's the right way or if I make things more complicated, but it just isn't clear to me how it works in this case.

Leave a Comment
 
Attach a file