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.
  • 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.


whmapi1 editzonerecord line=24 class=IN ttl=86400 type=A address= txtdata="v%3Dspf1%20ip4%3A208.74.121.106%20%2Ba%20%2Bmx%20%2Bip4%3A10.1.198.15%20~all"

  "metadata": {
    "version": 1,
    "reason": "Bind reloading on hostname using rndc zone: []\n",
    "result": 1,
    "command": "editzonerecord"

            Bind reloading on hostname using rndc zone: []



ParameterTypeDescriptionPossible valuesExample




The zone record's domain.

A valid domain name on the


The zone record's file line number.

A positive integer that represents a line number in the domain's DNS zone file.24


The record's name.

A valid domain name or hostname.

Do not omit any necessary trailing periods.


The record's class.

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



The record's Time To Live (TTL).

A positive integer that represents the TTL, in seconds.



The DNS record type.

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.

    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.

    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.

    We do not currently support this DNS record type. 

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


This function only returns metadata.