Results 1 to 2 of 2

Thread: capturing client's hostname

  1. #1
    Join Date
    Nov 2007
    Posts
    9

    Default 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 "dyn222.222.222.222.xxxx.xxxx.com" where 222.222.222.222 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.

  2. #2
    Join Date
    Jul 2005
    Location
    Geneva (Switzerland)
    Posts
    304

    Default

    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 :
    http://aplawrence.com/Blog/B961.html
    http://en.wikipedia.org/wiki/Reverse_DNS_lookup

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •