如何取得和归类中国大陆ip地址列表

IP地址块被IANA(Internet Assigned Numbers Authority)分配给全球三大地区性IP地址分配机构,它们分别是:

 
1、ARIN(American Registry for Internet Numbers)
负责北美、南美、加勒比以及非洲撒哈啦部分的IP地址分配。同时还要给全球NSP(Network Service Providers)分配地址。
 
2、RIPE(Reseaux IP Europeens)
负责欧洲、中东、北非、西亚部分地区(前苏联)
 
3、APNIC(Asia Pacific Network Information Center)
负责亚洲、太平洋地区 

APNIC是管理亚太地区IP地址分配的机构,它有着丰富准确的IP地址分配库,同时这些信息也是对外公开的。

我们知道,亚太地区的ip地址由APNIC--亚太互联网络信息中心 (Asia-Pacific Network Information Centre,APNIC(http://www.apnic.net)分配,通过访问APNIC官方站点,可以知道在何处得到ip地址分配的有用信息。http://www.apnic.net/publications/research-and-insights/stats。

见如下原文:APNIC collects statistics on Internet resource distribution, much of which is displayed graphically via Apstats, the live statistics portal. These reports are publicly available for use in research and analysis and allow you to analyse IP addressing trends at their origin. You can also refer to the APNIC FTP site for any raw data.

点击原文中的FTP链接,进入ftp://ftp.apnic.net/public/stats/apnic/  里面的资源都是亚太地区的所有IP列表(包括以往的),通过查看README.TXT文件,我们了解到:最新的IP资源列表的文件是:delegated-apnic-latest

见如下原文:The most recent file will also be available under the name: delegated-apnic-latest

下载http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest文件,除去注释行,我们将看见形如下文本行,过滤一下就可以区分中国大陆(第2个字段为“CN”)单独提取出来

 

  1. "apnic|NP|ipv4|14.128.12.0|1024|20100915|allocated"。 

配合脚本可以形成如下格式,详细脚本请站内消息联系博主询问。

  1. 221.14.0.0/15 
  2. 221.122.0.0/15 
  3. 221.128.128.0/17 
  4. 221.129.0.0/16 
  5. 221.130.0.0/15 
  6. 221.133.224.0/19 
  7. 221.136.0.0/16 
  8. ..... 
 

得到IP列表以后我们可以通过whois工具来进行查询IP具体信息

 

 

 

IP地址块被IANA(Internet Assigned Numbers Authority)分配给全球三大地区性IP地址分配机构,它们分别是:
 
1、ARIN(American Registry for Internet Numbers)
负责北美、南美、加勒比以及非洲撒哈啦部分的IP地址分配。同时还要给全球NSP(Network Service Providers)分配地址。
 
2、RIPE(Reseaux IP Europeens)
负责欧洲、中东、北非、西亚部分地区(前苏联)
 
3、APNIC(Asia Pacific Network Information Center)
负责亚洲、太平洋地区
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章