Resolving a Hostname try { InetAddress addr = InetAddress.getByName( "java.sun.com"); } catch (UnknownHostException e) { }