import java.net.*;
public class IPLookup
{
public static void main(String args[])
{
try
{
InetAddress host;
host=InetAddress.getByName("www.yahoo.com");
System.out.println("Host IP address is " + host.getHostAddress());
}catch(UnknownHostException e)
{
System.out.println("Unable to find host");
}
}
}
There's the basic's for resolving a name to IP, you should be able to adapt
Take a look at the InetAddress class.
|