latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

DNS
DNS Zones

Return specific line from domain's DNS configuration

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

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.

get/getzonerecord

Query parameters

domainstring required
Example:example.com

The zone record's domain.

lineinteger required
Example:2

The zone record's line number.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "record": [
      {
        "Line": 24,
        "name": "hostname.example.com.",
        "ttl": 86400,
        "type": "A"
      }
    ]
  },
  "metadata": {
    "command": "getzonerecord",
    "reason": "Record obtained.",
    "result": 1,
    "version": 1
  }
}