Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Reset a DNS Zone — resetzone

You can use this function to restore a DNS zone to its default values. This includes any subdomain DNS records associated with the domain.

This function can be useful for restoring DNS zones that have become corrupted or have been improperly edited. It will also restore zone file subdomains listed in the server's httpd.conf file, along with default settings for new accounts.

PICK Remember: Valid TXT records are always preserved through a zone reset, however all other records will be returned to their default values.

Calling Functions

Using the XML API

To use the XML API to perform the resetzone function from within your custom script:

  • Append the /xml-api/resetzone function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/resetzone

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the resetzone function from within your custom script:

  • Append the /json-api/resetzone function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/resetzone

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The resetzone function takes the following variables as input. Only one of these variables is required:

  • domain (string) — The domain name whose zone should be reset.
    • Example: example.com
  • zone (string) — The DNS zone's filename.
    • Example: example.com.db

The resetzone function takes the following optional variable as input:

  • user (string) — The user who owns the domain name whose zone should be reset.
    • Example: john

Output

  • resetzone — Root-level XML tag for the output of the resetzone function.
    • result — Container for the information about the resetzone function call.
      • status (boolean) — Whether the call was successful.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Status or error message about the setresellernameservers function call.

Examples

XML API

Calling https://example.com:2087/xml-api/resetzone?user=joe&domain=example.com in WebHost Manager will produce output similar to:

<resetzone>
    <result>
        <status>1</status>
        <statusmsg>
            Bind reloading on server1 using rndc zone: [example.com]
        </statusmsg>
    </result>
</resetzone>

JSON API

Calling https://example.com:2087/json-api/resetzone?domain=example.com&user=joe in WebHost Manager will produce output similar to:

{
    "result":
    [
        {
            "status":1,
            "statusmsg":"Bind reloading on server1 using rndc zone: 
                [example.com]\n"
        }
    ]
}

Topic revision: r8 - 29 Sep 2009 - 17:57:19 - MelanieSeibert
AllDocumentation/AutomationIntegration.ResetZone moved from Sandbox.RestoreZone on 17 Aug 2009 - 19:48 by Main.JustinSchaefer