Description
This function edits a zone record.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameters |
Type |
Description |
Possible values |
Example |
Line |
integer |
Required The line in the zone file to edit. |
A positive integer. |
5 |
domain |
string |
Required The record's domain. |
A valid domain name. |
example.com |
name |
string |
Required The record's name, which maps to the subdomain. |
A valid string. |
sub |
type |
string |
Required The type of record. |
|
A |
txtdata |
string |
The record's text data. Note: This parameter is required if the typeparameter's value is TXT or SRV. |
A valid string. |
v=blahblahblah |
cname |
string |
The record's canonical name. Note: This parameter is required if the typeparameter's value is CNAME. |
A valid canonical name. |
example.com |
address |
string |
The IP address to map to the record. Note: This parameter is required if the typeparameter's value is A or AAAA. |
A valid IPv4 or IPv6 address. |
10.10.10.10 |
ttl |
integer |
The record's time to live. This value defaults to 14400. |
A valid positive integer that represents the record's time to live, in seconds. |
14400 |
class |
string |
The record's class. This value defaults to IN. |
IN |
IN |
Returns
Return
|
Type
|
Description
|
Possible values
|
Example
|
result
|
hash
|
A hash of the zone record information.
|
The hash includes the newserial, statusmsg, and statusreturns.
|
|
newserial
|
integer
|
The new serial number of the zone file.
The function returns this value in the result hash.
|
A positive integer.
|
2014101603
|
statusmsg
|
string
|
A status message from the DNS server.
The function returns this value in the result hash.
|
A string.
|
|
status
|
Boolean
|
Whether the function succeeded.
The function returns this value in the result hash.
|
|
1
|
reason
|
string
|
A reason for failure.
Note:
This function only returns areason value if it failed.
|
A string that describes the error.
|
This is an error message.
|
result
|
Boolean
|
Whether the function succeeded.
|
|
1
|