We can get any domain information using Apache commons net library. It supports various protocols and WHOIS information is one of them
WhoisClient class provides access of domain information
See what docs says -
The WhoisClient class implements the client side of the Internet Whois Protocol defined in RFC 954. To query a host you create a WhoisClient instance, connect to the host, query the host, and finally disconnect from the host. If the whois service you want to query is on a non-standard port, connect to the host at that port.
Download required library or if this link doesn't work then goto API page and download from there
This simple java method will fetch information of domain using Apache library
WhoisClient class provides access of domain information
See what docs says -
The WhoisClient class implements the client side of the Internet Whois Protocol defined in RFC 954. To query a host you create a WhoisClient instance, connect to the host, query the host, and finally disconnect from the host. If the whois service you want to query is on a non-standard port, connect to the host at that port.
Download required library or if this link doesn't work then goto API page and download from there
This simple java method will fetch information of domain using Apache library