WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
setresolvers \
nameserver1='192.168.0.20' \
nameserver2='192.168.0.21'{ "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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
update_nameservers_config{ "metadata": { "command": "update_nameservers_config", "reason": "OK", "result": 1, "version": 1 } }