aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Basic Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Basic Doubt" Watch "Basic Doubt" New topic
Author

Basic Doubt

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
InetAddress class is used to encapsulate the numerical IP Address
and the domain name.

InetAddress address = InetAddress.getByName("javaranch.com");
System.out.println("Javaranch: " + address);

the output I got was

Javaranch: javaranch.com/64.78.181.41

Doesn't this "64.78.181.41" represent an IP Address.


I copied this value "64.78.181.41" and tries like

http://64.78.181.41.com/

and I endedup getting the below.

Client error
Host name lookup for '64.78.181.41.com' failed


Someone please explain me whether this 64.78.181.41 represents an
IP Address


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
when you use the IP address you do not use the .com extension.

There is another problem in that the hosting used by javaranch apparently does not allow access by IP address only name.

so if you do type only 64.78.181.41 into a web browser it will attempt to get javaranch, but the hosting service will give you an error page.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Thank you very much.

But I got one more doubt. What u mean by



hosting used by javaranch apparently does not allow access by IP address only name.


Can u please elobarate it. And also do get me some web site that allows IP Address to access it.

Note: Is there any particular reason for not allowing IP Address to access the website
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Basic Doubt