weppos/whois — pull request #220 by linrock (2013-04-04 09:07:21+00:00)
Title: Send additional parameters for ARIN queries (fixes #10).

Without sending additional parameters, ARIN sometimes doesn't return a full response. For example:

```
>>> ./bin/ruby-whois 8.8.8.8

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

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

Level 3 Communications, Inc. LVLT-ORG-8-8 (NET-8-0-0-0-1) 8.0.0.0 - 8.255.255.255
Google Incorporated LVLT-GOOGL-1-8-8-8 (NET-8-8-8-0-1) 8.8.8.0 - 8.8.8.255

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

Sending "+ z" as the query parameters should give a full response. Here's the same query, but prepending "+ z":

```
>>> ./bin/ruby-whois 8.8.8.8

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

# start

NetRange: 8.0.0.0 - 8.255.255.255
CIDR: 8.0.0.0/8
OriginAS:
NetName: LVLT-ORG-8-8
NetHandle: NET-8-0-0-0-1
Parent:
NetType: Direct Allocation
RegDate: 1992-12-01
Updated: 2012-02-24
Ref: http://whois.arin.net/rest/net/NET-8-0-0-0-1

OrgName: Level 3 Communications, Inc.
OrgId: LVLT
Address: 1025 Eldorado Blvd.
City: Broomfield
StateProv: CO
PostalCode: 80021
Country: US
RegDate: 1998-05-22
Updated: 2012-01-30
Comment: ADDRESSES WITHIN THIS BLOCK ARE NON-PORTABLE
Ref: http://whois.arin.net/rest/org/LVLT

OrgNOCHandle: NOCSU27-ARIN
OrgNOCName: NOC Support
OrgNOCPhone: +1-877-453-8353
OrgNOCEmail: noc.coreip@level3.com
OrgNOCRef: http://whois.arin.net/rest/poc/NOCSU27-ARIN

OrgTechHandle: IPADD5-ARIN
OrgTechName: ipaddressing
OrgTechPhone: +1-877-453-8353
OrgTechEmail: ipaddressing@level3.com
OrgTechRef: http://whois.arin.net/rest/poc/IPADD5-ARIN

OrgAbuseHandle: APL8-ARIN
OrgAbuseName: Abuse POC LVLT
OrgAbusePhone: +1-877-453-8353
OrgAbuseEmail: abuse@level3.com
OrgAbuseRef: http://whois.arin.net/rest/poc/APL8-ARIN

# end

# start

NetRange: 8.8.8.0 - 8.8.8.255
CIDR: 8.8.8.0/24
OriginAS:
NetName: LVLT-GOOGL-1-8-8-8
NetHandle: NET-8-8-8-0-1
Parent: NET-8-0-0-0-1
NetType: Reassigned
RegDate: 2009-09-21
Updated: 2009-09-21
Ref: http://whois.arin.net/rest/net/NET-8-8-8-0-1

OrgName: Google Incorporated
OrgId: GOOGL-1
Address: Google Information Technology
Address: 1600 Amphitheatre Parkway
City: Mountain View
StateProv: CA
PostalCode: 94043
Country: US
RegDate: 2005-12-06
Updated: 2011-09-24
Ref: http://whois.arin.net/rest/org/GOOGL-1

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

OrgAbuseHandle: MAX1-ARIN
OrgAbuseName: AXELROD, Michael
OrgAbusePhone: +1-650-253-0000
OrgAbuseEmail: axelrod@google.com
OrgAbuseRef: http://whois.arin.net/rest/poc/MAX1-ARIN

OrgTechHandle: MAX1-ARIN
OrgTechName: AXELROD, Michael
OrgTechPhone: +1-650-253-0000
OrgTechEmail: axelrod@google.com
OrgTechRef: http://whois.arin.net/rest/poc/MAX1-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

OrgTechHandle: NEC10-ARIN
OrgTechName: Network Engineering Corp
OrgTechPhone: +1-650-214-6513
OrgTechEmail: ir-contact-netops-corp@google.com
OrgTechRef: http://whois.arin.net/rest/poc/NEC10-ARIN

OrgAbuseHandle: NEC10-ARIN
OrgAbuseName: Network Engineering Corp
OrgAbusePhone: +1-650-214-6513
OrgAbuseEmail: ir-contact-netops-corp@google.com
OrgAbuseRef: http://whois.arin.net/rest/poc/NEC10-ARIN

OrgTechHandle: KKC9-ARIN
OrgTechName: Chittimaneni, Kiran Kumar
OrgTechPhone: +1-650-253-3000
OrgTechEmail: kk@google.com
OrgTechRef: http://whois.arin.net/rest/poc/KKC9-ARIN

OrgAbuseHandle: KKC9-ARIN
OrgAbuseName: Chittimaneni, Kiran Kumar
OrgAbusePhone: +1-650-253-3000
OrgAbuseEmail: kk@google.com
OrgAbuseRef: http://whois.arin.net/rest/poc/KKC9-ARIN

# end

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

From the ARIN help info:

```
Query-by-record-type:
---------------------
To limit your query to a specific record type, include one of the following
flags:
n Network address space
r CIDRized network space
d Delegations
a Autonomous systems
p Points-of-contact
o Organizations
c End-user customers
e Points-of-contact, Organizations, End-user customers
z All of the above

Display flags:
--------------
To modify the way that the query results display, include one of the
following flags:
+ FULL output shows detailed display for EACH match
- LIST output shows summary only, even if single match
returned
```