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



integrationblogcta.jpg

ZoneEdit Module Documentation

This module allows users to modify their domains.

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

ZoneEdit::add_zone_record

API Version: 2 - Click here for documentation
Description: Add an A, CNAME, or TXT record to a zone file, specified by line number. You must have access to either 'zoneedit' or 'simplezoneedit' features. This function does not work in DEMO mode.
Parameters:  
  domain (string)
  The domain for which you wish to add an entry.
  name (string)
  The name of the record. This value maps directly to the subdomain that will be used.
  type (string)
  The type of record you wish to add to the zone file. Acceptable values include 'A', 'CNAME', or 'TXT'. Each type of record requires a specific parameter.
  txtdata (string (optional))
  The text you wish to contain in your TXT record. This parameter is required when 'TXT' is specified in the 'type' parameter.
  cname (string (optional))
  The domain to which you wish to alias. This parameter is required when 'CNAME' is specified in the 'type' parameter.
  address (string (optional))
  The IP address to map to the subdomain. This parameter is required when 'A' is specified in the 'type' parameter.
  ttl (int (optional))
  The new record's time to live in seconds.
  class (string (optional))
  The class to be used for the record. Ordinarily, this parameter is not required.
Returns:  
 
<data>
  <newserial> An integer value that contains the new serial number for the zone.</newserial>
  <statusmsg> A string value that contains a message of success or a relevant error message. (e.g. 'Bind reloading on bilbo using rndc zone: [example.com]' if successful)</statusmsg>
  <status> A boolean value that indicates whether or not the function completed successfully. '1' if successful, '0' if failed.</status>
  <name> A string value that contains the string 'result'.</name>
</data>

ZoneEdit::resetzone

API Version: 2 - Click here for documentation
Description: Revert a zone file to its original state.
Parameters:  
  domain (string)
  The domain that corresponds to the zone file you wish to revert.
Returns:  
 
<data>
  <status> A boolean value that indicates success or failure. '1' if successful.</status>
  <statusmsg> A string value that contains a message of success or a failure message.</statusmsg>
  <checkmx>
    <mxcheck> A string value that contains the type of mail exchanger that has been deleted. (e.g. 'local', 'remote', 'secondary', or 'auto'.)</mxcheck>
    <detected> This value is the same same as mxcheck.</detected>
    <isprimary> A boolean indicating whether or not the domain is the primary domain for the account. '1' if the domain is the primary domain.</isprimary>
    <secondary> A boolean value that indicates whether or not the mail exchanger is the secondary exchanger. '1' if the mail exchanger is a secondary exchanger.</secondary>
    <remote> A boolean value that represents whether or not the mail exchanger that has just been deleted was a remote mail exchanger. '1' if the exchanger was a remote mail exchanger. '0' if it was not.</remote>
    <changed> A boolean value that represents whether or not a change has occurred. '1' if a change has occurred. '0' if one has not.</changed>
    <warnings> A string value that contains any warnings about the deletion of the mail exchanger.</warnings>
    <issecondary> A boolean value that represents whether or not the mail exchanger that has just been deleted was a primary mail exchanger. '1' if the exchanger was primary (local) exchanger. '0' if it was not.</issecondary>
    <local> A boolean value that represents whether or not the mail exchanger that has just been deleted was a local mail exchanger. '1' if the exchanger was local. '0' if it was not.</local>
  </checkmx>

</data>

ZoneEdit::fetchzone

API Version: 2 - Click here for documentation
Description: Retrieve DNS zone information for a domain. The function's output is a list of hashes representing lines in the file. Each column with data is represented as a hash item.
Parameters:  
  keys (optional) (string)
  This parameter can contain a series of values, all of which act the same way. Each value acts as a "grep," searching the data structure for a single hash (line of the zone file). Acceptable values include 'line', 'ttl', 'name', 'class', 'address', 'type', 'txtdata', 'preference', and 'exchange'. If for example, you set 'exchange' => 'example.com', the function will return the hash that contains the MX record that corresponds to example.com.
  customonly (optional) (boolean)
  Entering a value of '1' here will cause the function to return only non-essential A and CNAME records. These will include 'www.*', 'ftp.*', 'mail.*', and 'localhost.*'.
  domain (string)
  The domain that corresponds to the zone file you wish to retrieve.
Returns:  
 
<data>
  <statusmsg> A string value that contains a message of success or reason for failure.</statusmsg>
  <record> Note: This is a list of potential values. Different lines of the zone will have different keys.
    <ttl> An integer value that contains the zone file's time to live. This value is always returned.</ttl>
    <name> A string value that contains the domain name.</name>
    <preference> An integer value that contains the mail exchanger's priority.</preference>
    <record> A string value that contains either the IP address or CNAME target name.</record>
    <Line> An integer value that contains the number of lines in the zone file.</Line>
    <type> A string value that contains the record type. (e.g. 'MX' or 'A')</type>
    <class> 'IN' for Internet.</class>
    <exchange> A string value that contains the name of the mail exchanger.</exchange>
    <line> An integer value that contains the line number of the zone file.</line>
    <minimum> An integer value that contains the zone file's minimum time to live in seconds.</minimum>
    <raw> A string value that contains comment text (lines that start with a semicolon).</raw>
    <serial> An integer value that contains the zone file's serial number timestamp.</serial>
    <mname> A string value that contains the start of authority server's name.</mname>
    <retry> An integer value that contains the zone file's retry time in seconds.</retry>
    <refresh> An integer value that contains the zone file's refresh time in seconds.</refresh>
    <rname> A string value that contains the email address of the zone file's registrant. This value does not contain an 'at' sign (@). (e.g. user.example.com)</rname>
    <expire> An integer value that contains the zone file's time to expire in seconds.</expire>
    <nsdname> A string value that contains the name of the authoritative nameserver.</nsdname>
  </record>
  <status> A boolean value indicating success or failure. '1' if successful.</status>
  <serialnum> An integer value that contains the zone file's serial number.</serialnum>
