Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function returns a domain's DNS zone configuration.

Note:

On servers that run CentOS 7, you may see a named warning about the absence of SPF resource records on DNS.

  • This warning is not relevant on CentOS 7 servers, because RFC 7208 deprecated SPF records. CentOS 7 servers use TXT records instead of SPF records.
  • Red Hat 7.1 and CentOS 7.1 both contain bind-9.9.4-23.el7, which is an updated version of BIND that complies with RFC 7208. To resolve this issue, update your operating system to a version that contains the updated version of BIND. For more information, read the the Red Hat Bugzilla case about SPF record errors.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/dumpzone?domain=example.com
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/dumpzone?domain=example.com
 Command Line
whmapi0 dumpzone 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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "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"
      }
   ]
}
 Output (XML)
<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.

    Note:

    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.

    Warning:

    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
              

A Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
addressstringThe zone record's IPv4 address.A valid IPv4 address.192.168.0.20

Note:

For more information about A records, read RFC 1035 at IANA.

 A6 Record Returns

 Click to view...

Important:

A6 records are deprecated. We strongly recommend that you use AAAA records to store IPv6 addresses. 

ReturnTypeDescriptionPossible valuesExample
prefixstringThe record's prefix length.A positive integer.48
referstringThe record's address suffix.

A valid IPv6 address suffix.

0::0

 AAAA Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
addressstringThe zone record's IPv6 address.

A valid IPv6 address.

2001:1:42:1::2a

Note:

For more information about AAAA records, read RFC 3596 at IANA .

 AFSDB Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
subtypeintegerThe AFS cell type.

A 16-bit integer that represents the type of AFS cell.

For example, a value of 1 indicates an AFS version 3.0 Volume Location Server.

1
hostnamestringThe database servers' hostname.A valid hostname.afs.example.com

Note:

For more information about ASFDB records, read RFC 1183 at IANA.

CAA Record Returns

 Click to view...

Note:

We added these returns in cPanel & WHM version 66.

ParameterTypeDescriptionPossible valuesExample
flaginteger

Whether the CA will issue an SSL certificate if the CAA resource record contains unknown property tags.

For more information about CAA record flags and property tags, read the RFC 6844 documentation.

  • 0 — Non-critical. The CAA Resource Record contains unknown property tags, and the CA issued an SSL certificate.
  • 1 — Critical. The CAA Resource Record contains unknown property tags, and the CA did not issue an SSL certificate.
0
tagstring

The CAA record's property type.

  • issue — A CA issued a certificate for the domain.
  • issuewild — A CA issued a wildcard certificate for the domain.
  • iodef — The user specified a URL to which a CA may report policy violations.

issue
valuestring

The CA's domain or URL.

totallyrealca.tld

 CNAME Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
cnamestringThe canonical name (CNAME) alias.A valid alias.sydneybristow.example.com
flattenBoolean

Whether the specified CNAME value resolves with the record's IP address.

  • 1 — Resolves.
  • 0 — Does not resolve.
1
flatten_tostring

The IP address to which the specified CNAME resolves.

A valid IPv4 or IPv6 address.192.168.0.20

Note:

For more information about CNAME records, read RFC 1035 at IANA .

 DNAME Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
dnamestringThe delegation name (DNAME) alias.A valid alias.hostname.dev.example.com

Note:

For more information about DNAME records, read RFC 2672 at IANA.

 DS Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
keynameintegerThe record's KeyTag value.

An unsigned decimal integer.

2642
algorithmintegerThe record's algorithm number.
  • 1 — RSAMD5
  • 2 — Diffie-Hellman
  • 3 — DSA/SHA-1
  • 4 — Elliptic Curve
  • 5 — RSA/SHA-1
  • 252 — Indirect
  • 253 — Private DNS
  • 254 — Private OID
5
digitypeintegerThe record's digest type.
  • 1 — SHA-1
1

Note:

For more information about DS records, read RFC 4034 at IANA.

 HINFO Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
