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

Resolve an IP Address from a Domain Name — resolvedomainname

This function is only available in version 11.27/11.28+.

This function will attempt to resolve an IP address for a specified domain name.

Calling Functions

Using the XML API

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

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

  • 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 resolvedomainname function from within your custom script:

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

  • 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

  • domain — The domain whose IP address should be resolved.
  • api.version (integer) — The XML API version number. You should always set this value to 1.

Output

  • result — The results container.
    • data — The data container.
      • ip (string) — The IP address for the domain, if it resolved.
    • metadata — The metadata container.
      • result (boolean) — A boolean value that indicates success or failure.
        • 1 — Indicates success
        • 0 — Indicates failure
      • reason (string) — A string value that contains a message of success or a reason for failure.
      • version (integer) — An integer value that contains the version number of the XML API used for the function, in this case 1.
      • command (string) — The function that was just called. In this case, resolvedomainname.

Examples

XML API

Calling this URL in WebHost Manager:

https://example.com:2087/xml-api/resolvedomainname?api.version=1&domain=example.com

will produce output similar to:

<result>
   <data>
      <ip>192.168.0.1</ip>
   </data>
   <metadata>
      <result>1</result>
      <reason>OK</reason>
      <version>1</version>
      <command>resolvedomainname</command>
   </metadata>
</result>

JSON API

Calling this URL in WebHost Manager:

https://example.com:2087/json-api/resolvedomainname?api.version=1&domain=example.com

will produce output similar to:

{
      "data":{
         "ip":"192.168.0.1"
      },
      "metadata":{
         "result":1,
         "reason":"OK",
         "version":1,
         "command":"resolvedomainname"
      }
   }

Topic revision: r7 - 23 Aug 2013 - 19:45:37 - Main.LaurenceSimon
AllDocumentation/AutomationIntegration.XmlResolveDomainName moved from Sandbox.XmlResolveDomainName on 02 Sep 2010 - 19:23 by Main.JustinSchaefer