Monday, February 23, 2015

Whois domain detail by java

Apache commmon org.apache.commons.net.whois.WhoisClient class provides the domain details.

Following details:

Domain Name: UTTESH.COM
Registrar: GODADDY.COM, LLC
Sponsoring Registrar IANA ID: 146
Whois Server: whois.godaddy.com
Referral URL: http://registrar.godaddy.com
Name Server: NS63.DOMAINCONTROL.COM
Name Server: NS64.DOMAINCONTROL.COM
Status: clientDeleteProhibited http://www.icann.org/epp#clientDeleteProhibited
Status: clientRenewProhibited http://www.icann.org/epp#clientRenewProhibited
Status: clientTransferProhibited http://www.icann.org/epp#clientTransferProhibited
Status: clientUpdateProhibited http://www.icann.org/epp#clientUpdateProhibited
Updated Date: 11-jan-2015
Creation Date: 24-jan-2012
Expiration Date: 24-jan-2017

But it will provide only the registry database contains ONLY .COM, .NET, .EDU domains and Registrars.

Sample Code :

/**
 *
 * @author Uttesh Kumar T.H.
 */
import org.apache.commons.net.whois.WhoisClient;

public class WhoIsSample {

    public static void main(String[] args) {

        WhoIsSample obj = new WhoIsSample();
        System.out.println(obj.getWhois("uttesh.com"));
        System.out.println("Done");

    }

    public String getWhois(String domainName) {

        StringBuilder result = new StringBuilder("");

        WhoisClient whois = new WhoisClient();
        try {
            whois.connect(WhoisClient.DEFAULT_HOST);
            String whoisData1 = whois.query("=" + domainName);
            result.append(whoisData1);
            whois.disconnect();

        } catch (Exception e) {
            e.printStackTrace();
        }
        return result.toString();

    }

}

Jar details :

maven dependency

<dependency>
 <groupId>commons-net</groupId>
 <artifactId>commons-net</artifactId>
 <version>2.0</version>
</dependency>

Direct download click here

Related Posts:

  • Compare images are same by javaWe can compare the given images are same or not by comparing the buffer data of the image. 1. Compare the image sizes are same or not. 2. Compare the binary data of two images are same or not. sample code : import java.awt… Read More
  • Generate PDF page as imageWe can generate the image of pdf page by using the Pdf-renderer Simple class which generate the images file of given pdf file. /* * To change this license header, choose License Headers in Project Properties. * To change … Read More
  • Regular expression to extract the src tag details from given image tag or html source text By using the regular expression we can extract the any data from the given input, here we are trying to get the src attribute value from the given image tag or html text data. Image 'src' attribute extract Regx: <img[^&… Read More
  • Reverse elements in ArrayReverse all elements in array, traditional way how we use to do is get the array and iterate through the for loop and use swap logic to move to temporary array and get the result. But from jdk 1.5 introduced reverse() in ja… Read More
  • find character uppercase/lowercase count from given textFind the character upper/lower case occurrence count with simple single line code without iteration in java. int counta = text.split("(?=[a])").length - 1; This simple code will find all the lowercase character 'a… Read More

1 comment:

  1. We provides whois database & daily list of Newly Registered Domains with whois information containing Phone number, email & address etc.

    ReplyDelete