WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_up_dns_resolver_workarounds
- A server running WHM.
https://whm-server.tld:2087/json-api/set_up_dns_resolver_workarounds
- 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/set_up_dns_resolver_workarounds{ "data": { "flags": { … } }, "metadata": { "command": "set_up_dns_resolver_workarounds", "reason": "OK", "result": 1, "version": 1 } }
Request
This function configures the server's resolver nameservers.
Warning:
- The nameservers that the server uses as resolvers must function correctly. If they do not, the server will experience performance and stability issues.
- Never set a resolver nameserver to
127.0.0.1on a cPanel & WHM server.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/setresolvers
- A server running WHM.
https://whm-server.tld:2087/json-api/setresolvers
- 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/setresolvers?nameserver1=192.168.0.20&nameserver2=192.168.0.21&nameserver3=2001%3A4860%3A4860%3A%3A8888'{ "metadata": { "command": "setresolvers", "output": { … }, "reason": "Your resolvers have been setup!", "result": 1, "version": 1 } }
Request
This function updates nameservers in the wwwacct.conf file. For more information, read our Installation Guide - Customize Your Installation documentation.
The nameserver to add or update as the wwwacct.conf file's NS setting. If you do not supply a value, the function does not update the setting.
The nameserver to add or update as the wwwacct.conf file's NS2 setting. If you do not supply a value, the function does not update the setting.
The nameserver to add or update as the wwwacct.conf file's NS3 setting. If you do not supply a value, the function does not update the setting.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/update_nameservers_config
- A server running WHM.
https://whm-server.tld:2087/json-api/update_nameservers_config
- 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_nameservers_config?nameserver=ns1.example.com&nameserver2=ns2.example.com&nameserver3=ns3.example.com&nameserver4=ns4.example.com'{ "metadata": { "command": "update_nameservers_config", "reason": "OK", "result": 1, "version": 1 } }