Child pages
  • WHM API 1 Functions - getzonerecord

Versions Compared

Key

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

Description

Excerpt

This function returns a line from a domain's DNS zone configuration.

Include Page
LIB:_SPFC7Note
LIB:_SPFC7Note

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

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/getzonerecord?api.version=1&domain=example.com&line=2



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/getzonerecord?api.version=1&domain=example.com&line=2



Expand
titleCommand Line


Code Block
languagebash
whmapi1 getzonerecord domain=example.com line=2

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
  "data": {
    "record": [
      {
        "ttl": "14400",
        "Line": 27,
        "name": "webdisk.test.example.com.",
        "address": "192.168.0.20",
        "class": "IN",
        "type": "A"
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "Record obtained.",
    "result": 1,
    "command": "getzonerecord"
  }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    <data>
        <record>
            <ttl>14400</ttl>
            <Line>27</Line>
            <name>webdisk.test.example.com.</name>
            <address>192.168.0.20</address>
            <class>IN</class>
            <type>A</type>
        </record>
    </data>
    <metadata>
        <version>1</version>
        <reason>Record obtained.</reason>
        <result>1</result>
        <command>getzonerecord</command>
    </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample

domain

string

Required

The zone record's domain.

A valid domain name on the server.example.com
lineinteger

Required

The zone record's line number.

A positive integer that represents a line in the zone record file.2

Returns

ReturnTypeDescriptionPossible valuesExample

record

array of hashesAn array of hashes of zone record data.

This array of hashes includes the name, Line, class, ttl, and type returns, with additional returns that the DNS zone's type determines.

 

name

string

The record's name.

The function returns this value in the record array.

A valid domain name or hostname.

hostname.example.com

Line

integer

The zone record's line number.

The function returns this value in the record array.

A positive integer.1

class

string

The record's class.

The function returns this value in the record array.

  • IN
  • Very rarely, another valid DNS record class.

IN

ttl

integer

The record's Time To Live (TTL).

The function returns this value in the record array.

A positive integer that represents the TTL, in seconds.

86400

type

string

The DNS record type.

The function returns this value in the record array.

  • 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.
  • CAA — CAA records control which certificate authorities can issue SSL certificates for a domain.

    Note
    titleNote:

    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
    titleWarning:

    We do not currently support this DNS record type. 


  • TXTTXT records store descriptive text or useful records (for example, SPF or DKIM records).
A

Include Page
LIB:_DNSZoneRecordReturnInclude
LIB:_DNSZoneRecordReturnInclude