File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting the Client machine name

 
surendar prabu
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application i need to get the name of the client machine that is making the request. I am using the getRemoteHost method. But it is returning the IP Address of the client. is there any way i can resolve the name of the client machine from that or any other method is there to get the client name.

regards,
Surendarprabu
 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you could use nslookup <ip-address>. This is a common command for your OS.
 
Dave Wingate
Ranch Hand
Posts: 262
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet API indicates that the container is not required to convert the requestor's IP address into a host name (for the sake of speed) ... In that case, getRemoteHost will return the remote IP instead.

If you desire, you can manually intervene to look up the remote host name if the container has decided not to do so. Here's a code snippet that I use:

 
Ajay Singh
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get the name of the client machine if the client is on the public domain or in the same network as the server.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic