You can use Java to determine the IP address of any website.
import java.net.InetAddress;
import java.net.UnknownHostException;
public class GetIPAddress {
public static void main(String[] args) {
// "google.com", "yahoo.com", "hotmail.com" etc.
String hostName = "google.com";
try {
InetAddress in = InetAddress.getByName(hostName);
System.out.println("The IP Address of site is:"
+ in.getHostAddress());
} catch (UnknownHostException e) {
System.out.println(" Invalid Host name or server is down");
}
}
}
Output
The IP Address of site is:74.125.236.81
See http://aj.sunrays.co.in/Home/networking-basics
ReplyDelete