通过IP地址确定公司名称 [英] Determining company name from IP address
问题描述
我为这个广泛的问题表示歉意.但是我有一个IP地址列表,并希望将它们连接到它们来自的公司.
I apologize for the broad question. But I have a list of IP addresses, and would like to connect them to the companies they came from.
我对识别个人IP地址信息不感兴趣(可能甚至不可能),但我认为必须有一种方法来识别IP地址是否与大公司关联.
I'm not interested in identifying personal IP address information (probably not even possible) but I figure there must be a way to identify if the IP address is associated with a large corporation.
Whois.net通常仅提供ISP名称,而不提供公司名称.
Whois.net usually only gives the ISP name, not the company name.
谢谢
推荐答案
http://ipinfo.io API(我自己的服务)返回公司名称作为org字段:
The http://ipinfo.io API (my own service) returns the company name as the org field:
$ curl http://ipinfo.io/198.252.206.16
{
"ip": "198.252.206.16",
"hostname": "stackoverflow.com",
"city": null,
"region": null,
"country": "US",
"loc": "38.0000,-97.0000",
"org": "AS25791 Stack Exchange, Inc."
}
您可以通过在URL中添加/org来获取该字段:
You can get just that field by adding /org to the URL:
$ curl http://ipinfo.io/198.252.206.16/org
AS25791 Stack Exchange, Inc.
您可以将其与其他一些命令结合使用以对所有IP进行批量查找,并查看它们所属的公司:
You can combine this with some other commands to do a bulk lookup of all of your IPs and see what company they belong to:
$ cat ips.txt | xargs -I% curl -s http://ipinfo.io/%/org | paste ips.txt -
198.252.206.16 AS25791 Stack Exchange, Inc.
173.252.110.27 AS32934 Facebook, Inc.
74.125.239.132 AS15169 Google Inc.
206.190.36.45 AS36647 Yahoo
您可以在 http://ipinfo.io/developers 上找到有关该API的更多详细信息.
You can find out more details about the API at http://ipinfo.io/developers.
这篇关于通过IP地址确定公司名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!