This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic