Child pages
  • WHM API 0 Functions - resetzone
Skip to end of metadata
Go to start of metadata

 

Description

This function resets a DNS zone to its default values. This also resets the domain's subdomain DNS records, and restores zone file subdomains in the server's httpd.conf file.

For example, use this function to restore DNS zones that are corrupt.

Note:

Zone resets preserve valid TXT records, but all other records will return to their default values. 

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/resetzone?domain=example.com
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/resetzone?domain=example.com
 Command Line
whmapi0 resetzone domain=example.com


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.
  • If you run CloudLinux™, you must use the full path of the whmapi0 command:

    /usr/local/cpanel/bin/whmapi0

 Output (JSON)
{
    "result":
    [
        {
            "status":1,
            "statusmsg":"Bind reloading on server1 using rndc zone:
                [example.com]\n"
        }
    ]
}
 Output (XML)
<resetzone>
    <result>
        <status>1</status>
        <statusmsg>
            Bind reloading on server1 using rndc zone: [example.com]
        </statusmsg>
    </result>
</resetzone>

   

Parameters

ParameterTypeDescriptionPossible valuesExample

domain

string

The domain.

Note:

You must include either the domain or the zone parameters. 

A valid domain on the server.example.com
zonestring

The zone file.

Note:

You must include either the domain or the zone parameters. 

A valid zone file name.zonefile
userstringThe domain's owner.A valid username on the server.user

 

Returns

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

status

BooleanWhether the function succeeded.
  • 1 — Success.
  • 0 — Failure.
1

statusmsg

stringA message of success, or a reason for failure.
  • A success message.
  • An error message.
Bind reloading on server1 using rndc zone: [ example.com ]\n