首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python Whois问题

Python Whois问题
EN

Stack Overflow用户
提问于 2019-04-17 02:18:31
回答 1查看 313关注 0票数 2

我正在尝试通过bash中的谁来收集有关IP的信息。然而,我得到的输出似乎非常不同,例如……

如果我去http://whois.domaintools.com/8.8.8.8,我会得到大量的信息。就像这样,

代码语言:javascript
复制
NetRange:       8.0.0.0 - 8.127.255.255
CIDR:           8.0.0.0/9
NetName:        LVLT-ORG-8-8
NetHandle:      NET-8-0-0-0-1
Parent:         NET8 (NET-8-0-0-0-0)
NetType:        Direct Allocation
OriginAS:       
Organization:   Level 3 Parent, LLC (LPL-141)
RegDate:        1992-12-01
Updated:        2018-04-23
Ref:            https://rdap.arin.net/registry/ip/8.0.0.0

OrgName:        Level 3 Parent, LLC
OrgId:          LPL-141
Address:        100 CenturyLink Drive
City:           Monroe
StateProv:      LA
PostalCode:     71203
Country:        US
RegDate:        2018-02-06
Updated:        2018-02-22
Ref:            https://rdap.arin.net/registry/entity/LPL-141

OrgTechHandle: IPADD5-ARIN
OrgTechName:   ipaddressing
OrgTechPhone:  +1-877-453-8353 
OrgTechEmail:  
OrgTechRef:    https://rdap.arin.net/registry/entity/IPADD5-ARIN

OrgAbuseHandle: IPADD5-ARIN
OrgAbuseName:   ipaddressing
OrgAbusePhone:  +1-877-453-8353 
OrgAbuseEmail:  
OrgAbuseRef:    https://rdap.arin.net/registry/entity/IPADD5-ARIN

NetRange:       8.8.8.0 - 8.8.8.255
CIDR:           8.8.8.0/24
NetName:        LVLT-GOGL-8-8-8
NetHandle:      NET-8-8-8-0-1
Parent:         LVLT-ORG-8-8 (NET-8-0-0-0-1)
NetType:        Reallocated
OriginAS:       
Organization:   Google LLC (GOGL)
RegDate:        2014-03-14
Updated:        2014-03-14
Ref:            https://rdap.arin.net/registry/ip/8.8.8.0

OrgName:        Google LLC
OrgId:          GOGL
Address:        1600 Amphitheatre Parkway
City:           Mountain View
StateProv:      CA
PostalCode:     94043
Country:        US
RegDate:        2000-03-30
Updated:        2018-10-24
Comment:        Please note that the recommended way to file abuse complaints are located in 
the following links. 
Comment:        
Comment:        To report abuse and illegal activity: https://www.google.com/contact/
Comment:        
Comment:        For legal requests: http://support.google.com/legal 
Comment:        
Comment:        Regards, 
Comment:        The Google Team
Ref:            https://rdap.arin.net/registry/entity/GOGL

OrgTechHandle: ZG39-ARIN
OrgTechName:   Google LLC
OrgTechPhone:  +1-650-253-0000 
OrgTechEmail:  
OrgTechRef:    https://rdap.arin.net/registry/entity/ZG39-ARIN

OrgAbuseHandle: ABUSE5250-ARIN
OrgAbuseName:   Abuse
OrgAbusePhone:  +1-650-253-0000 
OrgAbuseEmail:  
OrgAbuseRef:    https://rdap.arin.net/registry/entity/ABUSE5250-ARIN

然而,如果我运行whois 8.8.8.8,我就会得到:

代码语言:javascript
复制
 whois 8.8.8.8
[Querying whois.arin.net]
[whois.arin.net]

#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/resources/registry/whois/tou/
#
# If you see inaccuracies in the results, please report at
# https://www.arin.net/resources/registry/whois/inaccuracy_reporting/
#
# Copyright 1997-2019, American Registry for Internet Numbers, Ltd.
#


#
# Query terms are ambiguous.  The query is assumed to be:
#     "n 8.8.8.8"
#
# Use "?" to get help.
#

Level 3 Parent, LLC LVLT-ORG-8-8 (NET-8-0-0-0-1) 8.0.0.0 - 8.127.255.255
Google LLC LVLT-GOGL-8-8-8 (NET-8-8-8-0-1) 8.8.8.0 - 8.8.8.255

如何从whois CLI获取此级别的信息?

EN

回答 1

Stack Overflow用户

发布于 2019-04-18 08:05:29

你可以在你自己的帖子中找到答案:

代码语言:javascript
复制
# Query terms are ambiguous.  The query is assumed to be:
#     "n 8.8.8.8"

...

Level 3 Parent, LLC LVLT-ORG-8-8 (NET-8-0-0-0-1) 8.0.0.0 - 8.127.255.255
Google LLC LVLT-GOGL-8-8-8 (NET-8-8-8-0-1) 8.8.8.0 - 8.8.8.255

最后两行显示,在ARIN注册了两个块,涵盖了8.8.8.8,您通过消息开头使用的提供程序获得的两个数据块是这两个块的详细信息。或者在你的情况下:

代码语言:javascript
复制
whois -h whois.arin.net NET-8-0-0-0-1

代码语言:javascript
复制
whois -h whois.arin.net NET-8-8-8-0-1

或者咨询ARIN的whois中的whois -h whois.arin.net -- '-h',它将向您展示各种内容

n网络地址空间

  • FULL输出显示每个match

的详细显示

所以,如果你这样做了:

代码语言:javascript
复制
whois -h whois.arin.net -- 'n + 8.8.8.8'

您将得到与第一个示例基本相同的输出。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55714354

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档