On Wed, 31 May 2000, Vivin Kumar P wrote:

> My question is how to find the machine name of a client connected to my
> server.....The server and client will be
> inside a LAN.

Is the LAN connected to the net? If not, you cannot do it, because there
is no DNS service to inform InetAddress about the mapping between names
and IP addresses... A similar situation may arise if you are behind a
firewall. If it suits your application, you'd be better off with
a static lookup table, perhaps a file to be read at runtime.

Kostas

>
> The code I used was.....
>
> System.out.println("We serviced a client from IP:" + client.getInetAddress
> () );
> System.out.println("Client's host name:" + ((client.getInetAddress
> ()).getHostName() )  );
>
> But the output I got was....
>
> We serviced a client from IP:10.32.16.155/10.32.16.155
> Client's host name:10.32.16.155
>
> Is there a way to find the host name?
> Any information in this regard is appreciated.....
>
> Thanks in advance,
> Vivin.
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to