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

 

Description

This function returns DNS zone information about a domain.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Examples


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$lookup_dnszone = $cpanel->api1('Net','dnszone', array('example.com') ); // Call the function.

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $lookup_dnszone = $cpliveapi->api1('Net','dnszone', ['example.com'] ); # Call the function.

Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Tag System (deprecated)

Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. This example is present in order to help developers move from the old cPanel tag system to our LiveAPI.

We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Net::dnszone( $FORM('example.com'))">
 Command Line
cpapi1 --user=username Net dnszone

Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (plaintext)
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> example.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57253
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. 172312 IN A 192.0.32.10
;; AUTHORITY SECTION:
example.com. 172312 IN NS b.iana-servers.net.
example.com. 172312 IN NS a.iana-servers.net.
;; ADDITIONAL SECTION:
a.iana-servers.net. 3496 IN A 192.0.34.43
b.iana-servers.net. 21112 IN A 193.0.0.236
b.iana-servers.net. 21112 IN AAAA 2001:610:240:2::c100:ec
;; Query time: 2 msec
;; SERVER: 208.74.121.103#53(208.74.121.103)
;; WHEN: Sat Mar 20 20:34:55 2010
;; MSG SIZE rcvd: 153

Parameters

ParameterTypeDescriptionPossible valuesExample
dnszonestring

Required

 The domain name.

A valid domain name on the cPanel account.

example.com

Returns

This function returns the results of the domain query.