Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String host = args[0].split("/")[0];
- String ipAddress = args[0].split("/")[1];
- // InetAddress address1 = InetAddress.getByAddress(host, ipAddress.getBytes());
- // System.out.printf("Looking up %s -> %s/%s%n", args[0], address1.getHostName(), address1.getHostAddress());
- // System.out.printf(String.format("Is reacheable for %s: %s%n", address1.getHostName(), address1.isReachable(1000)));
- InetAddress[] addresses = InetAddress.getAllByName(host);
- for (InetAddress address : addresses ) {
- System.out.printf("Looking up %s -> %s/%s%n", args[0], address.getHostName(), address.getHostAddress());
- System.out.printf(String.format("Is reacheable for %s: %s%n", address.getHostName(), address.isReachable(1000)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement