weppos / whois

An intelligent — pure Ruby — WHOIS client and parser.
https://whoisrb.org
MIT License
1.14k stars 283 forks source link

Problem parsing 1&1 domains #522

Closed originalpete closed 8 years ago

originalpete commented 8 years ago

This gem is fantastic, but it can't parse 1&1 domains properly.

The library successfully parses the WHOIS data but the registrant fields are bland. I think it gets confused due to response WHOIS data being duplicated, with a summary subset first, followed by full results.

See example below (XXX marks redacted fields).

> whois = Whois.lookup("example.com")

> puts whois
Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

   Domain Name: EXAMPLE.COM
   Registrar: 1&1 INTERNET SE
   Sponsoring Registrar IANA ID: XXX
   Whois Server: whois.1and1.com
   Referral URL: http://registrar.1and1.info
   Name Server: XXX
   Name Server: XXX
   Name Server: XXX
   Name Server: XXX
   Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
   Updated Date: 07-mar-XXX
   Creation Date: 06-mar-XXX
   Expiration Date: 06-mar-XXX

>>> Last update of whois database: XXX <<<

For more information on Whois status codes, please visit https://icann.org/epp

NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar.  Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.

TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability.  VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.

The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.

Domain Name: XXX
Registry Domain ID: XXX
Registrar WHOIS Server: whois.1and1.com
Registrar URL: http://1and1.com
Updated Date: XXX
Creation Date: XXX
Registrar Registration Expiration Date: XXX
Registrar: 1&1 Internet SE
Registrar IANA ID: XXX
Registrar Abuse Contact Email: abuse@1and1.com
Registrar Abuse Contact Phone: +1.8774612631
Reseller: 
Domain Status: clientTransferProhibited https://www.icann.org/epp#clientTransferProhibited
Registry Registrant ID: 
Registrant Name: XXX
Registrant Organization: 
Registrant Street: XXX
Registrant Street: XXX
Registrant City: XXX
Registrant State/Province: XXX
Registrant Postal Code: XXX
Registrant Country: XXX
Registrant Phone: XXX
Registrant Phone Ext: 
Registrant Fax: 
Registrant Fax Ext: 
Registrant Email: XXX
Registry Admin ID: 
Admin Name: XXX
Admin Organization: 
Admin Street: XXX
Admin Street: XXX
Admin City: XXX
Admin State/Province: XXX
Admin Postal Code: XXX
Admin Country: XXX
Admin Phone: XXX
Admin Phone Ext: 
Admin Fax: 
Admin Fax Ext: 
Admin Email: XXX
Registry Tech ID: 
Tech Name: Hostmaster ONEANDONE
Tech Organization: 1&1 Internet Ltd.
Tech Street: 10-14 Bath Road
Tech Street: Aquasulis House
Tech City: Slough
Tech State/Province: BRK
Tech Postal Code: SL1 3SA
Tech Country: GB
Tech Phone: +44.8716412121
Tech Phone Ext: 
Tech Fax: +49.72191374215
Tech Fax Ext: 
Tech Email: hostmaster@1and1.co.uk
Nameserver: XXX
Nameserver: XXX
Nameserver: XXX
Nameserver: XXX
DNSSEC: Unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: XXX <<<

For more information on Whois status codes, please visit https://icann.org/epp

> whois.registrant_contact
 => nil 
> whois.technical_contact
 => nil 
> whois.admin_contact
 => nil 
weppos commented 8 years ago

Whois parsers are now defined in a separate gem. https://github.com/weppos/whois-parser

Do you mind to report the issue in the new repository?