了解IP。在此服务器上找不到请求的URL [英] Understanding IP . The requested URL was not found on this server

查看:2523
本文介绍了了解IP。在此服务器上找不到请求的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是学生,我正在努力理解IP地址背后的想法。我知道输入网址与输入相应的IP地址相同 - 无论哪种方式,我们都会被定向到同一个网页。

I'm a student, and I'm trying to understand the idea behind IP addresses. I learn that typing in a url is the same as typing in the corresponding IP address - either way, we'll be directed to the same web page.

我使用 ping 命令查找的I​​P地址howstuffworks.com 。然后我在我的浏览器中键入了该IP地址(谷歌浏览器)但出现此错误:

I used the ping command to find the IP address of howstuffworks.com . I then typed that IP address in my browser ( google chrome ) but got this error :

The requested URL was not found on this server.

为什么?我尝试使用 google.com IP,但它运行正常。

Why? I tried the same with google.com IP, and it worked fine.

此外,我的IP地址使用 ping 命令找到的是IPv4(对于谷歌,它是 173.194.40.80 )。为什么它不显示IPv6地址?

Also, the IP addresses that I found using the ping command were IPv4 ( for google, it was 173.194.40.80) . Why did it not show an IPv6 address??

推荐答案

FQDN(例如www.stackoverflow.com)与IP地址之间的关系(例如198.252.206.140)不一定是一对一的关系。例如,如果我为www.stackoverflow.com进行DNS查找,我会得到198.252.206.140。因此,www.stackoverflow.com的网站托管在IP地址为198.252.206.140的Web服务器上。但是,有可能还有其他网站在198.252.206.140托管。

The relation between FQDNs (e.g. www.stackoverflow.com) and IP addresses (e.g. 198.252.206.140) is not necessarily a one-to-one relation. For instance, if I do a DNS lookup for www.stackoverflow.com, I get 198.252.206.140. So, the website for www.stackoverflow.com is hosted on a web server with the IP address 198.252.206.140. But, it's possible that there may be other web sites hosted at 198.252.206.140 as well.

这就是为什么我们有主机命令。浏览器在端口80上与Web服务器建立连接后,浏览器会发送 host 命令,以指示它尝试连接的Web服务器上的哪个站点。请参阅 http://blog.tonycode.com/ tech-stuff / http-notes / making-http-requests-via-telnet ,提供有关其工作原理的精彩教程。下面复制的是与198.252.206.140的telnet会话,其中建立了http连接,并且发出 host 命令以选择www.stackoverflow.com,并且默认响应为返回www.stackoverflow.com(在这种情况下是301重定向到stackoverflow.com):

That's why we have the Host command in the http protocol. After the browser makes a connection to the web server on port 80, the browser sends the host command to indicate which site on the web server it is attempting to connect to. See http://blog.tonycode.com/tech-stuff/http-notes/making-http-requests-via-telnet for a good tutorial on how this works. Copied below is a telnet session with 198.252.206.140, where an http connection is made, and the host command is issued to select www.stackoverflow.com, and the default response for www.stackoverflow.com is returned (which in this case is a 301 redirect to stackoverflow.com):

$ telnet 198.252.206.140 80
Trying 198.252.206.140...
Connected to 198.252.206.140.
Escape character is '^]'.
GET / HTTP/1.1
Host: www.stackoverflow.com

HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Location: http://stackoverflow.com/
Date: Tue, 04 Mar 2014 10:58:36 GMT
Content-Length: 148

<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a   
HREF="http://stackoverflow.com/">here</a></body>

这篇关于了解IP。在此服务器上找不到请求的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