Linux Whois3获取 运营商信息

APNIC是管理亚太地区IP地址分配的机构,它有着丰富准确的IP地址分配库,同时这些信息也是对外公开的,并提供了一个查询工具,下面就让我们看看如何在Linux下获得一些中国基础电信运营商(网通、电信、铁通、教育网)的IP地址分配情况:

(我们平时用whois查询是知道域名或IP查信息, 这里用的是知道地理区域批量查IP及其信息)

获取安装包

APNIC ripe-dbase-client-v3.tar.gz

http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz

解压缩后,可以打开README文件

  1. This is whois3, a very simple and generic whois client.
  2. This client, unlike the "classic" whois client,
  3. does not check for supported flags at the client side,
  4. except for -h (whois host) and -p (whois port).
  5. The syntax checks for flags are made at the server side.
  6. The default host and port of whois3 is whois.ripe.net
  7. at port 43 (or to be more exact, the tcp port specified
  8. for whois in /etc/services). You can change the default host
  9. by setting NICHOST in the source.
  10. To compile and install, just type:
  11. % ./configure [--prefix=your_prefix_dir]
  12. % make
  13. % make install
  14. Type "configure --help" for generic help on how to use configure.
  15. This client has been compiled and tested on a variety of systems;
  16. please contact <ripe-dbm@ripe.net> for comments and bug reports.

执行编译安装命令 (本机已有 Cygwin64环境 )

  1. ./configure
  2. make
  3. make install

运行命令

  1. whois3 -h whois.apnic.net -l -i mb MAINT-CNCGROUP | grep "descr" | grep "Reverse" | awk -F "for" '{if ($2!="") print $2}'| sort -n | awk 'BEGIN{print "acl \"CNC\" '{'"}{print $1";"}END{print "'}';"}' > cnc_acl.conf

查看结果

结果如下

  1. % Information related to '202.111.151.80 - 202.111.151.87'
  2. inetnum: 202.111.151.80 - 202.111.151.87
  3. netname: SMX-DEMO
  4. descr: San men xia telecom bureau
  5. descr: No.29 branch bureau for multimedia server demo,
  6. descr: San men xia city, Henan Provice
  7. descr: 20020826
  8. country: CN
  9. admin-c: LZ33-AP
  10. tech-c: LZ33-AP
  11. remarks: custmor
  12. mnt-by: MAINT-CNCGROUP
  13. changed: zhonglp@email.online.ha.cn 19990430
  14. status: ASSIGNED NON-PORTABLE
  15. source: APNIC
  16. person: Liping Zhong
  17. address: Henan Multimedia Information Bureau
  18. address: 70, Nong Ye Road
  19. address: ZhengZhou, Henan 450002
  20. address: CN
  21. country: CN
  22. phone: +86-371-3962276
  23. fax-no: +86-371-3962068
  24. e-mail: antispam@public.zz.ha.cn
  25. nic-hdl: LZ33-AP
  26. mnt-by: MAINT-NULL
  27. changed: zhail@email.online.ha.cn 20001124
  28. source: APNIC

# Linux Whois3获取 运营商信息的更多相关文章

  1. Android 获取运营商信息(完整版)-解决高通,MTK等双卡问题

    由于国内的运营商问题,双卡手机获取IMSI号问题要根据厂商API 来实现. 下面我们就来做一套完整的分析运营商获取IMSI号逻辑. 1,首先我们要判断手机的平台. 1.1,判断手机是否MTK平台 1 ...

  2. iOS获取运营商的相关信息

    1.导入:CoreTelephony.framework 2.添加头文件 #import <CoreTelephony/CTTelephonyNetworkInfo.h> #import ...

  3. MTK Android 读取SIM卡参数,获取sim卡运营商信息

    android 获取sim卡运营商信息(转)   TelephonyManager tm = (TelephonyManager)Context.getSystemService(Context.TE ...

  4. Android系统分析之运营商显示流程分析之运营商信息的读取流程二

    运营商显示流程分析之运营商信息的读取流程 一. SIM卡运营商信息的读取 从前面的 运营商信息的获取和赋值 可以知道SIM卡运营商的赋值最终是在 SIMRecords 中完成的, 而SIM卡信息的相关 ...

  5. .net core在Linux下获取AD域信息

    .net core在Linux下获取AD域信息 .net Core 2.1.4 .net core现在System.DirectoryServices只支持Windows平台下使用. 参考: http ...

  6. PHP--根据手机号-淘宝平台获取归属地运营商信息

    //获取手机账号信息 public function get_mobile_area($mobile){ $sms = array('province'=>'', 'supplier'=> ...

  7. Linux sysinfo获取系统相关信息

    Linux中,可以用sysinfo来获取系统相关信息. #include <stdio.h> #include <stdlib.h> #include <errno.h& ...

  8. Python查找电话号码归属地、邮编、运营商信息等

    # -*- coding: utf-8 -*- 1. 查找单个电话号码 from phone import Phone def get_phone_info(phone_num): phone_inf ...

  9. github开源的一些ip解析 ,运营商信息,经纬度 地址 后续开发使用

    https://github.com/wzhe06/ipdatabase  ip解析 https://github.com/flyaction/ipdatabase 比较新 https://githu ...

随机推荐

  1. 精通javasCRIPT-学习笔记 Features,Functions,Object

    关于学习javasCRIPT的书,市面上太多了,有犀牛书,红宝书,但是他们都类似于一本书,包含js的一切,并没有站在一个高度上,看js的本质,我计划看一看jquery作者resig写的<精通ja ...

  2. HDU 4442 Physical Examination(贪心)

    HDU 4442 Physical Examination(贪心) 题目链接http://acm.split.hdu.edu.cn/showproblem.php?pid=4442 Descripti ...

  3. Windows下怎么搭建Python+Selenium的自动化环境

    http://jingyan.baidu.com/article/47a29f244aec6bc014239985.html 注意点:配置了环境变量后需要重启电脑

  4. Intent的几种Flag的不同

    冬天有点冷,不想写博客. 研究下Intent的几种Flag的不同: 1,FLAG_ACTIVITY_CLEAR_TOP:会清理掉目标activity栈上面所有的activity Intent inte ...

  5. HDU 1335 Basically Speaking(进制转换)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1335 Problem Description The Really Neato Calculator ...

  6. 【Sort】Merge Sort归并排序

    归并排序运行时间O(N log N),但是由于需要线性附加内存,所以很少用于主存排序. 算法核心在于以下三条语句,分治递归,分别对左半边和右半边的数组进行排序,然后把左右半边的数组一一进行比较放入数组 ...

  7. 【瞎搞搞之】 window_x64微信小程序环境搭建

    所需文件地址如下: http://pan.baidu.com/s/1nv0IHhn(ylk7)   1.下载微信开发工具0.7.0_x64 安装完成后,打开程序,进行微信扫码登录 2.下载微信开发工具 ...

  8. ggplot2 geom相关设置—分布图

    分布在R中应该算是个比较重要的内容,而通过画图来展示数据的分布,可以更直观的让我们了解数据的分布情况 直方图 geom_histogram(mapping = NULL, data = NULL, s ...

  9. Java JVM 多态(动态绑定)

    Java JVM 多态(动态绑定) @author ixenos 摘要:绑定.动态绑定实现多态.多态的缺陷.纯继承与扩展接口.向下转型与RTTI 绑定 将一个方法的调用和一个方法的主体关联起来,称作( ...

  10. LeetCode OJ 42. Trapping Rain Water

    Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...