cpustringThe host's CPU type.

A valid CPU type.

INTEL-386
osstringThe host's operating system.

A valid operating system.

UNIX

Note:

For more information about HINFO records, read RFC 1700 at IANA.

 LOC Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
versionintegerThe record's version number.

You must set this value to 0.

0
sizeintegerThe diameter of a sphere that encloses the entire location.

A positive integer that represents a diameter, in meters.

10
horiz_preintegerThe location's horizontal precision.A positive integer that represents a distance, in meters.10
vert_preintegerThe location's vertical precision.A positive integer that represents a distance, in meters.10
latitudestringThe location's latitude.A valid latitude.41 51 54.305 N
longitudestringThe location's longitude.A valid longitude.87 36 47.95 W
altitudestringThe location's altitude.

The location's altitude above sea level, in meters, and the m character.

178m

Note:

For more information about LOC records, read RFC 1876 at IANA .

 MX Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
preferenceintegerThe record's preference.

An integer that represents the record's priority order.

Note:

Lower values have a higher priority order. 

10
exchangestringThe server's location's canonical name (CNAME).

A valid CNAME.

mail.example.com

Note:

For more information about MX records, read RFC 1035 at IANA.

 NS Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
nsdnamestringThe domain's authoritative nameserver.

A valid nameserver.

ns1.example.com

Note:

For more information about NS records, read RFC 1035 at IANA.

 PTR Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
ptrdnamestringA pointer to a canonical name (CNAME).

A valid hostname.

hostname.example.com.

Note:

For more information about PTR records, read RFC 1035 at IANA.

 RP Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
mboxstringThe Responsible Person's (RP's) email address.

A valid email address.

user.example.com.
txtdnamestringThe RP's domain name.

A valid hostname.

mx1.host.example.com.

Note:

For more information about RP records, read RFC 1183 at IANA.

 SOA Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
serialintegerThe zone file's revision number.

A valid revision number.

2013122501
mnamestringThe domain's authoritative nameserver.

A valid nameserver.

ns1.example.com
retryintegerThe amount of time to wait before the secondary server retries a failed zone transfer.A positive integer that represents an amount of time, in seconds.1440
refreshstringThe amount of time to wait before the secondary DNS server queries the primary DNS server's SOA records for changes.A positive integer that represents an amount of time, in seconds.1440
LinesstringThe number of lines in the SOA section.A positive integer that represents a number of lines.4
expirestringThe amount of time to wait before the secondary server attempts to complete a zone transfer.A positive integer that represents an amount of time, in seconds.3600000
rnamestringThe Responsible Person's (RP's) email address.

A valid email address.

user.example.com.

Note:

For more information about SOA records, read RFC 1035 at IANA.

 SRV Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
priorityintegerThe target host's preference.

An integer that represents the target host's priority order.

Note:

Lower numbers have a higher priority order. 

0
weightintegerA relative weight. The system uses this value to rank entries with the same priority value.

An integer that represents the target host's weight against other hosts with the same priority value.

2
portintegerThe target host's port.A valid port number.389
targetstringThe service's target host.A valid hostname.service.example.com

Note:

For more information about SRV records, read RFC 2782 at IANA.

 SSHFP Record Returns

 Click to view...

Warning:

We do not currently support this DNS record type. 

ReturnTypeDescriptionPossible valuesExample
algorithmstringThe public key's algorithm number.
  • 1 — RSA
  • 2 — DSS
1
fptypestringThe public key's fingerprint type.
  • 1 — SHA-1
1

Note:

For more information about SSHFP records, read RFC 4255 at IANA.

 TXT Record Returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
txtdatastringThe TXT record's data.

A valid TXT record.

"v=spf1 a -all"
unencodedBooleanWhether the TXT record's data is encoded.
  • 1 — Encoded.
  • 0Not encoded.
1

Note:

For more information about TXT records, read RFC 1464 at IANA.