Sometimes some of the projects and applications across the network, need to be as accurate as possible to know telecommunications, Netcom, railcom and other telecommunications operators IP address segment distribution, can be online information is not only very small, and often are n months ago, outdated information ...
APNIC is the organization that manages IP address assignment in Asia-Pacific region, which has a rich and accurate IP address allocation library, and this information is also open to the outside world! Let's take a look at how to get some telecom operators ' IP address distribution under Linux:
shell> wget http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz
Shell> Tar xzvf ripe-dbase-client-v3.tar.gz
Shell> CD whois-3.1
Shell>./configure
Shell> make
After completing the above compilation and installation work, we begin to obtain the IP address segment;
China Netcom:
shell>/whois3-h whois.apnic.net-l-i mb maint-cncgroup >/VAR/CN C
Telecom:
shell>/whois3-h whois.apnic.net-l-i mb maint-chinanet >/var/chinanet
China railcom:
shell>/whois3-h whois.apnic.net-l-i mb MAINT-CN-CRTC >/VAR/CRTC
Open the acquired file can see the information inside very detailed, and even see the various branches of the owner, phone, e-mail and so on information. If you want a neat, clean IP address segment file, just use grep and awk to simply filter it.