You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

Child pages
  • WHM API 1 Functions - lookupnsips
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?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.0.2.0",
		"ipv6": "2001:0db8:0:0:1:0:0:1"
	},
	"metadata": {
		"version": 1,
		"reason": "OK",
		"result": 1,
		"command": "lookupnsips"
	}
}
 Output (XML)
<result>
    <data>
        <ipv4>192.0.2.0</ipv4>
        <ipv6>2001:0db8:0:0:1:0:0:1<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
ipv4string

The nameserver's IPv4 address.

Note:

The function returns this value only if a nameserver with an IPv4 address exists on the server.

A valid IPv4 address.192.0.2.0
ipv6string

The nameserver's IPv6 address.

Note:

The function returns this value only if a nameserver with an IPv6 address exists on the server.

A valid IPv6 address.
 Click to view...
2001:0db8:0:0:1:0:0:1