我想知道,如何使用命令行whois,我可以获得所有的IP范围(即,网络对象)分配给一个特定的组织。
例如,考虑一下这家公司:http://whois.arin.net/rest/org/HT-136 .如果您单击“相关网络”链接,它将带您到http://whois.arin.net/rest/org/HT-136/nets,它将向您显示分配给它的网络。
我发现很难弄清楚如何使用命令行whois获取相同的信息。
任何帮助都将不胜感激!
发布于 2014-08-25 19:55:36
$ whois -a "o ! > HT-136"
通过执行man whois
和whois -a ?
可以找到
结果是:
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#
# If you see inaccuracies in the results, please report at
# http://www.arin.net/public/whoisinaccuracy/index.xhtml
#
#
# The following results may also be obtained via:
# http://whois.arin.net/rest/orgs;handle=HT-136?showDetails=true&ext=netref2
#
OrgName: HAProxy Technologies, Inc.
OrgId: HT-136
Address: 1013 Centre Road, Suite 403S
City: Wilmington
StateProv: DE
PostalCode: 19805
Country: US
RegDate: 2014-04-02
Updated: 2014-07-18
Ref: http://whois.arin.net/rest/org/HT-136
TechHandle: SCARP14-ARIN
TechName: Scarpa, John
TechPhone: +1-857-366-5050
TechEmail: john.scarpa@haproxy.com
TechRef: http://whois.arin.net/rest/poc/SCARP14-ARIN
TechHandle: BRKIC2-ARIN
TechName: Brkic, andrej
TechPhone: +19547320642
TechEmail: abrkic@haproxy.com
TechRef: http://whois.arin.net/rest/poc/BRKIC2-ARIN
NOCHandle: NETWO6774-ARIN
NOCName: Network Operations
NOCPhone: +1-857-366-5050
NOCEmail: noc@haproxy.com
NOCRef: http://whois.arin.net/rest/poc/NETWO6774-ARIN
AdminHandle: SCARP14-ARIN
AdminName: Scarpa, John
AdminPhone: +1-857-366-5050
AdminEmail: john.scarpa@haproxy.com
AdminRef: http://whois.arin.net/rest/poc/SCARP14-ARIN
AbuseHandle: NETWO6775-ARIN
AbuseName: Network Abuse
AbusePhone: +1-857-366-5050
AbuseEmail: abuse@haproxy.com
AbuseRef: http://whois.arin.net/rest/poc/NETWO6775-ARIN
HAProxy Technologies, Inc. SCNET-205-234-170-0-1 (NET-205-234-170-0-1) 205.234.170.0 - 205.234.170.255
HAProxy Technologies, Inc. SCNET-205-234-181-0-1 (NET-205-234-181-0-1) 205.234.181.0 - 205.234.181.255
HAProxy Technologies, Inc. SCNET-205-234-165-0-1 (NET-205-234-165-0-1) 205.234.165.0 - 205.234.165.255
HAProxy Technologies, Inc. SCNET-205-234-166-0-1 (NET-205-234-166-0-2) 205.234.166.0 - 205.234.166.255
HAProxy Technologies, Inc. HAPNET-1 (NET-104-152-112-0-1) 104.152.112.0 - 104.152.119.255
HAProxy Technologies, Inc. (AS11019) HAPROXY-TECHNOLOGIES 11019
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#
# If you see inaccuracies in the results, please report at
# http://www.arin.net/public/whoisinaccuracy/index.xhtml
#
作为替代答案,通过RWHOIS使用CURL或任何REST客户端在我看来要容易得多。
curl http://whois.arin.net/rest/org/HT-136/nets
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='http://whois.arin.net/xsl/website.xsl' ?>
<nets xmlns="http://www.arin.net/whoisrws/core/v1" xmlns:ns2="http://www.arin.net/whoisrws/rdns/v1" xmlns:ns3="http://www.arin.net/whoisrws/netref/v2" termsOfUse="https://www.arin.net/whois_tou.html" inaccuracyReportUrl="http://www.arin.net/public/whoisinaccuracy/index.xhtml">
<limitExceeded limit="256">false</limitExceeded>
<netRef startAddress="205.234.170.0" endAddress="205.234.170.255" name="SCNET-205-234-170-0-1" handle="NET-205-234-170-0-1">http://whois.arin.net/rest/net/NET-205-234-170-0-1</netRef>
<netRef startAddress="205.234.181.0" endAddress="205.234.181.255" name="SCNET-205-234-181-0-1" handle="NET-205-234-181-0-1">http://whois.arin.net/rest/net/NET-205-234-181-0-1</netRef>
<netRef startAddress="205.234.165.0" endAddress="205.234.165.255" name="SCNET-205-234-165-0-1" handle="NET-205-234-165-0-1">http://whois.arin.net/rest/net/NET-205-234-165-0-1</netRef>
<netRef startAddress="205.234.166.0" endAddress="205.234.166.255" name="SCNET-205-234-166-0-1" handle="NET-205-234-166-0-2">http://whois.arin.net/rest/net/NET-205-234-166-0-2</netRef>
<netRef startAddress="104.152.112.0" endAddress="104.152.119.255" name="HAPNET-1" handle="NET-104-152-112-0-1">http://whois.arin.net/rest/net/NET-104-152-112-0-1</netRef>
</nets>
https://networkengineering.stackexchange.com/questions/10597
复制相似问题