</data>

ZoneEdit::edit_zone_record

API Version: 2 - Click here for documentation
Description: Edit an A, CNAME, or TXT record in a zone file, specified by line number. You must have access to both 'zoneedit' and 'simplezoneedit' features. This function does not work in DEMO mode. This function works nicely with ZoneEdit::fetchzone to easily fetch line number and record information, first.
Parameters:  
  domain (string)
  The domain corresponding to the zone you wish to edit.
  Line (integer)
  The line number of the zone file you wish to edit.
  type (string)
  The type of record you wish to add to the zone file. Acceptable values include 'A', 'CNAME', or 'TXT'. Each type of record requires a specific parameter.
  txtdata (string (optional))
  The text you wish to contain in your TXT record. This parameter is required when 'TXT' is specified in the 'type' parameter.
  cname (string (optional))
  The domain to which you wish to alias. This parameter is required when 'CNAME' is specified in the 'type' parameter.
  address (string (optional))
  The IP address to map to the subdomain. This parameter is required when 'A' is specified in the 'type' parameter.
  ttl (int (optional))
  The new record's time to live in seconds.
  class (string (optional))
  The class to be used for the record. Ordinarily, this parameter is not required.
Returns:  
 
<data>
  <newserial> An integer value that contains the new serial number for the zone.</newserial>
  <statusmsg> A string value that contains a message of success or a relevant error message. (e.g. 'Bind reloading on bilbo using rndc zone: [example.com]' if successful)</statusmsg>
  <status> A boolean value that indicates whether or not the function completed successfully. '1' if successful, '0' if failed.</status>
  <name> A string value that contains the string 'result'.</name>
</data>

ZoneEdit::fetchzones

API Version: 2 - Click here for documentation
Description: Retrieve a list of your account's zones and zone file contents.
Returns:  
 
<data>
  <statusmsg> A string value that contains a message of success (e.g. 'Zones fetched') or a relevant error message.</statusmsg>
  <status> A boolean value that indicates success or failure. '1' if successful.</status>
  <zones> A hashref that contains each domain as a key:
    <example.com> A string value that contains the contents of the domain's zone file.</example.com>
  </zones>

</data>

ZoneEdit::fetch_cpanel_generated_domains

API Version: 2 - Click here for documentation
Description: Retrieve a list of domains, created within cPanel, associated with your cPanel account.
Parameters:  
  domain (string (optional))
  This input parameter allows you to append one domain name to the end of the resulting output.
Returns:  
 
<data>
  <domain> A string value that contains the domain associated with the cPanel account.</domain>
</data>

ZoneEdit::remove_zone_record

API Version: 2 - Click here for documentation
Description: Remove lines from a DNS zone file. You may only remove A, TXT, and CNAME records with this function. You must have access to either 'zoneedit' or 'simplezoneedit' to use this function. You cannot use this function in DEMO mode.
Parameters:  
  domain (string)
  The domain corresponding to the zone file from which you wish to remove a line.
  line (integer)
  The line number you wish to remove. Use the ZoneEdit::fetchzone function to obtain the line number of a particular record.
Returns:  
 
<data>
  <newserial> A string value that contains the new zone file's serial number.</newserial>
  <statusmsg> A string value that contains a message of success or a relevant error message. (e.g. 'Bind reloading on bilbo using rndc zone: [example.com]')</statusmsg>
  <status> A boolean value that indicates success or failure. '1' if successful, '0' if the function fails.</status>
  <needsfeature> A string value that returns the feature you need in order to use this function. (e.g. 'zoneedit' or 'simplezoneedit')</needsfeature>
  <name> A string value that always returns 'result'.</name>
</data>

ZoneEdit::fetchzone_records

API Version: 2 - Click here for documentation
Description: Retrieve a list of zone modifications for a specific domain.
Parameters:  
  domain (string)
  The domain whose zone modifications you wish to view.
Returns:  
 
<data>
  <Line> A string value that contains the line number that was modified.</Line>
  <line> A string value that contains the line number that was modified.</line>
  <record> A string value that contains the IP address of the zone entry.</record>
  <ttl> A string value that contains the records numerical time to live in seconds. (e.g. 14400)</ttl>
  <address> A string value that contains the target IP address.</address>
  <class> A string value that contains the class of the record. (e.g. IN)</class>
  <type> A string value that contains the type of record. (e.g. 'A', 'MX', or 'CNAME')</type>
  <name> A string value that contains the name of the entry in zone format. (e.g. example.tld)</name>
</data>

Topic revision: r2 - 19 Mar 2012 - 21:09:17 - Main.JenniferDoubrava