Description

This function retrieves the server's hostname.

Examples 


https://hostname.example.com:2087/cpsess##########/json-api/gethostname?api.version=1
https://hostname.example.com:2087/cpsess##########/xml-api/gethostname?api.version=1
whmapi1 gethostname

{
  "data": {
    "hostname": "hostname.example.com"
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "gethostname"
  }
}
<result>
    <data>
        <hostname>hostname.example.com</hostname>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>gethostname</command>
    </metadata>
</result>

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample

hostname

string

The server's hostname.

A valid hostname.hostname.example.com