Delete DNS zone record

This function deletes a DNS zone record.

Warning:

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

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.

Important:

When you disable the DNS role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
line
required
integer >= 1

The DNS zone record file's line number.

Example: line=4
zone
required
string <domain>

The zone record's domain.

Example: zone=example.com
serialnum
string

The zone file's serial number.

This parameter defaults to the zone file's current serial number.

Example: serialnum=2013122501
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/removezonerecord
Request samples
whmapi1 --output=jsonpretty \
  removezonerecord \
  zone='example.com' \
  line='4'
Response samples
application/json
{
  • "metadata": {
    • "command": "removezonerecord",
    • "reason": "Bind reloading on hostname using rndc zone: [example.com]\n",
    • "result": 1,
    • "version": 1
    }
}