Choose Your Language

Thursday, 11 July 2013

Java Program to find IP Address of a given site

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

1 comment: