import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.InetAddress;
/**
*
* @author Aravind Sankaran
*/
public class IPAddressFinder {
public static void main(String args[]) throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the site address");
String siteName=br.readLine();
System.out.println(InetAddress.getByName(siteName));
}
}
output:
enter the site address
www.facebook.com
www.facebook.com/31.13.72.33
import java.io.InputStreamReader;
import java.net.InetAddress;
/**
*
* @author Aravind Sankaran
*/
public class IPAddressFinder {
public static void main(String args[]) throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the site address");
String siteName=br.readLine();
System.out.println(InetAddress.getByName(siteName));
}
}
output:
enter the site address
www.facebook.com
www.facebook.com/31.13.72.33
Thanks
ReplyDelete