Feb 19th, 2008, 12:03 AM
capturing client's hostname
I'm having trouble capturing the clients hostname.
I'm trying to use the HTTPServletRequest.getRemoteHost() method to capture the clients host name. But I always get the dotted ip format which goes like "dyn184.108.40.206.xxxx.xxxx.com" where 220.127.116.11 is some ip address on the xxxx.xxxx.com domain.
is it possible to capture the clients true hostname?
FYI, the web application is run on the same LAN network as the computers that i'm trying to capture the hostname from.
Feb 19th, 2008, 02:01 AM
The only thing that you actually get from the client is its IP address. The hostname is retrieved via a reverse DNS query. So the hostname you will get depends on the configuration of your DNS. In your case, it seems that the clients get their IP addresses from DHCP. This means that it will be quite hard to associate a "real" hostname with a specific IP ...
More info :