Get Some Free Products at your Door Step. Just feed ur Address in dis Link...!!

Tuesday, November 8, 2011

Java : Convert Ip address into domain

import java.net.InetAddress;
import java.net.UnknownHostException;

public class cnvrtIptodomain
{
public static void main(String ar[])
{
cnvrtIptodomain c = new cnvrtIptodomain();
c.start();
}
public void start()
{
try
{
InetAddress ia = InetAddress.getByName("www.google.com");
System.out.println("Address is:" +ia.getHostAddress());
InetAddress ib= InetAddress.getByAddress("74.125.236.81".getBytes());
System.out.println(ib.getHostName());
}
catch(UnknownHostException uhe)
{
System.out.println("Error:"+uhe);
}
}
}

No comments:

Post a Comment