Finding the IP Address of a given domain name.

Posted: April 13, 2012 in Java Programs

import java.net.*;
import java.util.*;
class ipcheck
{
public static void main(String g[])
{
try {
Scanner sc=new Scanner(System.in);
System.out.println(“ENTER ADDRESS “);
String add=sc.nextLine();
InetAddress address = InetAddress.getByName(add);
System.out.println(address);
}
catch (UnknownHostException e) {
System.out.println(“Could not find the address”);
}
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s