Description

This function returns a domain's DNS zone configuration.

Examples 




https://hostname.example.com:2087/cpsess##########/json-api/dumpzone?domain=example.com




https://hostname.example.com:2087/cpsess##########/xml-api/dumpzone?domain=example.com




whmapi0 dumpzone domain=example.com



{
   "result":[
      {
         "status":1,
         "record":[
            {
               "Line":1,
               "raw":"; cPanel first:11.24.7-EDGE_34021 latest:11.24.7-BETA_34513
Cpanel::ZoneFile::VERSION:1.3 mtime:1239822374 hostname:server.example.com",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":2,
               "raw":"; Zone file for example.com",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":3,
               "ttl":"14400",
               "type":"$TTL",
               "name":""
            },
            {
               "serial":"2009041504",
               "minimum":"86400",
               "rname":"admin.example.net",
               "refresh":"86400",
               "Lines":7,
               "name":"example.com.",
               "Line":4,
               "retry":"7200",
               "ttl":"86400",
               "class":"IN",
               "mname":"ns1.example.com",
               "type":"SOA",
               "expire":"3600000"
            },
            {
               "Line":11,
               "raw":"",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":12,
               "nsdname":"ns1.example.com",
               "ttl":"86400",
               "class":"IN",
               "type":"NS",
               "name":"example.com."
            },
            {
               "Line":13,
               "nsdname":"ns2.example.com",
               "ttl":"86400",
               "class":"IN",
               "type":"NS",
               "name":"example.com."
            },
            {
               "Line":14,
               "nsdname":"ns1.example.com",
               "ttl":"86400",
               "class":"IN",
               "type":"NS",
               "name":"example.com."
            },
            {
               "Line":15,
               "raw":"",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":16,
               "raw":"",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":17,
               "ttl":"14400",
               "address":"127.0.0.1",
               "class":"IN",
               "type":"A",
               "name":"example.com."
            },
            {
               "Line":18,
               "raw":"",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":19,
               "ttl":"14400",
               "address":"127.0.0.1",
               "class":"IN",
               "type":"A",
               "name":"localhost.example.com."
            },
            {
               "Line":20,
               "raw":"",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":21,
               "ttl":"14400",
               "class":"IN",
               "preference":"0",
               "exchange":"example.com",
               "type":"MX",
               "name":"example.com."
            },
            {
               "Line":22,
               "raw":"",
               "ttl":"86400",
               "type":":RAW",
               "name":""
            },
            {
               "Line":23,
               "cname":"example.com",
               "ttl":"14400",
               "class":"IN",
               "type":"CNAME",
               "name":"mail.example.com."
            },
            {
               "Line":24,
               "cname":"example.com",
               "ttl":"14400",
               "class":"IN",
               "type":"CNAME",
               "name":"www.example.com."
            },
            {
               "Line":25,
               "cname":"example.com",
               "ttl":"14400",
               "class":"IN",
               "type":"CNAME",
               "name":"ftp.example.com."
            },
            {
               "Line":26,
               "ttl":"14400",
               "address":"127.0.0.1",
               "class":"IN",
               "type":"A",
               "name":"server1.example.com."
            },
            {
               "Line":27,
               "ttl":"14400",
               "address":"127.0.0.1",
               "class":"IN",
               "type":"A",
               "name":"ns2.example.com."
            },
            {
               "Line":28,
               "ttl":"14400",
               "address":"127.0.0.1",
               "class":"IN",
               "type":"A",
               "name":"ns1.example.com."
            },
		  	{
			"Line" : 29,
			"ttl": "14400",
			"name": "www.example.com"
			"flag": "1"
			"tag": "issue"
			"value": "totallyrealca.tld"
			"type": "CAA"
			"Class": "IN"
		 	}
         ],
         "statusmsg":"Zone Serialized"
      }
   ]
}




