Child pages
  • UAPI Functions - DNS::has_local_authority

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt
This function checks whether the local server is authoritative for the domain's DNS records.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledSendMailRoleNonVersion
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


Code Block
languagetext
https://hostname.example.com:2083/cpsess##########/execute/DNS/has_local_authority?domain=example.com

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check if the local server is authoritative for the domain's DNS records.
$poll = $cpanel->uapi(
    'DNS', 'has_local_authority',
    array(
        'domain' => 'example.com'
  )
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Check if the local server is authoritative for the domain's DNS records.
my $poll = $cpliveapi->uapi(
    'DNS', 'has_local_authority',
    {
        'domain' => 'example.com'
  }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Template Toolkit


Code Block
languagexml
linenumberstrue
<!-- Check if the local server is authoritative for the domain's DNS records. -->
[% execute('DNS', 'has_local_authority', { 'domain' => 'example.com' } ) %]

Include Page
LIB:_TTLink
LIB:_TTLink


Expand
titleCommand Line


Code Block
languagebash
uapi --user=username DNS has_local_authority domain=example.com domain=anotherexample.com

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagebash
linenumberstrue
{
   "apiversion": 3,
   "module": "DNS",
   "func": "has_local_authority",
   "result": {
      "data": [
        {
          "domain": "example.com",
		  "zone": "example.com",
		  "nameservers": [
				"ns1.example.com",
				"ns2.example.com"
			],
		  "local_authority": 1
		},
		{
		  "domain": "anotherexample.com",
		  "nameservers": [
				],
		  "local_authority": 0 
        }
	 ]
  },
    "errors": null,
    "messages": null,
    "metadata": {
        "transformed": 1
            },
    "status": 1,
    "warnings": null
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain to check whether the local server is authoritative for the domain's DNS records.

Note
titleNote:

To check multiple domains, duplicate the parameter name. For example, use the domain=example.com, domain=example2.com, and domain=example3.com parameters.


A valid domain.example.com

Returns

ReturnTypeDescriptionPossible valuesExample
dataarray of hashesAn array that contains information about the authoritative status of a domain's local DNS zone files.Each hash contains the domain, zone, nameservers, and local_authority returns.

domain

string

The queried domain.

This function returns this value in the data array.

A valid domain.example.com

zone

string

The domain's DNS zone.

This function returns this value in the data array.

A valid DNS zone.


example.com

nameservers

array of strings

The domain's nameservers.

This function returns this value in the data array.

A list of valid nameservers.ns1.example.com

local_authority

Boolean

Whether the local server is authoritative for the domain's DNS records.

This function returns this value in the data array.

  • 1 — The local server is authoritative for the domain's DNS records.
  • 0 — The local server is not authoritative for the domain's DNS records.
1