Page tree
Skip to end of metadata
Go to start of metadata

 

Description

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

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/lookupnsips?nameserver=ns1.example.com
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/lookupnsips?nameserver=ns1.example.com
 Command Line
whmapi0 lookupnsips nameserver=ns1.example.com

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "ipv4":"192.168.0.20"
   "ipv6":"2001:db8::-2001:db8:ffff:ffff:ffff:ffff:ffff:ffff"
}
 Output (XML)
<lookupnsips>
      <ipv4>192.168.0.20</ipv4>
      <ipv6>2001:db8::-2001:db8:ffff:ffff:ffff:ffff:ffff:ffff</ipv6>
</lookupnsips>

   

Parameters

ParameterTypeDescriptionPossible valuesExample
nameserverstring

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