Java tutorial
import java.net.InetAddress; import java.net.Socket; public class Main { public static void main(String[] args) throws Exception { InetAddress addr; Socket sock = new Socket(args[0], 80); addr = sock.getInetAddress(); System.out.println("Connected to " + addr); sock.close(); } }