GET/api/v2/ip

IP lookup API

Who an IPv4 or IPv6 address belongs to: its network, prefix, registry, reverse DNS name, location and connection type.

GEThttps://dnsrobot.netBase URL/api/v2Version/ipEndpoint?ip=Parameters
200 OKRecorded 2026-10-25. Send it to run the request live.
{
  "query": {
    "ip": "8.8.8.8"
  },
  "ip": "8.8.8.8",
  "version": 4,
  "special": null,
  "hostname": "dns.google",
  "network": {
    "asn": 15169,
    "name": "Google",
    "organization": "Google LLC",
    "handle": "GOOGLE",
    "prefix": "8.8.8.0/24",
    "registry": "arin",
    "allocated": "2023-12-28",
    "country": "US",
    "otherOrigins": [],
    "brand": {
      "name": "Google",
      "website": "google.com"
    },
    "kind": "hosting",
    "service": null,
    "users": null
  },
  "location": {
    "country": "US",
    "countryName": "United States",
    "region": "California",
    "city": "Mountain View",
    "latitude": 37.422,
    "longitude": -122.085,
    "source": "dbip",
    "attribution": "IP Geolocation by DB-IP (https://db-ip.com), CC BY 4.0"
  },
  "connection": {
    "type": "hosting",
    "tor": false,
    "relay": null
  },
  "tookMs": 1678
}

How it works

