weppos / whois-parser

An intelligent — pure Ruby — WHOIS parser.
https://whoisrb.org
MIT License
98 stars 102 forks source link

`Whois::ParserError: Unexpected token` on AU domains parsing #96

Open kovalevsky opened 6 years ago

kovalevsky commented 6 years ago

Hi! I've faced with .au domain parsing issue.

[6] pry(main)> parser = Whois.lookup('business.gov.au').parser
=> #<Whois::Parser:0x00007f9a94e38150
 @record=
  "Domain Name: BUSINESS.GOV.AU\r\nRegistry Domain ID: D407400000002894368-AU\r\nRegistrar WHOIS Server:\r\nRegistrar URL:\r\nLast Modified:\r\nRegistrar Name: Digital Transformation Agency\r\nRegistrar Abuse Contact Email:\r\nRegistrar Abuse Contact Phone:\r\nReseller Name:\r\nStatus: serverDeleteProhibited\r\nStatus: serverRenewProhibited\r\nStatus: serverTransferProhibited\r\nStatus: serverUpdateProhibited\r\nRegistrant Contact ID: C6380238-AU\r\nRegistrant Contact Name: Manager Web Services ICT Systems Branch\r\nTech Contact ID: C6218873-AU\r\nTech Contact Name: Manager Web Services ICT Systems Branch\r\nName Server: NS1.INTELLICENTRE.NET.AU\r\nName Server IP: 203.110.136.160\r\nName Server: NS3.INTELLICENTRE.NET.AU\r\nName Server IP: 124.47.142.2\r\nName Server: NS2.INTELLICENTRE.NET.AU\r\nName Server IP: 124.47.130.30\r\nDNSSEC: unsigned\r\nRegistrant: Department of Industry, Innovation and Science\r\nEligibility Type: Other\r\nURL of the auDA Complaint Form: https://www.auda.org.au/about-auda/our-services/submit-a-domain-complaint-/\r\n>>> Last update of WHOIS database: 2018-07-01T03:44:03Z <<<\r\n\r\n\r\n\r\nAccess to AU WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the AU registry database. The data in this record is provided by AU for informational purposes only, and AU does not guarantee its accuracy.  This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to(a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or AU except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. AU reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy.\r\n">
[7] pry(main)> parser.available?
Whois::ParserError: Unexpected token: Access to AU WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the AU registry database. The data in this record is provided by AU for informational purposes only, and AU does not guarantee its accuracy.  This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to(a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or AU except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. AU reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy.
from /Users/sk/projects/trafficrunners/leadnet/vendor/bundle/ruby/2.5.0/gems/whois-parser-1.1.0/lib/whois/scanners/base.rb:110:in `error!'

I suppose expected behavior is returning bool value or unsupported property error.

OS: macOS 10.13.5
Ruby version: 2.5.1
Gems versions:
    whois (4.0.6)
    whois-parser (1.1.0)
Context: RoR application
miah commented 6 years ago

Seeing similar parsing errors from my domain registered at gandi.net:

https://gist.github.com/miah/a81758cde8d4a6809ebd0e31a686e6b3

[25] pry(main)> parser.nameservers
Whois::ParserError: Unexpected token: The Registrar of Record identified in this output may have an RDDS service that can be queried for additional information on how to contact
the Registrant, Admin, or Tech contact of the queried domain name.
from /Users/miah/projects/github/.gems/inspec-whois/ruby/2.5.0/gems/whois-parser-1.1.0/lib/whois/scanners/base.rb:110:in `error!'
kovalevsky commented 6 years ago

@miah yeah there are a lot of similar errors. Some of them are fixed in PRs, but the worst thing is repository looks abandoned and not maintained.

weppos commented 6 years ago

There repo is not abandoned. GDPR changed pretty much each and every single registrar response, and I just don't have the time to follow up on all these changes.

I am doing my best to keep up with definition updates on the main Ruby gem, maintain the other projects with higher priority, and I'll use the remaining time to follow up about this repo. Sadly, the remaining time balance is currently a negative amount.