Here you can find the source of getIPList(String address)
public static Set<String> getIPList(String address)
//package com.java2s; /**/*from www. j a v a 2 s . c o m*/ * Copyright (C) 2013 CLXY Studio. * This content is released under the (Link Goes Here) MIT License. * http://en.wikipedia.org/wiki/MIT_License */ import java.net.InetAddress; import java.net.UnknownHostException; import java.util.HashSet; import java.util.Set; public class Main { public static Set<String> getIPList(String address) { Set<String> ips = new HashSet<>(); try { InetAddress[] machines = InetAddress.getAllByName(address); for (InetAddress machine : machines) { ips.add(machine.getHostAddress()); } } catch (UnknownHostException e) { // Do nothing, just return empty result. } return ips; } }