Resolving ip-address of a hostname

Posted in :

Take a look at InetAddress and the getHostAddress() method.

InetAddress address = InetAddress.getByName("www.example.com"); 
System.out.println(address.getHostAddress()); 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *