kevinoo / phpWhois

phpWhois general repository
https://phpwhois.pw
GNU General Public License v2.0
10 stars 1 forks source link

registrar data not being populated in object on .coop #1

Closed tmuka closed 11 months ago

tmuka commented 1 year ago

Thanks for sharing your fork!

I'm hoping you might have some insight into why it appears the handler isn't adding the Registrar info from the rawdata to the object below.

I see in Handlers/CoopHandler.php it appears these statically assigned regyinfo['registrar'] isn't being used either.

        $r['regyinfo'] = [
            'referrer'  => 'https://www.nic.coop',
            'registrar' => '.coop registry',
        ];
rawdata->Array
 0->Domain Name: domains.coop
 1->Registry Domain ID: D7881481-CNIC
 2->Registrar WHOIS Server: http://whois.domains.coop/
 3->Registrar URL: http://www.domains.coop/
 4->Updated Date: 2022-12-07T18:05:04.957Z
 5->Creation Date: 2002-07-09T10:21:51.000Z
 6->Registry Expiry Date: 2024-07-09T23:59:59.000Z
 7->Registrar: Domains.coop Limited
 8->Registrar IANA ID: 465
 9->Registrar Abuse Contact Email: violetta@domains.coop
 10->Registrar Abuse Contact Phone: +44.1865403136
 11->Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
 12->Registry Registrant ID: REDACTED FOR PRIVACY
 13->Registrant Name: REDACTED FOR PRIVACY
 14->Registrant Organization: Domains.coop Limited
 15->Registrant Street: REDACTED FOR PRIVACY
 16->Registrant City: REDACTED FOR PRIVACY
 17->Registrant State/Province: Oxfordshire
 18->Registrant Postal Code: REDACTED FOR PRIVACY
 19->Registrant Country: GB
 20->Registrant Phone: REDACTED FOR PRIVACY
 21->Registrant Fax: REDACTED FOR PRIVACY
 22->Registrant Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
 23->Registry Admin ID: REDACTED FOR PRIVACY
 24->Admin Name: REDACTED FOR PRIVACY
 25->Admin Organization: REDACTED FOR PRIVACY
 26->Admin Street: REDACTED FOR PRIVACY
 27->Admin City: REDACTED FOR PRIVACY
 28->Admin State/Province: REDACTED FOR PRIVACY
 29->Admin Postal Code: REDACTED FOR PRIVACY
 30->Admin Country: REDACTED FOR PRIVACY
 31->Admin Phone: REDACTED FOR PRIVACY
 32->Admin Fax: REDACTED FOR PRIVACY
 33->Admin Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
 34->Registry Tech ID: REDACTED FOR PRIVACY
 35->Tech Name: REDACTED FOR PRIVACY
 36->Tech Organization: REDACTED FOR PRIVACY
 37->Tech Street: REDACTED FOR PRIVACY
 38->Tech City: REDACTED FOR PRIVACY
 39->Tech State/Province: REDACTED FOR PRIVACY
 40->Tech Postal Code: REDACTED FOR PRIVACY
 41->Tech Country: REDACTED FOR PRIVACY
 42->Tech Phone: REDACTED FOR PRIVACY
 43->Tech Fax: REDACTED FOR PRIVACY
 44->Tech Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
 45->Registry Billing ID: REDACTED FOR PRIVACY
 46->Billing Name: REDACTED FOR PRIVACY
 47->Billing Organization: REDACTED FOR PRIVACY
 48->Billing Street: REDACTED FOR PRIVACY
 49->Billing City: REDACTED FOR PRIVACY
 50->Billing State/Province: REDACTED FOR PRIVACY
 51->Billing Postal Code: REDACTED FOR PRIVACY
 52->Billing Country: REDACTED FOR PRIVACY
 53->Billing Phone: REDACTED FOR PRIVACY
 54->Billing Fax: REDACTED FOR PRIVACY
 55->Billing Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
 56->Name Server: ns0.centralnic-dns.com
 57->Name Server: ns1.centralnic-dns.com
 58->Name Server: ns2.centralnic-dns.com
 59->Name Server: ns3.centralnic-dns.com
 60->Name Server: ns4.centralnic-dns.com
 61->Name Server: ns5.centralnic-dns.com
 62->DNSSEC: unsigned
 63->URL of the ICANN RDDS Inaccuracy Complaint Form: https://www.icann.org/wicf/
 64->
 65->>>> Last update of WHOIS database: 2023-08-01T19:13:14.175Z <<<
 66->
 67->For more information on domain status codes, please visit https://icann.org/epp
 68->
 69->The WHOIS information provided in this page has been redacted
 70->in compliance with ICANN's Temporary Specification for gTLD
 71->Registration Data.
 72->
 73->The data in this record is provided by Uniregistry for informational
 74->purposes only, and it does not guarantee its accuracy. Uniregistry is
 75->authoritative for whois information in top-level domains it operates
 76->under contract with the Internet Corporation for Assigned Names and
 77->Numbers. Whois information from other top-level domains is provided by
 78->a third-party under license to Uniregistry.
 79->
 80->This service is intended only for query-based access. By using this
 81->service, you agree that you will use any data presented only for lawful
 82->purposes and that, under no circumstances will you use (a) data
 83->acquired for the purpose of allowing, enabling, or otherwise supporting
 84->the transmission by e-mail, telephone, facsimile or other
 85->communications mechanism of mass  unsolicited, commercial advertising
 86->or solicitations to entities other than your existing  customers; or
 87->(b) this service to enable high volume, automated, electronic processes
 88->that send queries or data to the systems of any Registrar or any
 89->Registry except as reasonably necessary to register domain names or
 90->modify existing domain name registrations.
 91->
 92->Uniregistry reserves the right to modify these terms at any time. By
 93->submitting this query, you agree to abide by this policy. All rights
 94->reserved.
 95->
