top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to get the IP Address of a Website in Java?

+1 vote
597 views

I want a JAVA program. That gets the website name from the user and prints the IP Address of that website.

posted Nov 27, 2016 by Jishnu Ramachandran

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Get the inetaddress of the website and get the gethostaddress, something like

InetAddress address = InetAddress.getByName("www.queryhome.com"); 
System.out.println(address.getHostAddress()); 
answer Nov 27, 2016 by Salil Agrawal
Thanks.
...