How to Remove a DNS Zone on a cPanel Server Using the API Make it Rain Paper

  • DNS, DNS Configuration, DNS Management
  • 0

Overview

This article explains how to remove a DNS zone on a cPanel server via the API. Using the correct API command is crucial for managing DNS zones effectively. This process should be done with caution, especially for domains not managed by a cPanel account.

Pre-requirements

  • Access to a cPanel server with WHM installed.
  • API access configured on the server.
  • Knowledge of the domain name you want to delete.
  • A terminal or command line interface for executing commands.

Steps to Remove a DNS Zone via API

Step Description
1 Open your terminal or command line interface.
2 Run the following API command:
 
whmapi1 --output=jsonpretty killdns domain='example.com'
3 Check the output for confirmation of the DNS zone deletion.

Linux CLI Command for Removing DNS Zone

You can use the following command to remove a DNS zone:

whmapi1 --output=jsonpretty killdns domain='example.com'

Gotchas to Avoid

  • Domain Management: Ensure the domain is not managed by a cPanel account before deletion.
  • Caution: Use this command carefully, as it permanently removes the DNS zone.
  • Backup: Consider backing up DNS records before deletion to prevent data loss.

Removing a DNS zone via the cPanel API can streamline your DNS management. By following the steps outlined in this article, you can safely delete DNS zones as needed. Always exercise caution and ensure that the domain is not associated with an active cPanel account.


Did this answer help?

« Back