Child pages
  • WHM API 1 Functions - killdns
Skip to end of metadata
Go to start of metadata

Description

This function deletes a DNS zone.

Important:

  • The WHM API 1 adddns function adds an XDNS entry for a domain in the following locations:
    • The /var/cpanel/users/USER file, where USER represents the domain's owner.
    • The /etc/vdomainaliases/DOMAIN directory, where DOMAIN represents the new zone's domain.
    • The /etc/vfilters/DOMAIN directory, where DOMAIN represents the new zone's domain.
  • This function does not automatically delete these entries. You must manually delete these entries, or you cannot use this domain as a value in other API functions.
  • You cannot delete other DNS zones that reside on Write-only servers in a DNS cluster.

Important:

In cPanel & WHM version 76 and later, when you disable the DNS role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/killdns?api.version=1&domain=example.com
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/killdns?api.version=1&domain=example.com
 Command Line
whmapi1 killdns domain=example.com 


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "metadata": {
    "version": 1,
    "reason": "Zones Removed",
    "output": {
      "raw": "example.com => deleted from example. \n"
    },
    "result": 1,
    "command": "killdns"
  }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>Zones Removed</reason>
        <output>
            <raw>example.com =&gt; deleted from example.</raw>
        </output>
        <result>1</result>
        <command>killdns</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample

domain

string

Required

The zone record's domain.

A valid domain name on the server.example.com

Returns

This function only returns metadata.