InetAddress: getByName(String host) : InetAddress « java.net « Java by API






InetAddress: getByName(String host)

  

 
import java.net.InetAddress;

public class MainClass {

  public static void main(String[] args) {

    try {
      InetAddress ia = InetAddress.getByName("64.21.29.37");
      System.out.println(ia.getHostName());
    } catch (Exception ex) {
      System.err.println(ex);
    }

  }

}

   
    
  








Related examples in the same category

1.InetAddress: getAllByName(String name)
2.InetAddress: getCanonicalHostName()
3.InetAddress: getHostAddress()
4.InetAddress: getHostName()
5.InetAddress: getLocalHost()
6.InetAddress: isReachable(int timeout)