如何确定哪家公司的IP地址属于?哪家、地址、公司、IP

2023-09-03 06:58:50 作者:浅梦墨汐°

我想programmaticaly确定了公司*与给定的IP地址相关联。

I'm trying to programmaticaly determine the company* associated with a given IP address.

我的第一个猜测是这样的:

My first guess was this :

  string hostname = Dns.GetHostEntry(IPAddress.Parse(ip)).HostName;

但如果反向DNS设置不正确,这似乎发生90%的时间,这将无法正常工作。

but this won't work if the reverse DNS isn't set correctly, which seems to happen 90% of the time.

然而,一些网站仍然能够成功地确定与即使反向DNS失败特定IP相关的公司。例如,在本网站的ISP提供商领域有时包含有价值的信息(如公司名称),即使主机名不集。

However some websites are still able to successfully determine the company associated with a specific IP even if the reverse dns fails. For example, on this site, the ISP Provider field sometimes contains valuable information (ie the name of the company) even if the hostname isn't set.

什么是使用.NET来实现同样的事情,最简单的方法是什么?

What's the easiest way to achieve the same thing using .net ?

注:

在我并不需要一个规范名称。如微软或微软都ok了。 在我针对大公司,这很可能拥有自己的IP地址范围。 我在Windows上运行,所以UNIX的WHOIS查询工具并不是默认安装。

关于使用域名注册的编辑:有时,there's与IP 相关的whois信息

Edit regarding the use of whois : Sometimes, there's no whois information associated with an IP

推荐答案

您可以安装的的whois 命令行工具的Windows微软

You can install the whois command line tool for windows from microsoft

编辑:那么你在找什么样的信息

edit: then what information are you looking for ?

>whois bbc.co.uk
Domain name:
    bbc.co.uk

Registrant:
    British Broadcasting Corporation

Registrant type:
    UK Limited Company, (Company number: 000057)

Registrant's address:
    Research & Development
    Kingswood Warren
    Tadworth
    Surrey
    KT20 6NP
    United Kingdom

Registrar:
    British Broadcasting Corporation [Tag = BBC]