API: IPInfo

The IPInfo API call retrieves information about an IP address. It is based on the IP address report displayed on the website, see for example https://dnslytics.com/ip/104.27.178.200. This is a Premium API call, you have to buy API credits here (https://dnslytics.com/api).

API request and parameters

https://api.dnslytics.net/v1/ipinfo/<ip or hostname>?apikey=<apikey>

Parameter:

ip or hostname:IPv4 or IPv6 address. In case of hostname we use the first IPv4 address it resolves to.
apikey:Your API key

API response

A JSON object with the following fields:

status:Status of API call: succeed or error.
question:The requested IP address.
typeinfo:Data type returned, always ‘ipinfo’.
asinfo:Routing information of IP address with the following fields (asn, ip_start, ip_end, subnet, cidr, shortname). The shortname field is extracted out of the whois data of the ASN
shortname:Description of subnet based on the Whois data
ptr:Reverse DNS record (PTR), empty string when no PTR record configured.
ndomains:Number of domains hosted on this IP.
domains:If ndomains > 0 a maximum of 10 domains are returned.
nmxrecords:Number of MX records hosted on this IP.
mxrecords:If nmxrecords > 0 a maximum of 10 MX records are returned.
nnsrecords:Number of NS records hosted on this IP.
nsrecords:If nnsrecords > 0 a maximum of 10 MX records are returned.
hostinghistory:Number of unique domains, MX and NS records hosted in the past on this IP.
subnethosting:IP addresses on the same /24 IPv4 or /64 IPv6 subnet with one or more domains hosted on it. Following fields are returned: ips (ip, count, example). Maximum of 100 IP addresses are returned.
blocklist:Contains blocklist info for thips IP. dnsblcountsubnet is the number of IP addresses for this subnet listed on our dns blacklist (subnet as defined onder asinfo property).
geoinfo:Geo information with the following fields: country_code, country_name, capital, areainsqkm, population, continent, currency, currencyname and tldn.

Example

$ https://api.dnslytics.net/v1/ipinfo/104.27.179.200?apikey=<apikey>
{
        "status": "succeed",
        "data":
        {
                "question": "104.27.179.200",
                "typeinfo": "ipinfo",
                "asinfo":
                {
                  "asn": 13335,
                  "ip_start": "104.27.176.0",
                  "ip_end": "104.27.191.255",
                  "subnet": 20,
                  "cidr": "104.27.176.0/20",
                  "shortname": "Cloudflare, Inc."
                },
        "shortname":"Cloudflare, Inc.",
        "ptr":"",
        "ndomains":138,
        "domains":[
                "dnslytics.com",
                "..."
          ],
        "nmxrecords": 0,
        "mxrecords": [],
        "nnsrecords": 0,
        "nsrecords": [],
        "hostinghistory":
        {
          "ndomains": 201,
          "nmxrecords": 19,
          "nnsrecords": 0
        },
        "subnethosting":
        {
                "ips": [
                {
                  "ip": "104.27.179.0",
                  "count": 1,
                  "example": "example.com"},
                {"..."}
                ]
        },
        "blocklist":
        {
          "dnsblcountsubnet": 0,
          "dnsbl": false,
          "adulthosting": false,
          "mthreats": false,
          "openproxy": false
        },
        "geoinfo":
        {
          "country_code": "US",
          "country_name": "United States",
          "capital": "Washington",
          "areainsqkm": "9629091",
          "population": 310232863,
          "continent": "NA",
          "currency": "USD",
          "currencyname": "Dollar",
          "tldn": ".us"
        }
  }
}