Difference: SetResolvers (4 vs. 5)

Revision 510 Jun 2009 - MelanieSeibert

Line: 1 to 1
 
META TOPICPARENT name="XmlApi"
Changed:
<
<

cPanel XMLAPI - setresolvers

>
>

Set Resolvers — setresolvers

 
Changed:
<
<
This function configures the nameservers that your server will use to resolve domain names. It is highly important that your resolving nameservers work and work well or your server may have performance and stability issues.
>
>
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.

 
Added:
>
>

Calling Functions

Using the XML API

<--/twistyPlugin twikiMakeVisibleInline-->

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

  • Append the /xml-api/functionname 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/functionname

  • 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.

<--/twistyPlugin-->

Using the JSON API

<--/twistyPlugin twikiMakeVisibleInline-->

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

  • Append the /json-api/functionname 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/functionname

  • 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.
<--/twistyPlugin-->
 

Variables

Added:
>
>
 

Input

Changed:
<
<
  • 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.
>
>
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

Changed:
<
<

Example

>
>
Show Hide
<--/twistyPlugin twikiMakeVisibleInline-->
  • 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.
<--/twistyPlugin-->

Examples

XML API

Show Hide
<--/twistyPlugin twikiMakeVisibleInline-->
 
Changed:
<
<
Calling /xml-api/setresolvers?nameserver1=4.2.2.2&nameserver2=4.2.2.1 in WebHost Manager will produce output similar to:
>
>
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:
  %CODE{lang="html"}% Listed in order they are:
Changed:
<
<
4.2.2.2 4.2.2.1
>
>
208.77.188.166 127.0.0.1
  1 Your resolvers have been setup!
Changed:
<
<
>
>
  %ENDCODE%
Added:
>
>
<--/twistyPlugin-->
 
Changed:
<
<

Copyright

Copyright 2008 cPanel Inc.

>
>

JSON API

Show Hide
<--/twistyPlugin twikiMakeVisibleInline-->

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:

<-- SyntaxHighlightingPlugin -->
{
   "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
      }
   ]
}
<-- end SyntaxHighlightingPlugin -->
<--/twistyPlugin-->
 \ No newline at end of file