title: Get Network Computer Names
body: <p>I'm looking for a better way to get the computer names in my LAN network with Java.  I have tried:</p>
  
  <pre><code>byte[] ip = {(byte)192,(byte)168,(byte)178,(byte)1};
      for(int i=1;i&lt;255;i++)
      {
          ip[3] = (byte)i;
          try
          {
              InetAddress addr = InetAddress.getByAddress(ip);
              String s = addr.getHostName();
              System.out.println(s);
          }
          catch(UnknownHostException e)
          {
              System.out.println(e.getMessage());
          }
      }
  </code></pre>
  
  <p>... but it's too slow.  Is there any other way?</p>
  
  <p>I am on Windows.</p>
  
  <p>Any ideas are appreciated.</p>