Click here to Skip to main content
Click here to Skip to main content

Tagged as

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:
import java.net.*;
 
class Addr
{
   public static void main(String args[])
   {
      try
      {
         InetAddress in=InetAddress.getByName("Enter the website here like www.google.com");
         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());
      }
   }
}

License

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

Share

About the Author

csanuragjain
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 http://www.martcode.com

Comments and Discussions

 
GeneralIt shows an exception. Pinmemberjahart28-Oct-11 22:42 
Generalshould there not be a semi-colon at the end of the import st... PinmentorDaveAuld17-Jul-11 8:15 
GeneralRe: I made the changes. Thanks for pointing it out.. Pinmembercsanuragjain17-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 | Mobile
Web01 | 2.8.141029.1 | Last Updated 18 Jul 2011
Article Copyright 2011 by csanuragjain
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid