On Thu, 5 Sep 2002, randie ursal wrote:

> i want the clients hostname...not server hostname.
>
> but getRemoteHost returns IP address of client not its dns hostname.
>
> why is this?

It shouldn't -- that's getRemoteAddr's job.  My guess is it's either a
bug with your servlet container (although I tend to doubt that, unless
it's an old one), or the remote host in question isn't properly
configured (i.e. for reverse lookups).  Or perhaps you don't have DNS
properly configured.

You can try the InetAddress.getByName trick someone mentioned, but
that may not work as well.  If it does work, it suggests that the
problem is a bug with your servlet container.  If it doesn't work, it
suggests one of the other possibilities I mentioned above (there of
course may be others).


> Emmanuel Eze wrote:
>
> >use getServerName() if u want the server's ip address
> >
> >-----Original Message-----
> >From: randie ursal [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, September 05, 2002 2:54 PM
> >To: [EMAIL PROTECTED]
> >Subject: about getRemoteHost
> >
> >
> >hi,
> >
> >    sorry for this newbie question...
> >
> >        why is getRemoteHost() of HttpServletRequest return the
> >    IP address of the client accessing my servlet and not the machine
> >    assign dns hostname?
> >
> >thanks
> >   randie

Milt Epstein
Research Programmer
Systems and Technology Services (STS)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
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