title: How to set Host Name in JAVA?
body: <p>I am trying to make a peer to peer chat application on local Network. And I need to find and list the names of online users in a list.</p>
  
  <p>We all know that the function <code>getHostName()</code> returns us the <strong>host name</strong>(DNS name) from the INetAddress. In Windows, it returns PC name. But in <strong>linux</strong> PC and <strong>android</strong> phones it <strong>returns either the IP address or random</strong> alphanumeric non user friendly String like android-xxxxxxxxxx (hope you understand). My question is that how can we <strong>set</strong> the default host name so that the <code>getHostName()</code> function <strong>returns</strong> the <strong>user friendly name</strong> that we set through our application?</p>