使用python-whois模块查询域名信息
2017-08-10 16:02
1906 查看
一,简介
通过域名注册信息,可以知道一个网站背后的公司信息,这个还是很厉害的,你用其他语言想查询这个,不好下手吧?Python直接提供了成熟的模块,就是这么锋利,它就是python-whois模块。
二,模块安装
在终端命令行执行pip install python-whois即可,注意需要使用root用户执行安装命令。
三,查询域名信息
利用whois模块的whois方法(有点绕口啊,其实有点类似Java里面Whois类的whois方法)可以直接查询域名信息,当然这是需要联网的哦。如下所示,查出了很多东西,可见看到有Beijing Sohu New Media Information Technology Co. Ltd,所以该域名应该是北京搜狐新媒体信息技术有限责任公司。(这个英语水平挺溜)
[root@localhost /]# python Python 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import whois >>> whois.whois("sohu.com") {u'updated_date': [datetime.datetime(2017, 7, 17, 13, 11, 19), datetime.datetime(2017, 7, 16, 21, 56, 57)], u'status': [u'clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited', u'clientTransferProhibited https://icann.org/epp#clientTransferProhibited', u'clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited', u'serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited', u'serverTransferProhibited https://icann.org/epp#serverTransferProhibited', u'serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited', u'clientUpdateProhibited (https://www.icann.org/epp#clientUpdateProhibited)', u'clientTransferProhibited (https://www.icann.org/epp#clientTransferProhibited)', u'clientDeleteProhibited (https://www.icann.org/epp#clientDeleteProhibited)', u'serverUpdateProhibited (https://www.icann.org/epp#serverUpdateProhibited)', u'serverTransferProhibited (https://www.icann.org/epp#serverTransferProhibited)', u'serverDeleteProhibited (https://www.icann.org/epp#serverDeleteProhibited)'], u'name': u'Domain Admin', u'dnssec': u'unsigned', u'city': u'Beijing', u'expiration_date': [datetime.datetime(2019, 7, 4, 4, 0), datetime.datetime(2019, 7, 3, 21, 0)], u'zipcode': u'100190', u'domain_name': [u'SOHU.COM', u'sohu.com'], u'country': u'CN', u'whois_server': u'whois.markmonitor.com', u'state': u'Beijing', u'registrar': u'MarkMonitor, Inc.', u'referral_url': None, u'address': u'No.2 Kexueyuan South Road, Haidian District', u'name_servers': [u'NS11.SOHU.COM', u'NS12.SOHU.COM', u'NS13.SOHU.COM', u'NS14.SOHU.COM', u'NS15.SOHU.COM', u'NS16.SOHU.COM', u'ns11.sohu.com', u'ns13.sohu.com', u'ns14.sohu.com', u'ns12.sohu.com', u'ns15.sohu.com', u'ns16.sohu.com'], u'org': u'Beijing Sohu New Media Information Technology Co. Ltd', u'creation_date': [datetime.datetime(1998, 7, 5, 4, 0), datetime.datetime(1998, 7, 4, 21, 0)], u'emails': [u'abusecomplaints@markmonitor.com', u'dnsadmin@sohu-inc.com']}
相关文章推荐
- linux java调用whois命令查询域名信息
- 域名Whois信息查询(ASP.NET+C#)
- python3实现域名查询和whois查询
- python3实现域名查询和whois查询
- 如何通过whois查询域名所有人的信息?
- python的mysql模块使用like查询
- python3实现域名查询和whois查询
- python使用在线API查询IP对应的地理位置信息实例
- 使用Python改写的身份证信息查询小程序
- ASP.NET域名查询系统源代码,域名Whois查询,(.Com/.Net/.Org/.Cn),c#语言实现域名Whois信息查询
- Python网络编程小例子:使用python获取网站域名信息
- 域名信息及使用查询
- (python)域名查询服务(whois)程序+检查5位以内域名到期时间邮件报警抢注域名
- python使用urllib模块和pyquery实现阿里巴巴排名查询
- python3实现域名查询和whois查询功能
- python3实现域名查询和whois查询
- python3实现域名查询和whois查询
- 如何查看域名的历史使用记录,以前注册信息,whois,是否有被K记录
- Asp.Net中查询域名的Whois信息
- 域名Whois信息查询(ASP.NET+C#)