Describes any address from free, open sources: Team Cymru's IP-to-ASN service for the announcing network, its prefix, registry and allocation date (every origin when several networks announce it); the PTR record; DB-IP City Lite for the location (CC BY 4.0: show location.attribution where you display it); the Tor Project's exit list; and our network table (brand, kind, APNIC's user estimate) to tell a home ISP from a mobile carrier, a data centre or a relay.

A special-purpose address (private, CGNAT, loopback, link-local, documentation, multicast, reserved) is answered at once as a 200 with special filled in and everything else null: there is nothing on the internet to look up. Blocks IANA marks as public (6to4, NAT64, AS112) are looked up normally and still carry special.

Locations are where DB-IP places the address, not where a person is: an anycast, mobile or hosting address can be far from its users. A source that fails leaves its fields null and adds a warning; no paid geolocation service is ever called.

Query parameters

  • ipstringrequired
    An IPv4 or IPv6 address. IPv6 may be written in any form, with brackets; ::ffff:8.8.8.8 means 8.8.8.8.

Response fields

200 with this JSON object, plus tookMs, and incomplete with warnings when a source failed. Fields marked optional appear only when they apply.

  • queryobjectalways
    What was looked up, normalised (lower case, no trailing dot, IDNs as Punycode).
    • ipstringalways
      The address, written the usual way (IPv6 compressed and lower case; an IPv4-mapped address as its IPv4 address).
  • ipstringalways
    The address looked up.
  • versionintegeralways
    4 or 6.

    one of 4, 6

  • specialobject or nullalways
    The special-purpose block the address is in (IANA's IPv4 and IPv6 Special-Purpose Address Registries), or null for an ordinary address.
    Show 5 fields
    • kindstringalways
      private (RFC 1918, RFC 4193), cgnat (RFC 6598), loopback, link-local, documentation, multicast or reserved: never on the public internet, so nothing else was looked up. special-purpose: an IANA block that is on the public internet (6to4, Teredo, NAT64's well-known prefix, AS112), looked up normally.

      one of "private", "cgnat", "loopback", "link-local", "documentation", "multicast", "reserved", "special-purpose"

    • blockstringalways
      The block, e.g. 10.0.0.0/8.
    • namestring or nullalways
      IANA's name for the block, e.g. Private-Use.
    • rfcstring or nullalways
      The RFC that defines it, e.g. RFC 1918.
    • globallyReachableboolean or nullalways
      IANA's "Globally Reachable" column; null where IANA leaves it open.
  • hostnamestring or nullalways
    The reverse DNS (PTR) name, or null when there is none.
  • networkobject or nullalways
    The network that announces the address (Team Cymru), or null when no network announces it (or Team Cymru didn't answer: see warnings).
    Show 13 fields
    • asnintegeralways
      The AS number.
    • namestringalways
      The network's name as people read it ("Google", "Comcast Cable Communications").
    • organizationstring or nullalways
      The AS's registered holder, as Team Cymru has it ("Google LLC").
    • handlestring or nullalways
      The AS's registered handle ("GOOGLE").
    • prefixstring or nullalways
      The most specific announced prefix holding the address.
    • registrystring or nullalways
      The regional registry: arin, ripencc, apnic, lacnic or afrinic.
    • allocatedstring or nullalways
      When the registry handed out the address block (YYYY-MM-DD).
    • countrystring or nullalways
      The country the block is registered in (not where the address is used).
    • otherOriginsarray of integersalways
      Other AS numbers announcing a prefix with this address (multi-origin), usually empty.
    • brandobject or nullalways
      The brand people know ("Xfinity" for Comcast's AS7922), where our brand table has the network.
      Show 2 fields
      • namestringalways
        The brand.
      • websitestring or nullalways
        The brand's website domain.
    • kindstring or nullalways
      What kind of network it is: isp (home broadband), mobile, relay (Apple iCloud Private Relay, Cloudflare WARP), hosting (cloud, hosting, VPN exits, CDNs), satellite, other. From APNIC's user counts, a hand-checked brand table and name rules.

      one of "isp", "mobile", "relay", "hosting", "satellite", "other", null

    • servicestring or nullalways
      The brand table's service: fixed (home broadband), mobile, both or satellite.

      one of "fixed", "mobile", "both", "satellite", null

    • usersobject or nullalways
      APNIC Labs' estimate of the people online through the network in its main country, or null (not counted, or a hosting or relay network, whose "users" are VPN and relay users).
      Show 5 fields
      • countrystringalways
        ISO 3166-1 alpha-2 country code.
      • estimateintegeralways
        Estimated users there.
      • sharenumberalways
        Percent of the country's users.
      • rankintegeralways
        Rank among the networks APNIC lists there (1 = largest).
      • countryUsersinteger or nullalways
        The country's estimated internet users.
  • locationobject or nullalways
    Where DB-IP City Lite places the address, or null when it has no location for it.
    Show 8 fields
    • countrystring or nullalways
      ISO 3166-1 alpha-2 country code.
    • countryNamestring or nullalways
      The country's English name.
    • regionstring or nullalways
      Region or state.
    • citystring or nullalways
      City.
    • latitudenumber or nullalways
      Latitude of the city.
    • longitudenumber or nullalways
      Longitude of the city.
    • sourcestringalways
      Always dbip.
    • attributionstringalways
      The credit DB-IP's licence (CC BY 4.0) asks for wherever its data is shown.
  • connectionobjectalways
    What kind of connection the address is.
    • typestring or nullalways
      One type for the address, most specific first: tor (the Tor Project's exit list), relay, hosting, mobile, satellite, residential (a home ISP), business; null when unknown.

      one of "tor", "relay", "hosting", "mobile", "satellite", "residential", "business", null

    • torboolean or nullalways
      Whether the address is a Tor exit right now (the Tor Project's own list, kept 30 minutes); null for IPv6 (the list has none) or when the list couldn't be read.
    • relaystring or nullalways
      A network that carries other people's traffic on purpose: icloud (Akamai's AS36183, iCloud Private Relay), cloudflare (AS13335: WARP, but also any Cloudflare server), fastly (AS54113).

      one of "icloud", "cloudflare", "fastly", null

Errors

  • 503 unavailable Team Cymru, reverse DNS and the location data all failed at once.

Plus the errors every endpoint can return: 400 for a missing or unreadable parameter, 429 past the limit, 503 when every source failed.

Code samples

curl "https://dnsrobot.net/api/v2/ip?ip=8.8.8.8"
const params = new URLSearchParams({ ip: "8.8.8.8" });
const res = await fetch(`https://dnsrobot.net/api/v2/ip?${params}`);
const data = await res.json();
if (!res.ok) throw new Error(data.error.message);
console.log(data.network);
import requests

r = requests.get(
    "https://dnsrobot.net/api/v2/ip",
    params={"ip": "8.8.8.8"},
    timeout=30,
)
data = r.json()
if not r.ok:
    raise RuntimeError(data["error"]["message"])
print(data["network"])
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"net/url"
)

func main() {
	q := url.Values{"ip": {"8.8.8.8"}}
	res, err := http.Get("https://dnsrobot.net/api/v2/ip?" + q.Encode())
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	var data map[string]any
	if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
		panic(err)
	}
	if res.StatusCode != http.StatusOK {
		panic(data["error"])
	}
	fmt.Println(data["network"])
}
<?php
$query = http_build_query(["ip" => "8.8.8.8"]);
$context = stream_context_create(["http" => ["ignore_errors" => true, "timeout" => 30]]);
$data = json_decode(file_get_contents("https://dnsrobot.net/api/v2/ip?" . $query, false, $context), true);
if (isset($data["error"])) {
    throw new RuntimeException($data["error"]["message"]);
}
print_r($data["network"]);
require "net/http"
require "json"

uri = URI("https://dnsrobot.net/api/v2/ip")
uri.query = URI.encode_www_form(ip: "8.8.8.8")
data = JSON.parse(Net::HTTP.get(uri))
raise data["error"]["message"] if data["error"]
puts data["network"]
// Cargo.toml: reqwest = { version = "0.13", features = ["blocking", "json"] }, serde_json = "1"
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = reqwest::blocking::get("https://dnsrobot.net/api/v2/ip?ip=8.8.8.8")?;
    let ok = res.status().is_success();
    let data: serde_json::Value = res.json()?;
    if !ok {
        return Err(data["error"]["message"].to_string().into());
    }
    println!("{}", data["network"]);
    Ok(())
}
using System.Text.Json;

using var http = new HttpClient();
var res = await http.GetAsync("https://dnsrobot.net/api/v2/ip?ip=8.8.8.8");
var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()).RootElement;
if (!res.IsSuccessStatusCode)
    throw new Exception(data.GetProperty("error").GetProperty("message").GetString());
Console.WriteLine(data.GetProperty("network"));

Google Public DNS

GET /api/v2/ip?ip=8.8.8.8
200 OKRecorded 2026-10-25
{
  "query": {
    "ip": "8.8.8.8"
  },
  "ip": "8.8.8.8",
  "version": 4,
  "special": null,
  "hostname": "dns.google",
  "network": {
    "asn": 15169,
    "name": "Google",
    "organization": "Google LLC",
    "handle": "GOOGLE",
    "prefix": "8.8.8.0/24",
    "registry": "arin",
    "allocated": "2023-12-28",
    "country": "US",
    "otherOrigins": [],
    "brand": {
      "name": "Google",
      "website": "google.com"
    },
    "kind": "hosting",
    "service": null,
    "users": null
  },
  "location": {
    "country": "US",
    "countryName": "United States",
    "region": "California",
    "city": "Mountain View",
    "latitude": 37.422,
    "longitude": -122.085,
    "source": "dbip",
    "attribution": "IP Geolocation by DB-IP (https://db-ip.com), CC BY 4.0"
  },
  "connection": {
    "type": "hosting",
    "tor": false,
    "relay": null
  },
  "tookMs": 1678
}

Cloudflare's resolver over IPv6

GET /api/v2/ip?ip=2606%3A4700%3A4700%3A%3A1111
200 OKRecorded 2026-10-25
{
  "query": {
    "ip": "2606:4700:4700::1111"
  },
  "ip": "2606:4700:4700::1111",
  "version": 6,
  "special": null,
  "hostname": "one.one.one.one",
  "network": {
    "asn": 13335,
    "name": "Cloudflare",
    "organization": "Cloudflare, Inc.",
    "handle": "CLOUDFLARENET",
    "prefix": "2606:4700:4700::/48",
    "registry": "arin",
    "allocated": "2011-11-01",
    "country": "US",
    "otherOrigins": [],
    "brand": {
      "name": "Cloudflare",
      "website": "cloudflare.com"
    },
    "kind": "hosting",
    "service": null,
    "users": null
  },
  "location": {
    "country": "CA",
    "countryName": "Canada",
    "region": "Quebec",
    "city": "Montreal",
    "latitude": 45.502,
    "longitude": -73.567,
    "source": "dbip",
    "attribution": "IP Geolocation by DB-IP (https://db-ip.com), CC BY 4.0"
  },
  "connection": {
    "type": "hosting",
    "tor": null,
    "relay": "cloudflare"
  },
  "tookMs": 355
}

A private address

GET /api/v2/ip?ip=192.168.1.1
200 OKRecorded 2026-10-25
{
  "query": {
    "ip": "192.168.1.1"
  },
  "ip": "192.168.1.1",
  "version": 4,
  "special": {
    "kind": "private",
    "block": "192.168.0.0/16",
    "name": "Private-Use",
    "rfc": "RFC 1918",
    "globallyReachable": false
  },
  "hostname": null,
  "network": null,
  "location": null,
  "connection": {
    "type": null,
    "tor": null,
    "relay": null
  },
  "tookMs": 0
}