WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function lists a domain's MX records.
Important:
When you disable the DNS role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/listmxs
- A server running WHM.
https://whm-server.tld:2087/json-api/listmxs
- 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/listmxs?domain=example.com'{ "data": { "record": [ … ] }, "metadata": { "command": "listmxs", "reason": "Records obtained.", "result": 1, "version": 1 } }
Request
This function resets a DNS zone to its default values. This also resets the domain's subdomain DNS records, and restores zone file subdomains in the server's httpd.conf file. For example, use this function to restore DNS zones that are corrupt.
Note:
Zone resets preserve valid TXT records, but all other records will return to their default values.
Important:
When you disable the DNS role, the system disables this function.
Note
You must include either the domain or the zone parameters.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/resetzone
- A server running WHM.
https://whm-server.tld:2087/json-api/resetzone
- 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/resetzone?domain=example.com&user=user&zone=example.com.db'{ "metadata": { "command": "resetzone", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/resolvedomainname
- A server running WHM.
https://whm-server.tld:2087/json-api/resolvedomainname
- 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/resolvedomainname?domain=example.com'{ "data": { "ip": "192.168.0.20" }, "metadata": { "command": "resolvedomainname", "reason": "OK", "result": 1, "version": 1 } }
Request
This function lists a domain's MX records.
Important:
When you disable the DNS role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/listmxs
- A server running WHM.
https://whm-server.tld:2087/json-api/listmxs
- 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/listmxs?domain=example.com'{ "data": { "record": [ … ] }, "metadata": { "command": "listmxs", "reason": "Records obtained.", "result": 1, "version": 1 } }
Request
This function resets a DNS zone to its default values. This also resets the domain's subdomain DNS records, and restores zone file subdomains in the server's httpd.conf file. For example, use this function to restore DNS zones that are corrupt.
Note:
Zone resets preserve valid TXT records, but all other records will return to their default values.
Important:
When you disable the DNS role, the system disables this function.
Note
You must include either the domain or the zone parameters.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/resetzone
- A server running WHM.
https://whm-server.tld:2087/json-api/resetzone
- 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/resetzone?domain=example.com&user=user&zone=example.com.db'{ "metadata": { "command": "resetzone", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/resolvedomainname
- A server running WHM.
https://whm-server.tld:2087/json-api/resolvedomainname
- 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/resolvedomainname?domain=example.com'{ "data": { "ip": "192.168.0.20" }, "metadata": { "command": "resolvedomainname", "reason": "OK", "result": 1, "version": 1 } }