Click here to Skip to main content
11,483,586 members (67,591 online)
Click here to Skip to main content

Tagged as

Determine the IP address for any website

, 17 Jul 2011 CPOL 9.6K 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

Comments and Discussions

GeneralIt shows an exception. Pin
jahart28-Oct-11 23:42
memberjahart28-Oct-11 23:42 
Generalshould there not be a semi-colon at the end of the import st... Pin
DaveAuld17-Jul-11 9:15
mentorDaveAuld17-Jul-11 9:15 
GeneralRe: I made the changes. Thanks for pointing it out.. Pin
csanuragjain17-Jul-11 23:40
membercsanuragjain17-Jul-11 23: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.150520.1 | Last Updated 18 Jul 2011
Article Copyright 2011 by csanuragjain
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid