Update DNS zone record

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.

Important:

  • 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 script or the setsiteip function instead.
  • You cannot edit other DNS zones that reside on Write-only servers in a DNS cluster.

Note:

On servers that run CentOS 7, you may see a named warning about the absence of SPF resource records on DNS.

  • This warning is not relevant on CentOS 7 servers, because RFC 7208 deprecated SPF records. CentOS 7 servers use TXT records instead of SPF records.
  • Red Hat 7.1 and CentOS 7.1 both contain bind-9.9.4-23.el7, which is an updated version of BIND that complies with RFC 7208. To resolve this issue, update your operating system to a version that contains the updated version of BIND. For more information, read the Red Hat Bugzilla case about SPF record errors.

Important:

When you disable the DNS role, the system disables this function.

SecurityBasicAuth
Request
Request Body schema: application/x-www-form-urlencoded
required

The updated DNS Zone Record.

string or string

The record's class.

If you do not use this parameter, the system retains the current setting.

domain
required
string <domain>

The zone record's domain.

line
required
integer >= 1

The zone record's file line number.

name
string <domain>

The record's name.

If you do not use this parameter, the system retains the current setting.

Note:

Do not omit any necessary trailing periods.

ttl
required
integer >= 1

The record's Time To Live (TTL), in seconds.

type
string

The DNS record type:

  • A - A records store IPv4 addresses. Use them to map a hostname to an IPv4 address.
  • A6 - A6 records store IPv6 addresses.
  • AAAA - AAAA records store IPv6 addresses.
  • AFSDB - AFSDB 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.
  • CNAME - CNAME records create an alias to another hostname.
  • DNAME - DNAME records create an alias for a hostname and its subnames.
  • DS - DS records specify a record's delegation signer.
  • HINFO - HINFO records specify a host's CPU and OS types.
  • LOC - LOC records store a hostname's geographical location.
  • MX - MX records point a domain name to its MTAs.
  • NS - NS records store a domain's authoritative nameservers.
  • PTR - PTR records point to a CNAME.
  • RP - RP records store a domain's Responsible Person's information.
  • SOA - SOA records designate the beginning of a zone of authority.
  • SRV - SRV records store the service location records for newer protocols (for example, Autodiscover).
  • TXT - TXT records store descriptive text or useful records (for example, SPF or DKIM records).

If you do not use this parameter, the system retains the current setting.

Warning:

Additional properties may be required based on the type.

When you call this function, you must include the additional parameters for the desired zone record type if you use this parameter. Select a zone record from the menu to view the required additional parameters:

address
required
string <ipv4>

The zone record's IPv4 address.

Note:

For more information about A records, read RFC 1035 at IANA.

Responses
200

HTTP Request was successful.

Response Schema: application/json
object
post/editzonerecord
Request samples
application/x-www-form-urlencoded
class=IN&domain=example.com&line=24&name=hostname.example.com.&ttl=86400&type=A&address=192.168.0.20
Response samples
application/json
{
  • "metadata": {
    • "command": "editzonerecord",
    • "reason": "Bind reloading on hostname using rndc zone: [example.com]\n",
    • "result": 1,
    • "version": 1
    }
}