IP Addresses
Network Address Translation
Return public IP address of private IP address
This function returns the public IP address for a specified public or private IP address. You can use this function to determine the system's main public IP address, especially for systems that use a 1:1 NAT configuration.
- cPanel & WHM uses the main public IP address to perform many different functions. For example, the system uses this IP address to verify the server's license status with WebPros International, LLC.
- System administrators can configure the main public IP address in WHM's Basic WebHost Manager Setup interface (Home >> Server Configuration >> Basic WebHost Manager Setup).
get/get_public_ip
Query parameters
ipstring ipv4 required
Example:192.0.2.0
A valid public or private IP address to query.
Response
HTTP Request was successful.
Example response
{
"data": {
"public_ip": "192.0.2.0"
},
"metadata": {
"command": "get_public_ip",
"reason": "OK",
"result": 1,
"version": 1
}
}