WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function deletes a DNS zone record.
Warning:
Incorrect use of this function could cause domains to resolve incorrectly. Exercise extreme caution when you remove DNS zone records.
To effectively use this function, use the following workflow:
- Run the
dumpzonefunction. - Locate the
Linevalue that corresponds to the zone record to delete. - Use the values from that zone record to formulate the appropriate
removezonerecordparameters.
Important:
- When you disable the DNS role, the system disables this function.
- You cannot use this function to modify temporary domains.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/removezonerecord
- A server running WHM.
https://whm-server.tld:2087/json-api/removezonerecord
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/removezonerecord?line=4&zone=example.com&serialnum=2013122501'{ "metadata": { "command": "removezonerecord", "reason": "Bind reloading on hostname using rndc zone: [example.com]\n", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/update_reverse_dns_cache
- A server running WHM.
https://whm-server.tld:2087/json-api/update_reverse_dns_cache
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/update_reverse_dns_cache{ "metadata": { "command": "update_reverse_dns_cache", "reason": "OK", "result": 1, "version": 1 } }
Request
This function returns a domain's DNS zone configuration.
Important:
- This function is deprecated. Use WHM's
parse_dns_zonefunction. - You must include either the
domainor thezoneparameters. - When you disable the DNS role, the system disables this function.
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/dumpzone
- A server running WHM.
https://whm-server.tld:2087/json-api/dumpzone
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/dumpzone?domain=example.com&zone=example.com.db'{ "data": { "zone": [ … ] }, "metadata": { "command": "dumpzone", "reason": "Zone Serialized", "result": 1, "version": 1 } }