Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function deletes a DNS zone record.To effectively use this function, use the following workflow:

  1. Run the dumpzone function.
  2. Locate the Line value that corresponds to the zone record to delete.
  3. Use the values from that zone record to formulate the appropriate removezonerecord parameters.

Warning:

Incorrect use of this function could cause domains to resolve incorrectly. Excercise extreme caution when you remove DNS zone records.

Examples 


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

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": "Bind reloading on hostname using rndc zone: [example.com]\n",
    "result": 1,
    "command": "removezonerecord"
  }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>
            Bind reloading on hostname using rndc zone: [example.com]
        </reason>
        <result>1</result>
        <command>removezonerecord</command>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample

zone

string

Required

The zone record's domain.

A valid domain name on the server.example.com
lineinteger

Required

The DNS zone record file's line number.

A positive integer that represents a line number in the domain's DNS zone file.4
serialnumstringThe zone file's serial number.A valid serial number.2013122501

Returns

This function only returns metadata.