regyinfo->Array
 servers->Array
  0->Array
   server->whois.nic.coop
   args->domains.coop
   port->43
 type->domain
regrinfo->Array
 domain->Array
  name->domains.coop
  nserver->Array
   ns0.centralnic-dns.com->185.24.67.200
   ns1.centralnic-dns.com->185.24.67.201
   ns2.centralnic-dns.com->212.18.251.202
   ns3.centralnic-dns.com->212.18.251.203
   ns4.centralnic-dns.com->193.227.117.204
   ns5.centralnic-dns.com->194.50.187.205
 registered->yes
tmuka commented 1 year ago

It seems the same thing happens to me with .org domains such as "godaddy.org"
It works fine with the domain "godaddy.com" I also notice the rawdata shows first in the output on the TLDs that don't populate the regyinfo['registrar'] data.

rawdata->Array
 0->Domain Name: godaddy.org
 1->Registry Domain ID: 232dce94a461421280a83aa3c57abfe4-LROR
 2->Registrar WHOIS Server: http://whois.godaddy.com
 3->Registrar URL: http://www.whois.godaddy.com
 4->Updated Date: 2023-06-07T05:34:56Z
 5->Creation Date: 2002-04-19T19:41:43Z
 6->Registry Expiry Date: 2024-04-19T19:41:43Z
 7->Registrar: GoDaddy.com, LLC
 8->Registrar IANA ID: 146
 9->Registrar Abuse Contact Email: abuse@godaddy.com
 10->Registrar Abuse Contact Phone: +1.4806242505
 11->Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
 12->Domain Status: serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited
 13->Domain Status: clientRenewProhibited https://icann.org/epp#clientRenewProhibited
 14->Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
 15->Domain Status: serverTransferProhibited https://icann.org/epp#serverTransferProhibited
 16->Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
 17->Registry Registrant ID: REDACTED FOR PRIVACY
 18->Registrant Name: REDACTED FOR PRIVACY
 19->Registrant Organization: Domains By Proxy, LLC
 20->Registrant Street: REDACTED FOR PRIVACY
 21->Registrant City: REDACTED FOR PRIVACY
 22->Registrant State/Province: Arizona
 23->Registrant Postal Code: REDACTED FOR PRIVACY
 24->Registrant Country: US
 25->Registrant Phone: REDACTED FOR PRIVACY
 26->Registrant Phone Ext: REDACTED FOR PRIVACY
 27->Registrant Fax: REDACTED FOR PRIVACY
 28->Registrant Fax Ext: REDACTED FOR PRIVACY
 29->Registrant Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
 30->Registry Admin ID: REDACTED FOR PRIVACY
 31->Admin Name: REDACTED FOR PRIVACY
 32->Admin Organization: REDACTED FOR PRIVACY
 33->Admin Street: REDACTED FOR PRIVACY
 34->Admin City: REDACTED FOR PRIVACY
 35->Admin State/Province: REDACTED FOR PRIVACY
 36->Admin Postal Code: REDACTED FOR PRIVACY
 37->Admin Country: REDACTED FOR PRIVACY
 38->Admin Phone: REDACTED FOR PRIVACY
 39->Admin Phone Ext: REDACTED FOR PRIVACY
 40->Admin Fax: REDACTED FOR PRIVACY
 41->Admin Fax Ext: REDACTED FOR PRIVACY
 42->Admin Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
 43->Registry Tech ID: REDACTED FOR PRIVACY
 44->Tech Name: REDACTED FOR PRIVACY
 45->Tech Organization: REDACTED FOR PRIVACY
 46->Tech Street: REDACTED FOR PRIVACY
 47->Tech City: REDACTED FOR PRIVACY
 48->Tech State/Province: REDACTED FOR PRIVACY
 49->Tech Postal Code: REDACTED FOR PRIVACY
 50->Tech Country: REDACTED FOR PRIVACY
 51->Tech Phone: REDACTED FOR PRIVACY
 52->Tech Phone Ext: REDACTED FOR PRIVACY
 53->Tech Fax: REDACTED FOR PRIVACY
 54->Tech Fax Ext: REDACTED FOR PRIVACY
 55->Tech Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
 56->Name Server: pdns05.domaincontrol.com
 57->Name Server: pdns06.domaincontrol.com
 58->DNSSEC: unsigned
 59->URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
 60->>>> Last update of WHOIS database: 2023-08-01T19:32:45Z <<<
 61->
 62->For more information on Whois status codes, please visit https://icann.org/epp
 63->
 64->Terms of Use: Access to Public Interest Registry WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the Public Interest Registry registry database. The data in this record is provided by Public Interest Registry for informational purposes only, and Public Interest Registry 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 Identity Digital except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. Public Interest Registry reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy.  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.
regyinfo->Array
 servers->Array
  0->Array
   server->whois.pir.org
   args->godaddy.org
   port->43
 type->domain
regrinfo->Array
 domain->Array
  name->godaddy.org
  nserver->Array
   pdns05.domaincontrol.com->97.74.110.52
   pdns06.domaincontrol.com->173.201.78.52
 registered->yes
kevinoo commented 1 year ago

Thanks so much @tmuka for the debug's info 😊 It will surely help me to find and fix the problem 🤓

These days I will find time to check the code 💪🏻

kevinoo commented 1 year ago

Hi @tmuka I checked the code you reported and created a UnitTest to understand the behavior you reported. :muscle:

I found the problem, currently in the "Handler(s)" the $raw_data is not parsed to return the information, but they are (almost) always hardcoded :face_with_head_bandage:

At the moment I have fixed CoopHandler, however before creating a new release, I would like to check the other handlers as well in order to publish a complete release. :pray:

Thanks, Kevin

tmuka commented 1 year ago

Awesome! thanks so much for the update. glad you were able to figure out what was going on. I'll give the dev version a try

kevinoo commented 11 months ago

Hi @tmuka, I fixed in all files the code, parsing the raw_data before returns the response :call_me_hand:

Thanks again for the suggestion :muscle: