Click here to Skip to main content
12,888,493 members (51,473 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


3 bookmarked
Posted 17 Jul 2011

Determine the IP address for any website

, 17 Jul 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
How to determine the IP address for a website in Java.
You can use Java to determine the IP address of any website.

A sample Java program:
class Addr
   public static void main(String args[])
         InetAddress in=InetAddress.getByName("Enter the website here like");
         System.out.println("The ip Address of site is:"+in.getHostAddress());
      catch(Exception e)
System.out.println("Some Exception has occurred with details"+e.getMessage());


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
India India
I am a Java software developer. I like to make new software which can be helpful to people. You may get in touch with me at

You may also be interested in...

Comments and Discussions

GeneralIt shows an exception. Pin
jahart28-Oct-11 22:42
memberjahart28-Oct-11 22:42 
Generalshould there not be a semi-colon at the end of the import st... Pin
DaveAuld17-Jul-11 8:15
mentorDaveAuld17-Jul-11 8:15 
GeneralRe: I made the changes. Thanks for pointing it out.. Pin
csanuragjain17-Jul-11 22:40
membercsanuragjain17-Jul-11 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170424.1 | Last Updated 18 Jul 2011
Article Copyright 2011 by csanuragjain
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid