# Linux Whois3获取 运营商信息

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-[email protected].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: [email protected].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: [email protected].zz.ha.cn
  25. nic-hdl: LZ33-AP
  26. mnt-by: MAINT-NULL
  27. changed: [email protected].online.ha.cn 20001124
  28. source: APNIC

来自为知笔记(Wiz)

时间: 2024-10-05 05:08:15

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

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

由于国内的运营商问题,双卡手机获取IMSI号问题要根据厂商API 来实现. 下面我们就来做一套完整的分析运营商获取IMSI号逻辑. 1,首先我们要判断手机的平台. 1.1,判断手机是否MTK平台 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 public static M

Android获取运营商信息

项目上要求做三网外放产品,将三个单网SDK自行整合成三网联合,思路大概是在OnCreate时区分运营商 设定枚举,根据取到的sim卡信息赋予枚举变量,后面三网的一些操作根据枚举进行判定 先设定运营商枚举 enum CARRIEROPERATOR { NONE(0), MM(1), UNIPAY(2), EGAME(3); private int value; private CARRIEROPERATOR(int i) { this.value=i; } public int getValue(

iOS获取运营商的相关信息

1.导入:CoreTelephony.framework 2.添加头文件 #import <CoreTelephony/CTTelephonyNetworkInfo.h> #import <CoreTelephony/CTCarrier.h> 3.获取网络环境 -(void)networktype{ NSArray *subviews = [[[[UIApplication sharedApplication] valueForKey:@"statusBar"]

ios获取手机状态 idfa &nbsp; idfv &nbsp; 网络类型 &nbsp; 分辨率 &nbsp; 获取运营商

//idfa [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; //idfv [[[UIDevice currentDevice] identifierForVendor] UUIDString]; //网络类型 - (NSString *) getNet { UIApplication *application = [UIApplication sharedApplication]; NSArra

android 获取sim卡运营商信息(转)

TelephonyManager tm = (TelephonyManager)Context.getSystemService(Context.TELEPHONY_SERVICE); 注意:一些电话信息需要相应的权限. // 获取服务提供商名字,比如电信,联通,移动用下面的方法第一种方法: 获取手机的IMSI码,并判断是中国移动\中国联通\中国电信 getSimOperatorName() //Returns the Service Provider Name (SPN). IMSI 国际移动

Linux sysinfo获取系统相关信息

Linux中,可以用sysinfo来获取系统相关信息. #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <linux/unistd.h> /* for _syscallX macros/related stuff */ #include <linux/kernel.h> /* for struct sysinfo */ //_syscall1(int, sysi

Linux C 获取系统时间信息

比如获取当前年份:               /* 获取当前系统时间 暂时不使用 int iyear = 0; int sysyear = 0; time_t now; struct tm *timenow; time(&now); timenow = localtime(&now); sysyear = timenow->tm_year+1900; */ linux下获取系统时间的方法 可以用 localtime 函数分别获取年月日时分秒的数值. Linux下获得系统时间的C语言

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

# -*- coding: utf-8 -*- 1. 查找单个电话号码 from phone import Phone def get_phone_info(phone_num): phone_info = Phone().find(phone_num) try: phone = phone_info['phone'] province = phone_info['province'] #省 city = phone_info['city'] #城市 zip_code = phone_info[

android判断网络连接状态、联网类型、运营商

/** * 获取上网方式 * * @param mContext * @return */ public static String getNetType(Context mContext) { String netType = ""; ConnectivityManager connectionManager = (ConnectivityManager) mContext .getSystemService(Context.CONNECTIVITY_SERVICE); Networ