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

 

Description

This function lists the server's DNS zones.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/listzones
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/listzones
 Command Line
whmapi0 listzones

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)
{
   "zone":[
      {
         "zonefile":"example.com.db",
         "domain":"example.com"
      },
      {
         "zonefile":"example.net.db",
         "domain":"example.net"
      }
   ]
}
 Output (XML)
<listzones>
   <zone>
       <domain>example.com</domain>
       <zonefile>example.com.db</zonefile>
   </zone>
   <zone>
       <domain>example.net</domain>
       <zonefile>example.net.db</zonefile>
   </zone>
</listzones>

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
zonearray of hashesAn array of hashes of zone information.Each hash contains the zonefile and domain returns. 

zonefile

string

The zone file's name.

The function returns this value in the zone hash.

A valid zone file name.

example.net.db

domain

string

The domain name.

The function returns this value in the zone hash.

A valid domain on the server.

example.com