2

I'd like to know how, using command-line whois, I can get all IP ranges (i.e., NET objects) assigned to a particular organisation.

For example, consider this company: http://whois.arin.net/rest/org/HT-136 ... if you click on the link "Related networks" it will bring you to http://whois.arin.net/rest/org/HT-136/nets which shows you the networks assigned to it.

I am finding it difficult to figure out how to get the same info using command-line whois.

Any help would be greatly appreciated!

8
$ whois -a "o ! >  HT-136"

As found by doing man whois and whois -a ?

  • -a

    Use the American Registry for Internet Numbers (ARIN) database. It contains network numbers used in those parts of the world cov- ered neither by APNIC, AfriNIC, LACNIC, nor by RIPE.

  • o

    Query-by-record-type: o Organizations

  • !

    Query-by-attribute: ! Searches for matches by handle or id

  • >

    Record hierarchy: Displays the record related down the hierarchy. For an organization or customer, display the resources registered to that organization or customer, in list format.

The Result is:

#
# 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
#

As an alternate answer, using CURL or any REST client via RWHOIS is in my opinion MUCH easier to parse.

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>
  • Thanks. I knew about the REST service, however, some RIRs don't provide this and ideally I'd like to be able to query all of them, so a whois commandline might be more portable between each RIR. – ConorD55 Sep 6 '14 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.