Well ! i have tried the following code snippet using try -catch block statement to get ip address using its name :
try
{
java.net.InetAddress inetAdd =
java.net.InetAddress.getByName("enter the host name");
System.out.println ("IP Address is : " + inetAdd.getHostAddress());
}
catch(catch(java.net.UnknownHostException uhe)
{
//handle exception
}
In catch block, i used user-defined exception to handle the errors. Instead of coding you can also get ip by its name through online sites like http://www.ip-details.com/domain-host-search/ .