title: How do I get the hostname of a connected client in java?
body: <p>I'm writing a server application and I want to get the hostname of the connecting client, how would I go about doing it in java?</p>
  
  <p><code>clientSocket.getInetAddress().getHostName()</code> keeps giving me the IP address instead of the hostname, what's wrong?</p>
  
  <p>where <code>ClientSocket</code> is an <code>SSLSocket</code> or <code>Socket.</code></p>