Child pages
  • WHM API 1 Functions - addzonerecord

Versions Compared

Key

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

Description

Excerpt

This function adds a DNS zone record.


Warning
titleImportant:
  • To add a reverse DNS zone record, read our addzonerecord (Reverse DNS) documentation.
  • When you call this function, you must include the additional parameters for the selected zone record type. 

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/addzonerecord?api.version=1&domain=example.com&name=hostname.example.com&class=IN&ttl=86400&type=A&address=192.168.0.20



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/addzonerecord?api.version=1&domain=example.com&name=hostname.example.com&class=IN&ttl=86400&type=A&address=192.168.0.20



Expand
titleCommand Line


Code Block
languagebash
whmapi1 addzonerecord domain=example.com name=hostname.example.com class=IN ttl=86400 type=A address=192.168.0.20

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
  "metadata": {
    "version": 1,
    "reason": "Bind reloading on username using rndc zone: [example.com]\n",
    "result": 1,
    "command": "addzonerecord"
  }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    <metadata>
        <version>1</version>
        <reason>
            Bind reloading on username using rndc zone: [example.com]
        </reason>
        <result>1</result>
        <command>addzonerecord</command>
    </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample

domain

string

Required

The new zone record's domain.

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

Required

The record's name.

A valid domain name or hostname.

Note
titleNote:

Do not omit any necessary trailing periods.


hostname.example.com
classstring

Required

The record's class.

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

IN
ttlinteger

The record's Time To Live (TTL).

This parameter's value defaults to 86400.

A positive integer that represents the TTL, in seconds.

86400
typestring

Required

The DNS record type.


Warning
titleWarning:

The DNS record type determines the additional DNS zone record parameters that you must include.

  • AA records store IPv4 addresses.
  • A6A6 records store IPv6 addresses.

    Note
    titleNote:

    A6 records are deprecated . We strongly recommend that you use AAAA records to 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:_DNSZoneRecordParameterInclude
LIB:_DNSZoneRecordParameterInclude

Returns

This function only returns metadata.