File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes nslookup in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "nslookup in Java" Watch "nslookup in Java" New topic
Author

nslookup in Java

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Dear Ranchers,
I'm doing a program in JSP and MySQL. The client is a Webhosting company. They want to check for the domain availability for registering the website thru their site.

for egs : nslookup www.aravindprasad.com should result the domain is available for registering
nslookup www.javaranch.com should result the domain is already registered.

Please help me to do this in Java. How can I start the coding in Java for this. Please send me some links which can help me.

Thanks in advance

regards

Aravind Prasad
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8914
    
    8

Please do not post the same question in multiple forums. It causes confusion and duplication of effort as the community tries to help everyone.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Sorry for posting the doubt in different forums.
When i tried to post in the other one JSP forum it showed me it was locked, So i thought it is Java Advanced and i posted again in this forum.

Please help me, I'm waiting for Java Gurus to reply and solve my problem

Thanks and regards

Aravind Prasad
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Take a look at InetAddress.getAllByName();
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Thankyou very much Scott,
I got the result using this. I've writtend a code which I'm adding here.



Now when i run the code I'm getting the output like this



Can I get the output as 1 if the domain exists..

Please help me.. what changes I should do in the code so that I can get the result like 1 if domain exists

Thanks in Advance

regards
Aravind Prasad
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14192
    
  20

[Ljava.net.InetAddress;@923e30

Did you look at the API documentation of the method InetAddress.getAllByName(...)? If you did, you would have seen that it returns an array of InetAddress objects. If you print that directly to the screen, you'll get the above. Please read the API documentation.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: nslookup in Java