You need to remove the http://
prefix.
As far as I know the InetAddress.getByName()
method takes a hostname not a URL.
You can change the code as follows:
URL url = new URL("http://www.cnn.com");
boolean res = InetAddress.getByName(url.getHost()).isReachable(10000);
System.out.println("------reachable:"+res);
However keep in mind the mechanisms the method isReachable()
uses to determine whether it is reachable or not. It uses mostly ICMP techniques, which a lot of websites or intermediate firewalls might block.