Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

whois 1.0.12 fails to parse answers from ARIN. #22

Closed
postmodern opened this Issue · 1 comment

2 participants

@postmodern

I tested Whois 1.0.12 on Ruby 1.8.7 and 1.9.1, but I could not get it to parse the results returned for common IP Addresses such as for www.example.com (192.0.32.10).

require 'whois'

w = Whois::Client.new
answer = w.query('192.0.32.10')
# => "\nOrgName:    ICANN \nOrgID:      ICANN\nAddress:    4676 Admiralty Way\nAddress:    Suite 330\nCity:       Marina del Rey\nStateProv:  CA\nPostalCode: 90292\nCountry:    US\n\nNetRange:   192.0.32.0 - 192.0.47.255 \nCIDR:       192.0.32.0/20 \nOriginAS:   AS26711\nNetName:    ICANN-MDR\nNetHandle:  NET-192-0-32-0-1\nParent:     NET-192-0-0-0-0\nNetType:    Direct Assignment\nNameServer: A.IANA-SERVERS.NET\nNameServer: B.IANA-SERVERS.ORG\nNameServer: C.IANA-SERVERS.NET\nNameServer: D.IANA-SERVERS.NET\nNameServer: NS.ICANN.ORG\nComment:    \nRegDate:    2009-06-29\nUpdated:    2010-02-09\n\nOrgTechHandle: JAB349-ARIN\nOrgTechName:   Abley, Joe \nOrgTechPhone:  +1-310-578-8673\nOrgTechEmail:  joe.abley@icann.org\n\nOrgTechHandle: MAK93-ARIN\nOrgTechName:   AKCIN, Mehmet \nOrgTechPhone:  +1-310-823-9358\nOrgTechEmail:  mehmet@icann.org\n\nOrgTechHandle: DCL131-ARIN\nOrgTechName:   Closson, David \nOrgTechPhone:  +1-310-578-8670\nOrgTechEmail:  david.closson@icann.org\n\nOrgTechHandle: DSO63-ARIN\nOrgTechName:   Soltero, David \nOrgTechPhone:  +1-310-301-3890\nOrgTechEmail:  david.soltero@icann.org\n\n# ARIN WHOIS database, last updated 2010-04-27 20:00\n# Enter ? for additional hints on searching ARIN's WHOIS database.\n#\n# ARIN WHOIS data and services are subject to the Terms of Use\n# available at https://www.arin.net/whois_tou.html\n" 
answer.properties
# => {:status=>nil, :referral_url=>nil, :admin=>nil, :domain=>nil, :created_on=>nil, :technical=>nil, :updated_on=>nil, :nameservers=>nil, :disclaimer=>nil, :expires_on=>nil, :domain_id=>nil, :registrar=>nil, :referral_whois=>nil, :registrant=>nil, :registered?=>nil, :available?=>nil}
@weppos
Owner

The reason is that no parser is currently available to handle ARIN responses.

w = Whois::Client.new
answer = w.query('192.0.32.10')
answer.parser.parsers.first.class
# => Whois::Answer::Parser::Blank

The Blank parser means no parser is currently available.
http://www.ruby-whois.org/manual/parser.html

As soon as a parser will be available, the properties will be correctly extracted from the response. New parsers are added almost every week.

@weppos weppos closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.