Java Example Programs – Find IP Address of any host Using Java


Hi, Welcome to Practice House. In this post, we will learn how to find an IP address of your computer that you are using and also what is the hostname of this computer by writing a java program.

It’s a simple Java Program. We use class to find out an IP address for any hostname. it could your website or your computer.

Below we showed you two example of using Class

Find IP Address and Hostname of Your Computer

Sample Output:


In Java using InetAddress Class, We can find out any domains IP address by writing a very simple program.
The below Example is showing how to get the IP address of

Find the IP Address for the Domains / Websites

Sample output:

Download the Project



Congratulations, now you can write a java program to find out the IP address of any computer and for any other websites. So share with your friends how you learn and teach them also.

Leave a Reply

Notify of