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. 使用firbug调试程序写更高质量的代码设置方法

    在搜狐浏览器内输入about:config 在搜索栏中输入:strict 双击javascript.options.strict,将值变为true

  2. 关于json和字符串之间的转换

    在最近的工作中,使用到JSON进行数据的传递,特别是从前端传递到后台,前台可以直接采用ajax的data函数,按json格式传递,后台Request即可,但有的时候,需要传递多个参数,后台使用requ ...

  3. docker命令和后台参数

    Docker官方为了让用户快速了解Docker,提供了一个 交互式教程 ,旨在帮助用户掌握Docker命令行的使用方法. Docker 命令行 下面对Docker的命令清单进行简单的介绍,详细内容在后 ...

  4. python--函数式登录程序

    # Author:Tim Gu def login(username,password): """这个login函数用于用户登录的验证 :param username:用 ...

  5. sql server 查询出的结果集,拼接某一列赋值给一个变量

    现有表Area 如下: SELECT [Areaid] ,[Areaname] ,[Areapid] FROM [Northwind].[dbo].[Area] 查询结果如下图: 需求:用 “-“ ” ...

  6. python修炼7----迭代器

    迭代器 -------------------------------------------------------------------------------- 充电小知识 1.yield-- ...

  7. C++实现中缀表达式转前、后缀

    #include<iostream> #include<string> #include<stack> using namespace std; bool isIn ...

  8. IDEA Mybatis 找不到映射器xml文件

    用IDEA新建了一个测试MyBatis工程,工程目录如下 其中config是MyBatis的配置文件,内容如下 <?xml version="1.0" encoding=&q ...

  9. 给hexo添加评论系统

    默认主题 landscape 文件目录,comments为新建的 _config.yml layout -- _partial -- article.ejs |- comments -- disqus ...

  10. WITH common_table_expression

    Feature: 公用表表达式只能包含一个SELECT,多SELECT需UNION,UNION ALL 公用表表达式只能引用一次 公用表表达式可以包括对自身的引用,这种表达式称为递归公用表表达式 -- ...