Tuesday, June 19, 2007

How can you get the hostname on the basis of IP addres ?

The following snippet of code helps you in finding hostname on the basis of IP address:-



InetAddress inetAddress = 
InetAddress.getByName("67.83.45.9");
System.out.println ("Host Name: " 
+ inetAddress.getHostName());

1 comments :

rams on July 15, 2011 at 8:02 AM said...

i was tried that code. i think it is wrong. I didnt got output

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2017. Reads: best tracker