[python] whois 모듈

python 2018. 9. 3. 14:24


python의 whois 모듈을 사용하면 whois 웹 검색과 동일한 결과를 얻을 수 있다..




$ pip install python-whois



$ python

Python 3.7.0 (default, Sep  3 2018, 12:00:39)

[Clang 7.3.0 (clang-703.0.31)] on darwin

Type "help", "copyright", "credits" or "license" for more information.




>>> import whois

>>> print(whois.whois('appspot.com'))


{

  "domain_name": [

    "APPSPOT.COM",

    "appspot.com"

  ],

  "registrar": "MarkMonitor, Inc.",

  "whois_server": "whois.markmonitor.com",

  "referral_url": null,

  "updated_date": [

    "2018-02-06 10:30:28",

    "2018-02-06 02:30:29-08:00"

  ],

  "creation_date": [

    "2005-03-10 02:27:55",

    "2005-03-09 18:27:55-08:00"

  ],

  "expiration_date": [

    "2019-03-10 01:27:55",

    "2019-03-09 00:00:00-08:00"

  ],

  "name_servers": [

    "NS1.GOOGLE.COM",

    "NS2.GOOGLE.COM",

    "NS3.GOOGLE.COM",

    "NS4.GOOGLE.COM",

    "ns1.google.com",

    "ns2.google.com",

    "ns4.google.com",

    "ns3.google.com"

  ],

  "status": [

    "clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited",

    "clientTransferProhibited https://icann.org/epp#clientTransferProhibited",

    "clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited",

    "serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited",

    "serverTransferProhibited https://icann.org/epp#serverTransferProhibited",

    "serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited",

    "clientUpdateProhibited (https://www.icann.org/epp#clientUpdateProhibited)",

    "clientTransferProhibited (https://www.icann.org/epp#clientTransferProhibited)",

    "clientDeleteProhibited (https://www.icann.org/epp#clientDeleteProhibited)",

    "serverUpdateProhibited (https://www.icann.org/epp#serverUpdateProhibited)",

    "serverTransferProhibited (https://www.icann.org/epp#serverTransferProhibited)",

    "serverDeleteProhibited (https://www.icann.org/epp#serverDeleteProhibited)"

  ],

  "emails": [

    "abusecomplaints@markmonitor.com",

    "whoisrelay@markmonitor.com"

  ],

  "dnssec": "unsigned",

  "name": null,

  "org": "Google LLC",

  "address": null,

  "city": null,

  "state": "CA",

  "zipcode": null,

  "country": "US"

}

>>> print(whois.whois('naver.com'))

{

  "domain_name": [

    "NAVER.COM",

    "naver.com"

  ],

  "registrar": "Gabia, Inc.",

  "whois_server": "whois.gabia.com",

  "referral_url": null,

  "updated_date": [

    "2016-08-05 06:37:57",

    "2018-02-28 11:27:15"

  ],

  "creation_date": [

    "1997-09-12 04:00:00",

    "1997-09-12 00:00:00"

  ],

  "expiration_date": [

    "2023-09-11 04:00:00",

    "2023-09-11 00:00:00"

  ],

  "name_servers": [

    "NS1.NAVER.COM",

    "NS2.NAVER.COM",

    "ns1.naver.com",

    "ns2.naver.com"

  ],

  "status": [

    "clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited",

    "clientTransferProhibited https://icann.org/epp#clientTransferProhibited",

    "clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited",

    "ok https://icann.org/epp#ok"

  ],

  "emails": [

    "white.4818@navercorp.com",

    "dl_ssl@navercorp.com",

    "abuse@gabia.com"

  ],

  "dnssec": "unsigned",

  "name": "NAVER Corp.",

  "org": "NAVER Corp.",

  "address": "6 Buljung-ro, Bundang-gu, Seongnam-si, Gyeonggi-do, 463-867, Korea",

  "city": "Gyeonggi",

  "state": null,

  "zipcode": "463463",

  "country": "KR"

}

>>> print(whois.whois('abc.com'))

{

  "domain_name": [

    "ABC.COM",

    "abc.com"

  ],

  "registrar": "CSC CORPORATE DOMAINS, INC.",

  "whois_server": "whois.corporatedomains.com",

  "referral_url": null,

  "updated_date": [

    "2018-08-08 23:38:25",

    "2018-08-08 17:11:02"

  ],

  "creation_date": "1996-05-22 04:00:00",

  "expiration_date": "2019-05-23 04:00:00",

  "name_servers": [

    "ORNS01.DIG.COM",

    "ORNS02.DIG.COM",

    "SENS01.DIG.COM",

    "SENS02.DIG.COM",

    "orns02.dig.com",

    "orns01.dig.com",

    "sens02.dig.com",

    "sens01.dig.com"

  ],

  "status": [

    "clientTransferProhibited https://icann.org/epp#clientTransferProhibited",

    "serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited",

    "serverTransferProhibited https://icann.org/epp#serverTransferProhibited",

    "serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited",

    "clientTransferProhibited http://www.icann.org/epp#clientTransferProhibited",

    "serverDeleteProhibited http://www.icann.org/epp#serverDeleteProhibited",

    "serverTransferProhibited http://www.icann.org/epp#serverTransferProhibited"

  ],

  "emails": [

    "domainabuse@cscglobal.com",

    "Corp.DNS.Domains@disney.com"

  ],

  "dnssec": "unsigned",

  "name": "ABC, Inc.; Domain Administrator",

  "org": "ABC, Inc.",

  "address": "77 West 66th Street",

  "city": "New York",

  "state": "NY",

  "zipcode": "10023-6298",

  "country": "US"

}



Posted by '김용환'
,