Java tutorial
import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static void main(String args[]) { try { InetAddress inetAddr = InetAddress.getByName("www.java2s.com"); System.out.println(inetAddr.toString()); } catch (UnknownHostException ex) { } } }