Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check domain availability Java

Tags:

java

dns

whois

Is there a relatively simple way in Java to check if a domain is available or not?

I need a reliable method, so only checking if the connection can be made is not enough.

like image 357
Thizzer Avatar asked Feb 03 '10 21:02

Thizzer


2 Answers

Domain availability depends on having a whois client. Here is a link to an implementation of a whois client in Java:

Java Whois Client

You'll need to parse the results - and depending on what whois server you use, you may (will) have varying formats that are returned. The best thing to do is to pay for a commercial whois/registration service such as OpenSRS. They have an extensive API which you can use as a registered reseller. Here are the API docs:

http://opensrs.com/resources/documentation/opensrs_xmlapi.pdf

HTH,

-aj

like image 137
AJ. Avatar answered Sep 30 '22 05:09

AJ.


There's a good Whois Java client here:

https://github.com/ethauvin/Whois

You can run it from the command line or interface with it directly:

// don't include the www        
Whois.main(new String[] {"skytouch.com"});
like image 26
Jon Avatar answered Sep 30 '22 05:09

Jon