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

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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

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