Java Examples
Java ExamplesPrograms with output

Java Program to Find hostname from IP Address

public class HostName {
    public static void main(String[] argv) throws Exception {
		InetAddress ipAddr = InetAddress.getByName("");
		System.out.println("Host name: "+ipAddr.getHostName());
		System.out.println("Ip address: "+ ipAddr.getHostAddress());
Host name:
Ip address:

Share this page on:

Was this page helpful ?

Let us know how we did!

Subscribe Email Updates

to get latest update