- Created by Documentation, last modified on Oct 05, 2018
disable_authentication_provider
disable_failing_authentication_providers
enable_authentication_provider
get_available_authentication_providers
get_provider_client_configurations
get_provider_configuration_fields
get_provider_display_configurations
get_users_authn_linked_accounts
set_provider_client_configurations
set_provider_display_configurations
twofactorauth_generate_tfa_config
twofactorauth_get_user_configs
cpgreylist_is_server_netblock_trusted
cpgreylist_list_entries_for_common_mail_provider
cpgreylist_load_common_mail_providers_config
cpgreylist_save_common_mail_providers_config
cpgreylist_trust_entries_for_common_mail_provider
cpgreylist_untrust_entries_for_common_mail_provider
create_cpgreylist_trusted_host
delete_cpgreylist_trusted_host
Description
This function edits a DNS zone record. To effectively use this function, use the following workflow:
- Run the
dumpzone
function on the DNS zone record to edit. - Locate the
Line
value that corresponds to the data to edit. - 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 utility 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:
DNS
role, the system disables this function. For more information, read our How to Use Server Profiles documentation.Examples
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
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
whmapi1 editzonerecord domain=example.com line=24 name=hostname.example.com. class=IN ttl=86400 type=A address=192.168.0.20
Notes:
- You must URI-encode values.
- For more information and additional output options, read our Guide to WHM API 1 documentation or run the
whmapi1 --help
command. If you run CloudLinux™, you must use the full path of the
whmapi1
command:/usr/local/cpanel/bin/whmapi1
{ "metadata": { "version": 1, "reason": "Bind reloading on hostname using rndc zone: [example.com]\n", "result": 1, "command": "editzonerecord" } }
<result> <metadata> <version>1</version> <reason> Bind reloading on hostname using rndc zone: [example.com] </reason> <result>1</result> <command>editzonerecord</command> </metadata> </result>
Note:
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
| string | Required The zone record's domain. | A valid domain name on the server. | example.com |
line | integer | Required The zone record's file line number. | A positive integer that represents a line number in the domain's DNS zone file. | 24 |
name | string | Required The record's name. | A valid domain name or hostname. Note: Do not omit any necessary trailing periods. | hostname.example.com. |
class | string | Required The record's class. |
| IN |
ttl | integer | Required The record's Time To Live (TTL). | A positive integer that represents the TTL, in seconds. | 86400 |
type | string | Required The DNS record type. | Warning: The DNS record type determines the additional DNS zone record parameters that you must include.
| A |
A Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
address | string | The zone record's IPv4 address. | A valid IPv4 address. | 192.168.0.20 |
A6 Record Parameters
Important:
A6 records are deprecated. We strongly recommend that you use AAAA records to store IPv6 addresses.
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
prefix | string | The record's prefix length. | A positive integer. | 48 |
refer | string | The record's address suffix. | A valid IPv6 address suffix. Note You must uuencode the colons ( : ) in IPv6 addresses in your function calls. | 0::0 |
AAAA Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
address | string | The zone record's IPv6 address. | A valid IPv6 address. Note You must uuencode the colons ( : ) in IPv6 addresses in your function calls. | 2001:1:42:1::2a |
AFSDB Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
subtype | integer | The AFS cell type. | A 16-bit integer that represents the type of AFS cell. For example, specify | 1 |
hostname | string | The database servers' hostname. | A valid hostname. | afs.example.com |
CAA Record Parameters
Note:
We added these parameters in cPanel & WHM version 66.
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
flag | integer | Required Whether the Certificate Authority (CA) will issue an SSL certificate if the CAA resource record contains unknown property tags. For more information about CAA record flags and property tags, read the RFC 6844 documentation. |
| 0 |
tag | string | Required The CAA record's property type. |
| issue |
value | string | Required The CA's domain or URL. Note: If you use
|
| totallyrealca.tld |
CNAME Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
cname | string | The canonical name (CNAME) alias. | A valid alias. | sydneybristow.example.com |
flatten | Boolean | Whether to resolve the specified CNAME value with the record's IP address. If you do not also set the Note: Only use this parameter when you alter the zone's |
| 1 |
flatten_to | string | The IP address that the specified CNAME will resolve to. You must use the | A valid IPv4 or IPv6 address. | 192.168.0.20 |
DNAME Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
dname | string | The delegation name (DNAME) alias. | A valid alias. | hostname.dev.example.com |
DS Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
keyname | integer | The record's KeyTag value. | An unsigned decimal integer. | 2642 |
algorithm | integer | The record's algorithm number. |
| 5 |
digitype | integer | The record's digest type. |
| 1 |
HINFO Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
cpu | string | The host's CPU type. | A valid CPU type. | INTEL-386 |
os | string | The host's operating system. | A valid operating system. | UNIX |
LOC Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
version | integer | The record's version number. | You must set this value to | 0 |
size | integer | The diameter of a sphere that encloses the entire location. | A positive integer that represents a diameter, in meters. | 10 |
horiz_pre | integer | The location's horizontal precision. | A positive integer that represents a distance, in meters. | 10 |
vert_pre | integer | The location's vertical precision. | A positive integer that represents a distance, in meters. | 10 |
latitude | string | The location's latitude. | A valid latitude. | 41 51 54.305 N |
longitude | string | The location's longitude. | A valid longitude. | 87 36 47.95 W |
altitude | string | The location's altitude. | The location's altitude above sea level, in meters. Note: Make certain that you append | 178m |
MX Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
preference | integer | The record's preference. | An integer that represents the record's priority order. Note: Lower values have a higher priority order. | 10 |
exchange | string | The server's location's canonical name (CNAME). | A valid CNAME. | mail.example.com |
NS Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
nsdname | string | The domain's authoritative nameserver. | A valid nameserver. | ns1.example.com |
PTR Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
ptrdname | string | A pointer to a canonical name (CNAME). | A valid hostname. Note: Do not omit any necessary trailing periods. | hostname.example.com. |
RP Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
mbox | string | The Responsible Person's (RP's) email address. | A valid email address. Note:
| user.example.com. |
txtdname | string | The RP's domain name. | A valid hostname. Note: Do not omit any necessary trailing periods. | mx1.host.example.com. |
SOA Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
serial | integer | The zone file's revision number. | A valid revision number. | 2013122501 |
mname | string | The domain's authoritative nameserver. | A valid nameserver. | ns1.example.com |
retry | integer | The amount of time to wait before the secondary server retries a failed zone transfer. | A positive integer that represents an amount of time, in seconds. | 1440 |
refresh | string | The amount of time to wait before the secondary DNS server queries the primary DNS server's SOA records for changes. | A positive integer that represents an amount of time, in seconds. | 1440 |
Lines | string | The number of lines in the SOA section. | A positive integer that represents a number of lines. | 4 |
expire | string | The amount of time to wait before the secondary server attempts to complete a zone transfer. | A positive integer that represents an amount of time, in seconds. | 3600000 |
rname | string | The Responsible Person's (RP's) email address. | A valid email address. Note:
| user.example.com. |
SRV Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
priority | integer | The target host's preference. | An integer that represents the target host's priority order. Note: Lower numbers have a higher priority order. | 0 |
weight | integer | A relative weight. The system uses this value to rank entries with the same priority value. | An integer that represents the target host's weight against other hosts with the same | 2 |
port | integer | The target host's port. | A valid port number. | 389 |
target | string | The service's target host. | A valid hostname. | service.example.com |
SSHFP Record Parameters
Warning:
We do not currently support this DNS record type.
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
algorithm | string | The public key's algorithm number. |
| 1 |
fptype | string | The public key's fingerprint type. |
| 1 |
TXT Record Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
txtdata | string | The TXT record's data. | A valid TXT record. Note: Surround this string with quotes ( | "v=spf1 a -all" |
Returns
This function only returns metadata.
Function information
API Version:
Available in:
WHM 11+
Methods:
GET, POST
Required Parameters:
domain
, line
, name
, class
, ttl
, type
Return Formats:
About WHM API 1
WHM API 1 performs functions and accesses data in WHM.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 1 Sections - DNS — DNS functions allow you to manage your server's DNS zones and records.
-
Page:WHM API 1 Functions - adddns — This function creates a DNS zone.
-
Page:WHM API 1 Functions - addzonerecord — This function adds a DNS zone record.
-
Page:WHM API 1 Functions - addzonerecord - Reverse DNS — This function uses PTR records to add reverse DNS functionality.
-
Page:WHM API 1 Functions - dumpzone — This function returns a domain's DNS zone configuration.