Python construction whois Request __python

Source: Internet
Author: User

The WHOIS message request is no longer simple:

From socket import *

HOST = ' 202.12.29.220 '
PORT =
Bufsiz = 1024
ADDR = (HOST, PORT)
eof= "\ r \ n" 
  
   request_ip= "219.146.3.110"


data_send=request_ip+eof
tcpclisock = socket (af_inet, sock_stream)
Tcpclisock.connect (ADDR)
tcpclisock.send (data_send) while


True: 
    DATA_RCV = Tcpclisock.recv (bufsiz)
    if not Len (DATA_RCV):
        break  
    print DATA_RCV

tcpclisock.close ()


  



Output results:


>>>
% [Whois.apnic.net]
% Whois Data Copyright Terms http://www.apnic.net/db/dbcopyright.html




% information related to ' 219.146.0.0-219.147.31.255 '


inetnum:219.146.0.0-219.147.31.255
Netname:chinanet-sd
descr:chinanet Shandong Province Network
Descr:shandong Telecom Corporation
Descr:no.999,shunhua Road,jinan,shandong
Country:cn
Admin-c: Xr55-ap
Tech-c: Xr55-ap
Status:allocated non-portable
Changed:ipadmin@north.cn.net 20060515
Mnt-by:maint-chinanet
Mnt-lower:maint-chinanet-sd
Mnt-routes:maint-chinanet-sd
Source:apnic


Person:xin Ruosheng
Nic-hdl:xr55-ap
E-mail:ipreport@sdtele.com
address:no.999, Road Shunhua, Jinan, Shandong Province,china
Phone: +86-531-83190000
Fax-no: +86-531-83190000
Country:cn
Changed:ipreport@sdtele.com 20060905
Mnt-by:maint-chinanet-sd
Source:apnic


% This query is served by the APNIC Whois Service version 1.69.1-apnicv1r0 (WHOIS4)




>>>


Written on January 27, 2014. All rights reserved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.