Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Set Resolvers — setresolvers

This function configures the nameservers that your server will use to resolve domain names.

PICK Important: It is essential that your resolving nameservers work well; if they do not, your server may have performance and stability problems.

Calling Functions

Using the XML API

To use the XML API to perform the setresolvers function from within your custom script:

  • Append the /xml-api/setresolvers function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/setresolvers

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the setresolvers function from within your custom script:

  • Append the /json-api/setresolvers function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/setresolvers

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The setresolvers function takes the following variables as input. While only the first is required, we recommend using more resolvers, if possible.
  • nameserver1 (string) — IP address of the first resolving nameserver.
  • nameserver2 (string) — IP address of the second resolving nameserver.
  • nameserver3 (string) — IP address of the third resolving nameserver.

Output

Show Hide
  • setresolvers — Root-level XML tag for the output of the setresolvers function.
    • setresolvers — Container for output of the function.
      • msgs (string) — Container for the list of resolver IP addresses.
      • status (boolean) — Status of the setresolvers request.
      • statusmsg (string) — Details about the status of the setresolvers request.
      • warns (string) — Any warnings which result from your resolver choices.

Examples

XML API

Show Hide

Calling the following URL: https://example.com:2087/xml-api/setresolvers?nameserver1=208.77.188.166&nameserver2=127.0.0.1 in WebHost Manager will produce output similar to:

<setresolvers>
     <setresolvers>
            <msgs>Listed in order they are:</msgs>
             <msgs>208.77.188.166</msgs>
             <msgs>127.0.0.1</msgs>
             <status>1</status>
             <statusmsg>Your resolvers have been setup!</statusmsg>
             <warns/>
     </setresolvers>
</setresolvers>

JSON API

Show Hide

Calling the following URL: https://example.com:2087/json-api/setresolvers?nameserver1=208.77.188.166&nameserver2=127.0.0.1 in WebHost Manager will produce output similar to:

{
   "setresolvers":[
      {
         "status":1,
         "statusmsg":"Your resolvers have been setup!",
         "msgs":[
            "Listed in order they are:",
            "208.77.188.166",
            "127.0.0.1",
         ],
         "warns":null
      }
   ]
}

Topic revision: r6 - 29 Sep 2009 - 19:04:58 - MelanieSeibert