首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何限制whois命令的输出?

如何限制whois命令的输出?
EN

Server Fault用户
提问于 2012-09-14 11:45:09
回答 2查看 10.3K关注 0票数 3

如何从PTR查找中只获得所有者/组织名称?我不需要所有其他的实体,只是关于所有权的部分(谷歌在本例中)。

Edit /usr/bin/whois 74.125.236.52或任何ip get OrgName

代码语言:javascript
复制
  #
  # Query terms are ambiguous.  The query is assumed to be:
  #     "n 74.125.236.52"
  #
  # Use "?" to get help.
  #

  #
  # The following results may also be obtained via:
  # http://whois.arin.net/rest/nets;q=74.125.236.52?showDetails=true&showARIN=false&ext=netref2
  #

  NetRange:       74.125.0.0 - 74.125.255.255
  CIDR:           74.125.0.0/16
  OriginAS:
  NetName:        GOOGLE
  NetHandle:      NET-74-125-0-0-1
  Parent:         NET-74-0-0-0-0
  NetType:        Direct Allocation
  RegDate:        2007-03-13
  Updated:        2012-02-24
  Ref:            http://whois.arin.net/rest/net/NET-74-125-0-0-1


  OrgName:        Google Inc.
  OrgId:          GOGL
  Address:        1600 Amphitheatre Parkway
  City:           Mountain View
  StateProv:      CA
  PostalCode:     94043
  Country:        US
  RegDate:        2000-03-30
  Updated:        2011-09-24
  Ref:            http://whois.arin.net/rest/org/GOGL

  OrgAbuseHandle: ZG39-ARIN
  OrgAbuseName:   Google Inc
  OrgAbusePhone:  +1-650-253-0000
  OrgAbuseEmail:  arin-contact@google.com
  OrgAbuseRef:    http://whois.arin.net/rest/poc/ZG39-ARIN

  OrgTechHandle: ZG39-ARIN
  OrgTechName:   Google Inc
  OrgTechPhone:  +1-650-253-0000
  OrgTechEmail:  arin-contact@google.com
  OrgTechRef:    http://whois.arin.net/rest/poc/ZG39-ARIN

  #
  # ARIN WHOIS data and services are subject to the Terms of Use
  # available at: https://www.arin.net/whois_tou.html
  #
EN

回答 2

Server Fault用户

发布于 2012-09-14 11:48:12

whois输出是不标准化的,所以没有任何切换来只获取您想要的信息。

您需要的是一些解析(grep/sed/ awk等等),而这个站点不适合这样做。请使用堆栈溢出代替。

票数 3
EN

Server Fault用户

发布于 2020-09-16 10:04:40

返回的男人如何格式化数据,只得到你喜欢的。

示例

代码语言:javascript
复制
whois -H -K 37.247.93.241

% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Note: this output has been filtered.
% Only primary keys and abuse contacts will be visible.
% No other contact information will be shown.

% Abuse contact for '37.247.93.0 - 37.247.93.255' is 'abuse@envia-tel.net'

inetnum:        37.247.93.0 - 37.247.93.255

route:          37.247.64.0/19
origin:         AS21413

% This query was served by the RIPE Database Query Service version 1.97.2 (HEREFORD)
票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/427438

复制
相关文章

相似问题

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