List of usage examples for java.net InetAddress getHostName
public String getHostName()
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getLoopbackAddress(); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isLoopbackAddress()); }
From source file:MainClass.java
public static void main(String[] args) { try {/*from ww w.ja v a 2 s . com*/ InetAddress ia = InetAddress.getByName("64.21.29.37"); System.out.println(ia.getHostName()); } catch (Exception ex) { System.err.println(ex); } }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isMCLinkLocal()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println("Reach: " + address.isReachable(3000)); }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isMCNodeLocal()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isMulticastAddress()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isMCOrgLocal()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isMCSiteLocal()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isLinkLocalAddress()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isSiteLocalAddress()); }