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

Remove Zone Record — removezonerecord

This function allows you to remove a DNS zone record from the server.

To use this function most effectively, you should first run the dumpzone function for the domain(s) whose record(s) you wish to remove. The output of that function call will be used as a reference to create the input for this function.

  1. In the output of the dumpzone function, locate the Line variable corresponding to the data you wish to remove.
  2. Use the domain name and line number to formulate the removezonerecord function call as detailed below.

ALERT! Warning: Incorrect use of this function could prevent your domain from resolving properly. Please exercise caution when removing DNS zone records.

Calling Functions

Using the XML API

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

  • Append the /xml-api/removezonerecord 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/removezonerecord

  • 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 removezonerecord function from within your custom script:

  • Append the /json-api/removezonerecord 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/removezonerecord

  • 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 removezonerecord function takes the following required variables as input:

  • zone (string) — The domain name whose zone record you wish to remove.
  • Line (string) — The line number of the zone record you wish to remove.

Output

  • removezonerecord — Root-level XML tag for the output of the removezonerecord function.
    • result — Container for the results of the function.
      • status — Result of the function.
        • 1 — success.
        • 0 — failure.
      • statusmsg — Message about the result of the function.

Examples

XML API

Calling https://example.com:2087/xml-api/removezonerecord?domain=example.com&Line=40 in WebHost Manager will produce output similar to:

<removezonerecord>
     <result>
          <status>1</status>
          <statusmsg>Wrote zone file.</statusmsg>
     </result>
</removezonerecord>

JSON API

Calling https://example.com:2087/json-api/removezonerecord?domain=example.com&Line=40 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Wrote zone file."
      }
   ]
}

Topic revision: r3 - 26 Jul 2010 - 22:13:20 - Main.JustinSchaefer