public static
InetAddress getByName(String host) throws UnknownHostException
For example,
InetAddress utopia, duke;
try {
utopia = InetAddress.getByName("utopia.poly.edu");
duke = InetAddress.getByName("128.238.2.92");
}
catch (UnknownHostException e) {
System.err.println(e);
}
// work with address....