1

The following command

ping www.yesshou.com

gives the IP address of this website as 118.126.13.10

However, while I can access this website using the URL, I cannot access it using the IP address directly. Aren't they equivalent when accessing a website?

Thank you!

3
  • 1
    there are variables there. you may happen to have a proxy in between that is not allowing connections via IP, only via URL. You need to be more specific.
    – Jorge Aldo
    Mar 27 '15 at 1:43
  • 2
    There are too many possibilities here. Without more information, we'd only be speculating. Most common cause for this is name based virtual hosting, but again, this is speculation without much much more information. Output from "curl -vkIL" for both IP and URL for example. Mar 27 '15 at 1:54
  • Thank you for your replies. Basically, using the URL returns the webpage correctly (HTTP 200) but using the IP address will timeout.
    – ZillGate
    Mar 27 '15 at 20:37
5

[http://... is a URL, not a hostname (or address.) ping should respond with unknown host]

The issue you have is due to virtual hosts. The http request will include a Host: www.yesshou.com header telling the server which site you are requesting. If you use the IP address, the server doesn't know which of the sites (potentially hundreds) you wish to access.

1
  • Thank you for your answer! I have corrected the error in the question.
    – ZillGate
    Mar 27 '15 at 1:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.