2

I use this code fragment for Whois information:

org.apache.commons.net.whois.WhoisClient whois = new org.apache.commons.net.whois.WhoisClient();
whois.connect("whois.verisign-grs.com", 43);

String domainWhois = whois.query(domainName);

whois.disconnect();

I get creation, expiration dates, registrar and name servers but there is no data related to administrative or technical contacts. Is there any way to get them?

Alex Riley
  • 169,130
  • 45
  • 262
  • 238
Justinas Jakavonis
  • 8,220
  • 10
  • 69
  • 114
  • As per this [question](http://stackoverflow.com/questions/21923598/using-apache-commons-whoisclient-in-java), maybe try a different whois server. – far Jun 23 '16 at 16:08
  • try whois.connect(whois.DEFAULT_HOST); – CSK Jun 23 '16 at 16:14
  • whois.iana.org server returns the same contact for all domains: VeriSign Global Registry Services. whois.connect(whois.DEFAULT_HOST); does not give any additional info. – Justinas Jakavonis Jun 23 '16 at 16:30
  • 1
    whois.verisign-grs.com provides a *thin* whois service. You need to query the domain again at the registrar's whois server (the registrar and their whois server will be given in the record that Verisign returns). – Alex Riley Jun 26 '16 at 15:23
  • @ajcr - it works, thanks. You could post it as the answer. – Justinas Jakavonis Jul 03 '16 at 19:57
  • @Justas: that's cool, I posted a full answer elaborating on my comment. – Alex Riley Jul 03 '16 at 20:55

1 Answers1

6

Generally, finding the owner/administrator of a particular .com or .net domain involves performing two WHOIS lookups.

Verisign is the registry for these top-level domains. The code in your question is correct in that you must query the server at whois.verisign-grs.com.

However, you should be aware that this is a thin WHOIS service. This means that the server will only send you back information about the registrar (the company that the domain is registered through), as well as expiry dates, name servers, and so on.

Using stackoverflow.com as an example, Verisign tells you that the registrar is NAME.COM INC (I'm using the whois program that's found on Unix-based systems, specifying the host with -h for clarity):

$ whois -h whois.verisign-grs.com stackoverflow.com

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: STACKOVERFLOW.COM
   Registrar: NAME.COM, INC.
   Sponsoring Registrar IANA ID: 625
   Whois Server: whois.name.com
   Referral URL: http://www.name.com
   Name Server: NS-1033.AWSDNS-01.ORG
   Name Server: NS-1543.AWSDNS-00.CO.UK
   Name Server: NS-358.AWSDNS-44.COM
   Name Server: NS-739.AWSDNS-28.NET
   Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
   Updated Date: 08-jun-2016
   Creation Date: 26-dec-2003
   Expiration Date: 26-dec-2016

[...]

If you want to see information about the company or individual that actually owns the domain, you need to send the query to the registrar's WHOIS server. In this case the query must go to whois.name.com:

$ whois -h whois.name.com stackoverflow.com

Domain Name: STACKOVERFLOW.COM 
Registry Domain ID: 108907621_DOMAIN_COM-VRSN 
Registrar WHOIS Server: whois.name.com 
Registrar URL: http://www.name.com 
Updated Date: 2016-06-08T04:23:11Z 
Creation Date: 2003-12-26T19:18:07Z 
Registrar Registration Expiration Date: 2016-12-26T19:18:07Z 
Registrar: Name.com, Inc. 
Registrar IANA ID: 625 
Reseller:  
Domain Status: clientTransferProhibited 
Registry Registrant ID:  
Registrant Name: Sysadmin Team 
Registrant Organization: Stack Exchange, Inc. 
Registrant Street: 110 William St , Floor 28 
Registrant City: New York 
Registrant State/Province: NY 
Registrant Postal Code: 10038 
Registrant Country: US 
Registrant Phone: +1.2122328280 
Registrant Email: sysadmin-team@stackoverflow.com

[...]
Alex Riley
  • 169,130
  • 45
  • 262
  • 238