IP Ranges API update: Redirect destination of a domain

The IP range API is part of our enterprise API service. The service returns the list of IP addresses a certain company operates based on their identifying domain.

:link: IP Address Ranges API - IPinfo.io

What is identifying domain?

Organizations and companies can operate under different names and different ASNs. For that reason, we consider a single domain to be associated with their entire ecosystem. This is what we can call an “identifying domain”.

:link: How the domain field uniquely identifies organizations in the ASN and Company database - Docs / Database Downloads - IPinfo Community

For example, Amazon, AWS and other Amazon companies’ identifying domain would be amazon.com. By looking up amazon.com in the Ranges API and the IP to Company database, you can get information on all the IP addresses they own across their entire mega-corporation.

:link: Getting IP range information of a particular organization - Docs / Knowledgebase - IPinfo Community

IP Ranges API support redirection

Even though the core data of the IP ranges API is built on top of our IP to Company ASN database, it has one key differentiating point. The IP range API can accept URLs that resolve to the target URL that matches the identifying domain of an organization.

Consider: nytimes.com. The nytimes.com points to The New York Times organization, which owns many IP addresses. However, when you visit times.com you get redirected to nytimes.com. So, nytimes.com is the target website, identifying the domain of The New York Times organization.

SELECT *
FROM ip_company
WHERE domain='nytimes.com'

You can get the IP addresses of “The New York Times organization” by looking up times.com in the IP to Company database. You have to search for nytimes.com. However, the IP Ranges API service can determine where the input IP resolves or redirects to, subsequently providing a list of IP addresses for that company.

Looking up nytimes.com (identifying domain) in the ranges API service:

curl https://ipinfo.io/ranges/nytimes.com?token=$TOKEN
{
    "domain": "nytimes.com", <--- input domain
    "redirects_to": null, <------ no redirects, input domain is identifying domain
    "num_ranges": 24,
    "ranges": [
        "80.4.179.80/28",
        "97.67.74.80/29",
        [....]
        "99.136.101.32/27",
        "97.66.54.216/29"
    ]
}

Looking up times.com (redirecting domain) in the ranges API service:

https://ipinfo.io/ranges/times.com?token=$TOKEN
{
    "domain": "times.com", <---------------- input domain
    "redirects_to": "nytimes.com", <-------- redirects to identifying domain
    "num_ranges": 24,
    "ranges": [
        "80.4.179.80/28",
        "97.67.74.80/29",
        [...]
        "99.136.101.32/27",
        "97.66.54.216/29"
    ]
}

Understanding how the redirection mechanism of the ranges API

If you add a site that redirects to a popular site, you might be confused by seeing multiple IP addresses associated with that site. However, the IP addresses are associated with the redirecting domain, representing the organization behind the identified domain.

For example:

If a domain (1) redirects its users to its Amazon.com (2) storefront, that does not mean that the company of that domain owns the ranges the API returns. The domain (1) resolves to Amazon.com (2), which, operates all the ranges shown in the ranges API.

Another example:

A person has set up a domain that redirects to their LinkedIn page. When we visit their website, we get redirected to their LinkedIn page. If we pass their domain (1) to the ranges API, it will return the final target website (2) information, which in this case is LinkedIn (2).

2 Likes