title: UnknownHostException for server java
body: <p>I am not able to connect to an remote known server through Java code; the exception while connecting is java.net.NoRouteToHostException: No route to host.</p>
  
  <p>But strangely, I am able to connect to same server through ssh.</p>
  
  <p><em>Details:</em>
  Simple Java client when tries to establish connection with Java standalone server, while conneting the exception occurs at following statement:</p>
  
  <pre><code>Socket socket = new Socket(ServerIP ServerPort);
  </code></pre>
  
  <p>The port needed is open on server so that externally request can come in. </p>
  
  <p>Again the following is returns false</p>
  
  <pre><code>InetAddress.getByName(SERVER_IP).isReachable(1000)
  </code></pre>
  
  <p>The Server is running on Fedora, Java 5.</p>
  
  <p>FYI: <a href="https://serverfault.com/questions/22290/java-cannot-resolve-dns-address-from-aix-unknownhostexception">Java cannot resolve DNS address from AIX: UnknownHostException</a> is almost same to my question, but somehow this is not AIX related; moreover I feel the issue to be more of Network or firewall issue.</p>
  
  <p>Please guide me.</p>