/dns/list_ips


GET https://api.sitehost.nz/1.0/dns/list_ips.json

Lists all IP addresses for a client.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client that the IP addresses belong to.Example: 1

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/dns/list_ips.json?apikey=your_key_here&client_id=1", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/dns/list_ips.json?apikey=your_key_here&client_id=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.sitehost.nz/1.0/dns/list_ips.json?apikey=your_key_here&client_id=1")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
import requests

uri = 'https://api.sitehost.nz/1.0/dns/list_ips.json?apikey=your_key_here&client_id=1'

response = requests.get(uri)

Response

200:

application/json
{
  "return": {
    "192.168.1.105": {
      "ip_addr": "192.168.1.105",
      "netmask": "255.255.255.0",
      "prefix": "32",
      "reserved": "0",
      "rdns": "192-168-1-105.sitehost.co.nz",
      "addr_family": "4",
      "date_allocated": "2010-08-01 00:00:00",
      "server_id": "17200",
      "name": "vnc-staging",
      "label": "[staging] vnc-staging",
      "is_primary": "1",
      "ip_type": "1"
    },
    "192.168.9.3": {
      "ip_addr": "192.168.9.3",
      "netmask": "255.255.255.0",
      "prefix": "32",
      "reserved": "0",
      "rdns": "192-168-9-3.sitehost.co.nz",
      "addr_family": "4",
      "date_allocated": "2014-01-22 15:48:36"
    },
    "192.168.9.4": {
      "ip_addr": "192.168.9.4",
      "netmask": "255.255.255.0",
      "prefix": "32",
      "reserved": "0",
      "rdns": "192-168-9-4.sitehost.co.nz",
      "addr_family": "4",
      "date_allocated": "2014-01-28 11:35:13"
    },
    "192.168.10.0": {
      "ip_addr": "192.168.10.0",
      "netmask": "255.255.255.0",
      "prefix": "32",
      "reserved": "1",
      "rdns": "192-168-10-0.sitehost.co.nz",
      "addr_family": "4",
      "date_allocated": "2014-02-19 15:08:10"
    },
    "192.168.10.1": {
      "ip_addr": "192.168.10.1",
      "netmask": "255.255.255.0",
      "prefix": "32",
      "reserved": "1",
      "rdns": "192-168-10-1.sitehost.co.nz",
      "addr_family": "4",
      "date_allocated": "2014-02-19 15:08:13"
    }
  },
  "msg": "Successful.",
  "status": true,
  "time": 36.46
}