Child pages
  • WHM API 1 Functions - lookupnsips
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

 

Description

This function retrieves a nameserver's IPv4 and IPv6 addresses.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/lookupnsips?api.version=1&host=ns1.example.com
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/lookupnsips?api.version=1&host=ns1.example.com
 Command Line
whmapi1 lookupnsips host=ns1.example.com


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "ipv4": "192.168.1.20"
    "ipv6": "2001:db8::-2001:db8:ffff:ffff:ffff:ffff:ffff:ffff"
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "lookupnsips"
  }
}
 Output (XML)
<result>
    <data>
        <ipv4>192.168.1.20</ipv4>
        <ipv6>2001:db8::-2001:db8:ffff:ffff:ffff:ffff:ffff:ffff<ipv6>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>lookupnsips</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
hoststring

Required

The nameserver's hostname.

A valid nameserver hostname.ns1.example.com

Returns

ReturnTypeDescriptionPossible valuesExample
ipv4stringThe nameserver's IPv4 address.A valid IPv4 address.192.168.0.20
ipv6stringThe nameserver's IPv6 address.A valid IPv6 address.
2001:db8::-2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
  • No labels