0

I have a bunch of domains (77) at different registrars like netsol, goDaddy, etc.

I want to get the expiration date, registrant and registrar for each of them.

Since everyone has their own WHOIS database and different output format, I am not able to sort all the data. Is there any TOP WHOIS database I can query so that I will have all the same format for all of the domains in my list and will be able to process it for the info I need ?

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
yield
  • 731
  • 1
  • 8
  • 24

3 Answers3

1

The Ruby whois library also includes a standardized whois response parser you can use to extract the details from a whois response.

If you don't know Ruby or don't want to use it, there are several services available. RoboWhois is one of these.

Disclaimer: I'm the author of the Ruby whois library and RoboWhois.

Simone Carletti
  • 1,494
  • 3
  • 15
  • 30
  • There are similar libraries in many other languages. The main problem is making sure they are maintained to stay up to date as whois server output can change, whois servers hostnames can change, new TLDs are added or removed, etc. – Patrick Mevzek Jan 15 '20 at 18:06
1

This is a task many people have done for their monitoring systems to make sure domains are renewed on time. You can find some existing plugins for Nagios at nagios exchange. That should help you get started.

There is no 'top whois database', whois is decentralized and messy. As you'll find out, all these tools (and the tool you'll inevitable write yourself) are long lists of special cases.

Patrick Mevzek
  • 9,273
  • 7
  • 29
  • 42
Dennis Kaarsemaker
  • 18,793
  • 2
  • 43
  • 69
  • About "top whois database", depending on what that means exactly, IANA own whois server outputs the hostname of each TLD whois server. This of course does not handle all suffixes nor thin registries like COM/NET is still today, which means you need to query both the registry and the specific registrar to get all information. But you should more rely on RDAP anyway nowadays, as detailed in my answer. – Patrick Mevzek Jan 15 '20 at 18:05
1

Nowadays, and specifically if you are handling gTLDs, you should use RDAP and not whois anymore. Far easier to parse, because the result is JSON not free form unstructured text. Not all registrars or registries, even in gTLDs, and even if mandated by ICANN since this August 26th, may have working and properly following standards RDAP servers, but they should and the number can only increase.

See https://about.rdap.org/ for a primer, or ICANN documentation: https://www.icann.org/rdap

Otherwise, a quick example:

$ wget -qO - https://rdap.verisign.com/com/v1/domain/godaddy.com | jq '.events[] | select(.eventAction | contains("expiration")) | .eventDate'
"2021-11-01T11:59:59Z"

$ wget -qO - https://rdap.verisign.com/com/v1/domain/godaddy.com | jq '.entities[0].vcardArray[1][1][3]'
 "GoDaddy.com, LLC"

$ wget -qO - https://rdap.verisign.com/com/v1/domain/godaddy.com | jq '.links[1].href'
"https://rdap.godaddy.com/v1/domain/GODADDY.COM"

$ wget -qO - https://rdap.godaddy.com/v1/domain/GODADDY.COM | jq '.events[] | select(.eventAction | contains("expiration")) | .eventDate'
"2021-11-01T06:59:59Z"

(but of course in real code you shouldn't hardcode position in arrays and things like that, you need to properly parse the JSON output).

Patrick Mevzek
  • 9,273
  • 7
  • 29
  • 42