Click here to Skip to main content
11,790,613 members (52,404 online)
Click here to Skip to main content

Tagged as

Determine the IP address for any website

, 17 Jul 2011 CPOL 10.7K 3
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
India India
I am a Java software developer. I like to make new software which can be really 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    Rant Rant    Admin Admin   

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

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1509028.1 | Last Updated 18 Jul 2011
Article Copyright 2011 by csanuragjain
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid