Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic Doubt

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic