How can I get from the console information about domain expiration date for european domains, like .eu
, .de
, .sk
?
For .com
domains I just use whois example.com
, but for european domains I get just the brief info, without the date (eg. NOT DISCLOSED!
for .eu
domains)
As an alternative solution I've found paid web service www.whoisxmlapi.com, but it's limited too (and I'm looking for a solution for non commercial projects).
Most ccTLD (.de and .eu too) don't have expiration date shown when you run whois, while .sk is one of those that do. Only solution until this policy changes is to use api to get full whois from web interface on that national registry. Here you can find list with available whois info for most ccTLD: http://linuxmafia.com/pub/linux/network/domain-check-testdata
As you can see, most of ccTLD whois servers don't return expiration dates.
Here's an online whois that worked (displayed expiracy date) for a .eu domain name : https://whois.eurid.eu/en/?domain=demosphere.eu
You should be able to get whois for almost any domain, actually there are regulations to make sure that's the case. But obviously it's not the case always. To do whois properly from command line, you have to first:
1) connect to whois using the -h switch with one of the servers on this list:
http://www.nirsoft.net/whois_servers_list.html
NOTE: each ending/tld has one "main registrar"
2) What you get in return, will include a field that gives you the whois server address of the registrar where the domain is actually registered.
NOTE: You can get the full registration information only from the registrar where the domain is actually registered.
If you run:
It will try to do this for you in the background (as far as I understand), but depending on the system and whois version, it's often not doing it well and might also be prone to being rate-limited.
Below a quick code example for doing whois "properly". I've tested it with a large number of sites, and it avoids the usual rate-limit issues and returns a much higher 'complete result' rate than any other method I had tried.