<dumpzone>
     <result>
          <status>1</status>
          <statusmsg>Zone Serialized</statusmsg>
          <record>
                <name/>
                 <Line>1</Line>
                 <raw>; cPanel first:11.17.0-BETA_19364 latest:11.23.1-UNKNOWN_24255
                 Cpanel::ZoneFile::VERSION:1.2 mtime:1212701156</raw>
                 <ttl>86400</ttl>
                 <type>:RAW</type>
           </record>
           <record>
                 <name/>
                 <Line>2</Line>
                 <raw>; Zone file for example.com</raw>
                 <ttl>86400</ttl>
                 <type>:RAW</type>
           </record>
           <record>
                 <name/>
                 <Line>3</Line>
                 <ttl>14400</ttl>
                 <type>$TTL</type>
           </record>
           <record>
                 <name>example.com.</name>
                 <Line>4</Line>
                 <Lines>7</Lines>
                 <class>IN</class>
                 <expire>3600000</expire>
                 <minimum>86400</minimum>
                 <mname>ns1.build.cpanel.net</mname>
                 <refresh>86400</refresh>
                 <retry>7200</retry>
                 <rname>webmaster.example.com</rname>
                 <serial>2008060510</serial>
                 <ttl>86400</ttl>
                 <type>SOA</type>
           </record>
           <record>
                 <name>example.com.</name>
                 <Line>11</Line>
                 <class>IN</class>
                 <nsdname>ns1.example.com</nsdname>
                 <ttl>86400</ttl>
                 <type>NS</type>
           </record>
           <record>
                 <name>domain.com.</name>
                 <Line>12</Line>
                 <class>IN</class>
                 <nsdname>ns2.domain.com</nsdname>
                 <ttl>86400</ttl>
                 <type>NS</type>
           </record>
           <record>
                 <name>example.com.</name>
                 <Line>13</Line>
                 <address>10.215.215.13</address>
                 <class>IN</class>
                 <ttl>14400</ttl>
                 <type>A</type>
           </record>
           <record>
                 <name>localhost.example.com.</name>
                 <Line>14</Line>
                 <address>127.0.0.1</address>
                 <class>IN</class>
                 <ttl>14400</ttl>
                 <type>A</type>
           </record>
           <record>
                 <name>example.com.</name>
                 <Line>15</Line>
                 <class>IN</class>
                 <exchange>domain.com</exchange>
                 <preference>0</preference>
                 <ttl>14400</ttl>
                 <type>MX</type>
           </record>
           <record>
                 <name>mail.example.com.</name>
                 <Line>16</Line>
                 <class>IN</class>
                 <cname>domain.com</cname>
                 <ttl>14400</ttl>
                 <type>CNAME</type>
           </record>
           <record>
                 <name>www.example.com.</name>
                 <Line>17</Line>
                 <class>IN</class>
                 <cname>example.com</cname>
                 <ttl>14400</ttl>
                 <type>CNAME</type>
           </record>
           <record>
                 <name>ftp.example.com.</name>
                 <Line>18</Line>
                 <class>IN</class>
                 <cname>example.com</cname>
                 <ttl>14400</ttl>
                 <type>CNAME</type>
          </record>
          <record>
                <Line>19</Line>
                <ttl>14400</ttl>
                <name>www.example.com.</name>
                <flag>0</flag>
				<tag>issue</tag>
				<value>totallyrealca.tld</value>
                <type>CAA</type>
                <class>IN</class>
          </record>
     </result>
</dumpzone>




   

Parameters

ParameterTypeDescriptionPossible valuesExample

domain

string

Required

The zone record's domain.

A valid domain name on the server.example.com

 

Returns

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

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

record

array of hashes

An array of hashes of zone record data.

The function returns this value in the result hash.

Each hash contains the name, Line, class, ttl, and type returns, with additional returns that the DNS zone's type determines.

 

name

string

The record name.

The function returns this value in a record hash.

A valid domain name or hostname.

hostname.example.com

Line

integer

The zone record's line number.

The function returns this value in a record hash.

A positive integer.1

class

string

The record's class.

The function returns this value in a record hash.

  • IN
  • Very rarely, another valid DNS record class.

IN

ttl

integer

The record's Time To Live (TTL).

The function returns this value in a record hash.

A positive integer that represents the TTL, in seconds.

86400

type

string

The DNS record type.

The function returns this value in a record hash.

  • AA records store IPv4 addresses. Use them to map a hostname to an IPv4 address.
  • A6A6 records store IPv6 addresses.

  • AAAAAAAA records store IPv6 addresses.
  • ASFDBASFDB records store the location of an AFS cell's database servers.
  • CAACAA records control which certificate authorities can issue SSL certificates for a domain.

    We added this DNS record type in cPanel & WHM version 66.


  • CNAMECNAME records create an alias to another hostname.
  • DNAMEDNAME records create an alias for a hostname and its subnames.
  • DSDS records specify a record's delegation signer.
  • HINFOHINFO records specify a host's CPU and OS types.
  • LOCLOC records store a hostname's geographical location.
  • MXMX records point a domain name to its MTAs.
  • NSNS records store a domain's authoritative nameservers.
  • PTRPTR records point to a CNAME.
  • RPRP records store a domain's Responsible Person's information.
  • SOASOA records designate the beginning of a zone of authority.
  • SRVSRV records store the service location records for newer protocols (for example, Autodiscover).
  • SSHFPSSHFP records store a domain's SSH public host key's fingerprint.

    We do not currently support this DNS record type. 


  • TXTTXT records store descriptive text or useful records (for example, SPF or DKIM records).
A

statusmsg

string

A message of success or a reason for failure.

The function returns this value in the result hash.

  • A message of success.
  • An error message.
                Zone Serialized