Linux WHOIS3 Get carrier information
Apnic is the organization of IP address allocation in the Asia-Pacific region, it has a rich and accurate IP address allocation database, and this information is also public, and provides a query tool, let us see how to get some of the Chinese basic telecom operators (Netcom, telecommunications, CRC, Education Network) IP address distribution:
(We usually use WHOIS query is to know the domain name or IP check information, which is used to know the geographical area of bulk IP and its information)
Get the installation package
APNIC ripe-dbase-client-v3.tar.gz
Http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz
After decompression, you can open the Readme file
This is whois3, a very simple and generic whois client.
This client, unlike the "classic" whois client,
does not check for supported flags at the client side,
except for -h (whois host) and -p (whois port).
The syntax checks for flags are made at the server side.
The default host and port of whois3 is whois.ripe.net
at port 43 (or to be more exact, the tcp port specified
for whois in /etc/services). You can change the default host
by setting NICHOST in the source.
To compile and install, just type:
% ./configure [--prefix=your_prefix_dir]
% make
% make install
Type "configure --help" for generic help on how to use configure.
This client has been compiled and tested on a variety of systems;
please contact <ripe-[email protected].net> for comments and bug reports.
Execute the Compile and install command (native already Cygwin64 environment)
./configure
make
make install
Run command
Whois3-h whois.apnic.Net-L-i mb MAINT-Cncgroup|grep"Descr" |grep"Reverse" |awk-F"for" ' {if ($2!= ") print $ '|Sort-N|awk' begin{print ' ACL \ ' cnc\ '{' "} {print ";"} End{print "'}'; '} ' >Cnc_acl.conf
View Results
The results are as follows
% Information related to ‘202.111.151.80 - 202.111.151.87‘
inetnum: 202.111.151.80 - 202.111.151.87
netname: SMX-DEMO
descr: San men xia telecom bureau
descr: No.29 branch bureau for multimedia server demo,
descr: San men xia city, Henan Provice
descr: 20020826
country: CN
admin-c: LZ33-AP
tech-c: LZ33-AP
remarks: custmor
mnt-by: MAINT-CNCGROUP
changed: [email protected].online.ha.cn 19990430
status: ASSIGNED NON-PORTABLE
source: APNIC
person: Liping Zhong
address: Henan Multimedia Information Bureau
address: 70, Nong Ye Road
address: ZhengZhou, Henan 450002
address: CN
country: CN
phone: +86-371-3962276
fax-no: +86-371-3962068
e-mail: [email protected].zz.ha.cn
nic-hdl: LZ33-AP
mnt-by: MAINT-NULL
changed: [email protected].online.ha.cn 20001124
source: APNIC
From for notes (Wiz)
# Linux WHOIS3 Get carrier information