Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

nslookup in Java

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not post the same question in multiple forums. It causes confusion and duplication of effort as the community tries to help everyone.
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at InetAddress.getAllByName();
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

[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.
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic