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

 

Description

This function retrieves the default nameservers for the currently-authenticated user.

Examples 


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


Notes:

  • 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":{  
      "nameservers":[  
         "ns1.example.com",
         "ns2.example.com"
      ]
   },
   "metadata":{  
      "command":"get_nameserver_config",
      "reason":"OK",
      "version":1,
      "result":1
   }
}
 Output (XML)
<result>
    <data>
        <nameservers>ns1.example.com</nameservers>
        <nameservers>ns2.example.com</nameservers>
    </data>
    <metadata>
        <command>get_nameserver_config</command>
        <reason>OK</reason>
        <result>1</result>
        <version>1</version>
    </metadata>
</result>


Note:

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

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
nameserversarray
The currently-authenticated user's nameservers.An array of valid hostnames.
"ns1.example.com","ns2.example.com"