API: SubnetInfo

The SubnetInfo API call retrieves information about a subnet. It is based on the IP subnet report displayed on the website, see for example https://dnslytics.com/ip/104.27.176. We calculate statistics of all subnets allocated by the RIRs (ARIN, RIPE etc.) and subnets part of the global routing table. In total about 700K IPv4 subnets.

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/subnetinfo/<cidr>/summary?apikey=<apikey>

Parameters:

cidr:The requested IP subnet in CIDR format, for example 104.27.176.0/20. For now only IPv4 subnets are supported.
apikey:Your API key

API response

A JSON object with the following fields:

status:Status of API call: succeed or error.
question:The requested CIDR.
typeinfo:Data type returned, always ‘subnetinfo’.
startip:Start IP of subnet.
endip:End IP of subnet.
cidr:Subnet in CIDR notation.
shortname:Description of the subnet extracted from the IP whois information.
country:Country of registration (2-digit code).
rir:Regional Internet Registry (eg Ripe or Arin).
nroutes:Number of BGP routes this subnet is part of.
ndomains:Number of total domains hosted on this subnet.
ngtld:Number of global TLD domains (.com, .net etc.) hosted on this subnet.
ncctld:Number of country TLD domains (.de, .uk etc.) hosted on this subnet.
nntld:Number of new global TLD domains (.app, .xyz etc.) hosted on this subnet.
nidntld:Number of IDN domains hosted on this subnet.
nalexatop1m:Number of domains within the Alexa Top Million hosted on this subnet.
nmxrecords:Number of MX records hosted on this subnet.
nnsrecords:Number of NS records hosted on this subnet.
nspamhosts:Number of spam hosts hosted on this subnet.
routes:Array of BGP routes with the following fields (cidr, AS number, shortname and country of AS).
mxrecords:Top 50 IP addresses with MX records hosted on it. Array of IP records with the following fields (ip, number of MX records, example MX record).
nsrecords:Top 50 IP addresses with NS records hosted on it. Array of IP records with the following fields (ip, number of NS records, example NS record).
topips:Top 50 IP addresses with domains hosted on this subnet. Following fields are returned (ip, number of domains, example domain).
domains:Top 50 domains hosted on this subnet. Following fields are returned (domain, ip, domainrank).

Example

$ https://api.dnslytics.net/v1/subnetinfo/104.27.176.0/20/summary?apikey=<apikey>
{
  "status": "succeed",
  "data":
  {
        "question": "104.27.176.0/20",
        "typeinfo": "subnetinfo",
        "startip": "104.27.176.0",
        "endip": "104.27.191.255",
        "cidr": "104.27.176.0/20",
        "shortname": "Cloudflare, Inc.",
        "country": "US",
        "rir": "arin",
        "nroutes": 2,
        "ndomains": 303987,
        "ngtld": 164601,
        "ncctld": 82554,
        "nntld": 56832,
        "ngtld": 285,
        "nalexatop1m": 5047,
        "nmxrecords": 280,
        "nnsrecords": 170,
        "nspamhosts": 0,
        "routes":[
                {
                  "cidr": "104.16.0.0/12",
                  "asn": 13335,
                  "shortname": "Cloudflare, Inc.",
                  "country": "US"
                },
                {"......."}
          ],
        "mxrecords":[
                {
                  "ip": "104.27.176.143",
                  "nmxrecords": 3,
                  "examples": "mail.example.com,mail.example.net"
                },
                {"......."}
          ],
        "nsrecords":[
                {
                  "ip": "104.27.182.232",
                  "nnsrecords": 4,
                  "examples": "ns1.example.com,ns2.example.net"
                },
                {"......."}
          ],
        "topips":[
                {
                  "ip": "104.27.184.9",
                  "ndomains": 259,
                  "examples": "example.com,example.net"
                },
                {"......."}
          ],
        "domains":[
                {
                  "domain": "example.net",
                  "ip": "104.27.182.34",
                  "domainrank": 9
                },
                {"......."}
          ]
  }
}