Child pages
  • WHM API 1 Functions - editzonerecord

Versions Compared

Key

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

Description

Excerpt

This function edits a DNS zone record.

 To effectively use this function, use the following workflow:

  1. Run the dumpzone function on the DNS zone record to edit.
  2. Locate the Line value that corresponds to the data to edit.
  3. Use the values from that zone record to formulate the appropriate editzonerecord parameters.
Warning
titleImportant:
  • When you call this function, you must include the additional parameters for the selected zone record type. 
  • To change the zone record's IP address, we recommend that you use the swapip utility or the setsiteip function instead.
  • You cannot edit other DNS zones that reside on Write-only servers in a DNS cluster.

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



Expand
titleCommand Line


Code Block
languagebash
whmapi1 editzonerecord domain=example.com line=24 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 hostname using rndc zone: [example.com]\n",
    "result": 1,
    "command": "editzonerecord"
  }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    <metadata>
        <version>1</version>
        <reason>
            Bind reloading on hostname using rndc zone: [example.com]
        </reason>
        <result>1</result>
        <command>editzonerecord</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 file line number.

A positive integer that represents a line number in the domain's DNS zone file.24
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

Required

The record's Time To Live (TTL).

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. Use them to map a hostname to an IPv4 address.
  • 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.