top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

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

+1 vote
80 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.
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...