Hi, I am using the bt methods above, the getHostName () method does not return the host name of the given ip.
see code:
try { // This is ip of tutorialspoint.com InetAddress addr2 = InetAddress.getByName("127.64.84.2"); op.setText("Host name is: "+addr2.getHostName()); } catch ( UnknownHostException e3) { op.setText("Error: Host not found" + e3); }
source share