Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser doesn't seem to return correct value for created_on #164

Open
tonypersona opened this issue Sep 6, 2024 · 1 comment
Open

Parser doesn't seem to return correct value for created_on #164

tonypersona opened this issue Sep 6, 2024 · 1 comment

Comments

@tonypersona
Copy link

Here are examples I ran in my Ruby console.

  1. You'll see a "Creation Date: 2002-06-21T14:22:15Z" key in the WHOIS record, but it's not populating correctly
[39] dev@us-central1 (main)> whois.lookup('uct.ac.za').parser.created_on
Whois::AttributeNotImplemented: Unable to find a parser for property `created_on'
from /usr/local/bundle/gems/whois-parser-2.0.0/lib/whois/parser.rb:365:in `delegate_property_to_parsers'
[40] dev@us-central1 (main)> whois.lookup('uct.ac.za').parser
#<Whois::Parser:0x0000ffff6c6b9ab0 @record="Whois Server: whois.ac.za\r\nReferral URL: https://whois.ac.za/\r\nDomain Name: uct.ac.za\r\nRegistry Domain ID: dom_1OC3--1\r\nUpdated Date: 2024-07-01T00:00:07Z\r\nCreation Date: 2002-06-21T14:22:15Z\r\nRegistry Expiry Date: 2025-07-01T00:00:00Z\r\nRegis...
  1. This is for NL
[46] dev@us-central1 (main)> a=Whois.lookup('careless-nederland.nl')
"Domain name: careless-nederland.nl\r\nStatus:      active\r\n\r\nRegistrar:\r\n   IONOS SE\r\n   Elgendorfer Strasse 57\r\n   56410 Montabaur\r\n   Germany\r\n\r\nAbuse Contact:\r\n   abuse@ionos.com\r\n\r\nDNSSEC:      no\r\n\r\nDomain nameservers:\r\n   ns1020.ui-dns.com\r\n   ns1032.ui-dns.org\r\n   ns1087.ui-dns.biz\r\n   ns1063.ui-dns.de\r\n\r\nCreation Date: 2017-12-09\r\n\r\nUpdated Date: 2022-02-18\r\n\r\nRecord maintained by: SIDN BV\r\n"
[47] dev@us-central1 (main)> a.parser.created_on
nil

Could you point me in the right direction on how to get the Creation Date to return correctly?

@jarthod
Copy link

jarthod commented Sep 7, 2024

Those attributes do not seem to be supported/implemented in the specific parser for these TLDs. You can write a PR to add support for them (or see if there's another better parser to re-use for these TLDs). The main repository here has been abandoned though, so if you do contribute, you may want to submit your PR on my fork which is much more up-to-date: https://github.com/jarthod/whois-parser.

Also for some TLD like .NL you can use RDAP (ruby gem) instead of WHOIS, which uses a structured json API common to all TLDs so it's much more reliable to get such information. But unfortunately not all TLD has an RDAP server yet (.ac.za does not for example).

> RDAP.domain('careless-nederland.nl')['events']
# =>
[{"eventAction"=>"registration", "eventDate"=>"2017-12-09T13:19:09Z"},
 {"eventAction"=>"last changed", "eventDate"=>"2022-02-18T11:41:58Z"},
 {"eventAction"=>"last update of RDAP database", "eventDate"=>"2024-09-07T22:10:34Z"}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants