Get IP address with URL string? (Java)
Try this: InetAddress address = InetAddress.getByName(new URL(urlString).getHost()); To get the raw IP: String ip = address.getHostAddress();
Try this: InetAddress address = InetAddress.getByName(new URL(urlString).getHost()); To get the raw IP: String ip = address.getHostAddress();
The “isReachable” method has not been worthy of using for me in many cases. You can scroll to the bottom to see my alternative for simply testing if you’re online and capable of resolving external hosts (i.e. google.com) … Which generally seems to work on *NIX machines. The issue There is alot of chatter about … Read more