• 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

Java classes that implement whois protocol

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone:
I had initially tried retreiving whois information for a domain by establishing an http connection to a web site and obtaining information from there,
however, since the output from, for example, networksolutions.com varies slightly from domain to domain, I would like to use a java libray, if any, that uses the whois protocol internally and can give me the information in a consitent manner each time for each domain.

I had to parse the output from networksolutions.com to get the data I needed, but since the output varied for some domains, I am unable to parse it uniformly.
Examples of pieces of information that I am interesed in from whois protocol are:
Registrar
Administrator Contact
Techical Contact
Record created on
Record expires on
Database last updated

Does anyone know of a java library that can provide me with the above functionality.
Thanks a lot,
Shital Kapadia
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Geek Tools Whois Java Client
 
Shital Kapadia
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Mathew for your reply. I have already looked at that program, however, my requirements have kinda changed.
My company is asking me to write a program in java or any other language that is operating system independent and that can extract output from whois and build java objects out of that.
However, the biggest challenge that I am currently faced with is how do I write different parsing rules for the whois output, since this output varies from registrar to registrar.
So, instead of designing different parsing rules, I am looking for a way to elegantly handle these different outputs from different registrars in a way so that I can build the objects with ease.
Pls pls help me if anyone can, I have searching the net frantically for the past 2 days and I have found no clues on how to achieve this.
Thanks,
Shital Kapadia
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, instead of designing different parsing rules, I am looking for a way to elegantly handle these different outputs from different registrars in a way so that I can build the objects with ease.
That sounds like a job for XML and maybe XSLT. You could create an XML document that was capable of decribing output from all of the registrars then build your objects by parsing or transfoming that document. You might even find that someone already has a DTD for whois if you try searching for it.
 
Shital Kapadia
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Michael:
Since I have not used XSLT in the past, could you kindly elaborate some more on your note in the previous email about parsing and transforming that document.
Any example would be greatly appreciated.
Thanks,
Shital Kapadia
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just decided to search and guess what? Take a look at whois XML
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since I have not used XSLT in the past,
XSLT is simply using an XSL (Extensible Stylesheet Language) document to transform an XML document into some other form. One common use is to take raw data from an XML document and transform it into HTML. That's one possibility for you, but if I were doing this I probably would prefer to parse the thing in Java and create my objects straight out.
 
Shital Kapadia
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Michael:
Thanks for directing me to that draft for 'whois export and exchange format', however, after reading that draft, I kinda feel stuck again, I do not know in which direction to head, questions like, how do I identify if a particular registrar can send me the output as an xml compliant with this dtd are coming to my mind and I do not know how to seek answers to them.
Can you kindly help?
Thanks a ton,
Shital Kapadia
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how do I identify if a particular registrar can send me the output as an xml compliant with this dtd are coming to my mind and I do not know how to seek answers to them.

I wasn't suggesting that the registrars send you an XML document, but that you would create the XML document from the whois query. This is not going to be an easy hack. It just seems to me that organizing each query into an XML document would be one of the simpler approaches to the problem.
 
Shital Kapadia
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael:
That would mean once again parsing the output from each query, isn't it, in order to create the xml document, so what is the whole use of that xml document in the first place, I am confused. Pls explain in more detail if possible.
Thanks,
Shital Kapadia
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I said, this is not going to be easy. I was just suggesting a way to decouple the parsing from the actual creation of the objects. I have a similar problem in that I have a variety of neutral file formats that describe a steel structure. I designed the application that processes those neutral files in such a manner that the portion of the program that does the work is oblivious to the input file. At the time I created this application XML was not available to me so, I had to write a parser for each format. Now, if a new format comes along or an existing one changes, all I have to do is write/modify the parser with no fear of breaking the "meat" of the application.
 
Shital Kapadia
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Michael:
After having some discussion with my manager so far about the whois protocol and its output not being structured, we have decided to keep this req aside for sometime until we find a more elegant solution than parsing each and every output and having a parser class per registrar.
One of the options being considered within my company is to have our own whois server, I am not sure how that will help, however, I have been asked to investigate that as an option, if having our own whois server will help in anyway to get a structured output.

One question for javaranchers though, does anyone know on how to use jndi to resolve dns names and dns addresses to a particular domain?

Thanks,
Shital Kapadia
 
reply
    Bookmark Topic Watch Topic
  • New Topic