How I researched game server IPs with the IPinfo CLI, IP Company API and Snowflake

In this post, I came across a few IP ranges used in a game server.

:link: Reddit - Dive into anything

Gamers want gamer server IPs to improve the latency of access. Bigger game companies use multiple data center vendors for hosting their game servers. If gamers can get the entire IP address ranges of those data center vendors, they can reach out to their ISPs for special arrangements to get low latency on accessing those IPs.

I am not a gamer, so I am not exactly sure how this works. But I am the DevRel of IPinfo, so I can easily get those data center IP ranges.

Getting the IP address ranges from codebloc

  • I copied the comment code block and put them in a log.txt file.
  • Then I used IPinfo CLI’s grepip command to extract the IP addresses. I added the -o option to get only matching IP addresses.
  • Then I run the sort -u command to get the unique IPs only.
ipinfo grepip -o log.txt | sort -u


Getting the company information

Even though ASN information was my first hunch, I wasn’t sure if there were any smaller companies or smaller data centers there. Smaller data centers could have rented out IPs from bigger data centers that are ASN.

So, I decided to use the company data here. Company data’s unique identifier is its domain field which is the official website/domain of the company.

And running the test, it looks like I was right. Unique ASN domains are only 10 (with unique ASN being 12) and the unique company domain is 28. In conclusion, some of these data centers do not own these IP address ranges.

I used the ipinfo bulk command to run bulk IP look-up on the unique IP addresses, and I used the jq tool to access the company → domain field.

Building up to the previous code:

ipinfo grepip -o log.txt | sort -u | ipinfo bulk | jq .[].company.domain | sort -u

Now getting the IP address ranges from these domains

Our API does not support domain-to-IP range lookups. However, lucky for me, I have access to our company database. I am using our Snowflake listing to get the IP address ranges from the company domains.

WITH domains (website) AS (
    SELECT *
        -- rest of the domains

SELECT ipinfo.public.range2cidr(start_ip, end_ip) as ip_range, * FROM domains d
JOIN ipinfo.public.ip_company ipc

The range2cidr outputs the data result in an array which is not helpful to us here. Now using some script kiddying from I came up with this SQL script that flattens the data.

  flat_domain_data.value as IP_RANGE
  FROM (
    SELECT ipinfo.public.range2cidr(start_ip, end_ip) as ip_range, * FROM domains d
    JOIN ipinfo.public.ip_company ipc
) result_table,
TABLE(FLATTEN(result_table.ip_range)) flat_domain_data;

Now, I can download the data output as CSV and send that to my ISP.


PS: The DOMAINS field should IP_RANGE

Unfortunately, I am not a gamer, so all this exploration was just for fun. Hopefully, if your ISPs see this, they can take action to serve their gamer customers the highest quality internet service.

1 Like

I probably could have skipped the API calls :thinking: and just used Snowflake.

I could have used the IP_COMPANY UDTF to get the unique domain of those IPs. Store that in a CTE, then use those domains to get their IP address ranges. That would have been easier, I think.