如何从 WHOIS 服务器获取国家/地区 IP 地址范围列表?

发布于 2024-08-30 22:58:21 字数 134 浏览 6 评论 0原文

我想从 IANA 的 whois 服务器获取所有国家/地区的 IP 地址范围,而不是从 maxmind 或 ip2location 站点获取。 IANA 是真实的网站,因此我想从该网站获取国家/地区的所有 IP 地址范围。可以这样查询WHOIS服务器吗?

I want to get all countries ip addresses range from IANA's whois server, Not from maxmind or ip2location site. IANA is authentic site hence I would like to get all ipaddress ranges for countries from that site. Is it possible to query the WHOIS server such a way??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

扬花落满肩 2024-09-06 22:58:21

不可能直接获取分配给任何国家的 IP 地址。
IP 号码分配给地区互联网注册机构。

其中有 5 个,ARIN、APNIC、AFRINIC、LACNIC、RIPE

,这些 RIR 将 IP 范围分配给一个国家/地区的 ISP。

通过对 IP 进行 whois 查询,您可以找出该 IP 分配给了哪个 RIR。 whois 响应还将包含 IP 地址的国家/地区和 ISP。

基本上,您需要对所有 IP 范围进行 whois 查询并聚合数据并形成数据库。这样的数据库可用于提供属于某个国家的所有 IP 地址。

Its not possible to directly get the ip addresses allotted to any country like that.
IP numbers are allocated to regional internet registries.

There are 5 of them , ARIN , APNIC , AFRINIC , LACNIC , RIPE

And again , these RIR allot ip ranges to ISPs of a country.

By doing a whois query for an ip you can find out which RIR is the IP allocated to. The whois response will also contain the country and ISP of the ip address.

Basically you need to whois-query all ip ranges and aggregate the data and form a database. Such a database can be then used to provide all ip addresses belonging to a certain country.

凉世弥音 2024-09-06 22:58:21

IANA 没有此信息,因此无法从他们那里获取此信息。

IANA 只将大IP 前缀分配给RIR(区域互联网注册管理机构)。例如 31.0.0.0/8 刚刚被分配给 RIPE-NCC (顺便说一下,少了一个IPv4 前缀,是时候启用 IPv6(如果尚未启用),覆盖整个欧洲和中东的大部分地区。因此,这些地址可能会流向爱尔兰、约旦或希腊,但您无法从 IANA 分配中辨别出来。即使 RIR whois(RIPE-NCC 的 whois.ripe.net)也不会告诉您足够的详细信息,因为前缀可能会分配给跨国 IAP(互联网接入提供商)。

IANA does not have this information so, no, there is no way to get it from them.

IANA only allocates big IP prefixes to RIR (Regional Internet Registries). For instance 31.0.0.0/8 has just been allocated to the RIPE-NCC (by the way, one less IPv4 prefix, time to enable IPv6 if it is not already done), which covers all Europe and a good part of the Middle East. So, these adresses may go to Ireland, Jordan or Greece and you cannot tell it from IANA allocations. Even the RIR whois (whois.ripe.net for the RIPE-NCC) won't tell you with enough details because a prefix may be assigned to a multinational IAP (Internet Access Provider).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文