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/editzonerecord?zone=example.com&line=4
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/editzonerecord?zone=example.com&line=4
 Command Line
whmapi0 editzonerecord zone=example.com line=4

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "result":[
      {
         "status":1,
         "statusmsg":"Wrote zone file."
      }
   ]
}
 Output (XML)
<removezonerecord>
     <result>
          <status>1</status>
          <statusmsg>Wrote zone file.</statusmsg>
     </result>
</removezonerecord>

   

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 line number.

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

 

Returns

ReturnTypeDescriptionPossible valuesExample
resulthashA hash of function status information.This hash contains the status and statusmsg returns. 

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message of success or a reason for failure.

The function returns this value in the result hash.

  • A message of success.
  • An error message.
Wrote zone file.