public static void main(String[] args) {
InetAddress ia;
try {
ia = InetAddress.getByName("www.baidu.com");
String ip = ia.getHostAddress();
System.out.println(ip);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}