Child pages
  • WHM API 1 Functions - has_local_authority
Skip to end of metadata
Go to start of metadata

Description

This function checks whether the local server has the authority to publish changes for the domain's DNS records.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/has_local_authority?api.version=1&domain=example.com


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 Command Line
whmapi1 has_local_authority domain=example.com domain=anotherexample.com


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "data": {
      "records": [
        {
          "domain": "example.com",
		  "zone": "example.com",
		  "nameservers": [
				"ns1.example.com",
				"ns2.example.com"
			],
		  "local_authority": 1
		},
		{
		  "domain": "anotherexample.com",
		  "nameservers": [
			],
		  "local_authority": 0 
        }
    ],
    "metadata": {
       "result": 1,
	   "command": "has_local_authority",
	   "reason": "OK",
	   "version": 1
    }
  }
}


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

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

Note:

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
recordsarray of hashesAn array that contains information about 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 records array.

A valid domain.example.com

zone

string

The DNS zone that contains the domain's DNS records.

This function returns this value in the records array.

A valid DNS zone.example.com

nameservers

array of strings

The domain's authoritative nameservers.

This function returns this value in the records array.

A list of valid authoritative nameservers.

"ns1.example.com",

"ns2.example.com"


local_authority

Boolean

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

This function returns this value in the records 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