IP-Lookup in Java.

Posted: April 13, 2012 in Java Programs

import java.net.*;

import java.util.*;

class addresscheck { public static void main (String args[])
{
try {
Scanner sc=new Scanner(System.in);
System.out.println(“ENTER IP ADDRESS “);
String ip=sc.nextLine();

InetAddress address = InetAddress.getByName(ip); System.out.println(address);
}
catch (UnknownHostException e)
{
System.out.println(“Could not find domain_name”);
}
}
}

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