>>d:/ping_使用http://和不使用http://进行Ping之间有什么区别?

>>d:/ping

>>d:/ping

what-is-the-difference-between-pinging-with-and-without-http-00

If you are experimenting with and learning about pinging a website, you may be surprised by the results based on “what” you ping. Today’s SuperUser Q&A post helps clear things up for a confused and frustrated reader.

如果您正在尝试并学习ping网站,则基于ping的“结果”,您可能会对结果感到惊讶。 如今,SuperUser的“常见问题解答”帖子有助于使困惑和沮丧的读者了解清楚。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Screenshot courtesy of Cristianzambrano (Wikimedia Commons).

屏幕截图由Cristianzambrano(Wikimedia Commons)提供

问题 (The Question)

SuperUser reader Saransh Singh wants to know what the difference between pinging with and without http:// is:

超级用户读者Saransh Singh想知道使用http://和不使用http://进行ping之间的区别是:

I am trying to ping my website http://www.example.com/ and it resolves to an unknown IP address, then it times out.

我试图对我的网站http://www.example.com/进行ping操作,但它解析为未知的IP地址,然后超时。

what-is-the-difference-between-pinging-with-and-without-http-01

But when I ping example.com, it works. What am I missing or not understanding here?

但是,当我ping example.com时 ,它可以工作。 我在这里想念的东西是什么?

Note: example.com was substituted for the actual website at SuperUser.

注意:example.com代替了SuperUser上的实际网站。

What is the difference between pinging with and without http://?

使用http://和不使用http://进行ping之间有什么区别?

答案 (The Answer)

SuperUser contributor DavidPostill has the answer for us:

超级用户贡献者DavidPostill为我们提供了答案:

The argument to ping is a host name (or an IP address). So the following will all work:

ping的参数是主机名(或IP地址)。 所以以下所有工作:

what-is-the-difference-between-pinging-with-and-without-http-02

On the other hand, this will not work as http://www.example.com/ is an HTTP Uniform Resource Locator (URL), not a valid host name (although part of it is a host name).

另一方面,由于http://www.example.com/是HTTP 统一资源定位符(URL) ,不是有效的主机名(尽管其中一部分是主机名),因此无法使用。

what-is-the-difference-between-pinging-with-and-without-http-03

A HTTP URL is made up of 4 parts:

HTTP URL由4部分组成:

  • Scheme — Always present

    方案-始终存在
  • Host Name — Always present

    主机名-始终存在
  • Path or Stem — Always present but sometimes is null

    路径或词干-始终存在,但有时为null
  • Parameters — Optional

    参数-可选

A ping will not normally recognize URLs as a valid destination host name.

ping通常不会将URL识别为有效的目标主机名。

Note

注意

Not all URLs have the format mentioned above. A complete URL consists of a naming scheme specifier followed by a string whose format is a function of the naming scheme. The format of URLs is defined in the IETF specification Uniform Resource Locators (URLs). *This is a different website address from the one shown for URL above.

并非所有URL都具有上述格式。 完整的URL包含一个命名方案说明符,后跟一个字符串,其格式取决于命名方案。 URL的格式在IETF规范统一资源定位符(URL)中定义*这是与上面显示的URL不同的网站地址。

DNS Hijacking

DNS劫持

An exception to the above can happen if the DNS server (which resolves host names to IP addresses) is configured to return a valid IP address even if an invalid host name is supplied. This can happen if an ISP is hijacking your DNS queries.

如果将DNS服务器(将主机名解析为IP地址)配置为返回有效IP地址(即使提供了无效的主机名),也可能发生上述情况。 如果ISP劫持了您的DNS查询,则可能会发生这种情况。

From the answer Why is ping resolving to an IP 198.105.254.228 for any random host name that i type? by Michael Hampton:

从答案中,对于我键入的任何随机主机名,为什么Ping解析为IP 198.105.254.228? 迈克尔·汉普顿 ( Michael Hampton)

  • They are trying to be “helpful” by redirecting requests for nonexistent domains to a white label service that provides search results and advertising, from which everyone but you gets a cut of the revenue. Fortunately, they do have a preferences page where you can supposedly turn it off.

    他们试图通过将对不存在的域的请求重定向到提供搜索结果和广告的白标服务来“有所帮助”,除您之外的所有人都从中获利。 幸运的是,他们确实有一个首选项页面 ,您可以在其中将其关闭。

Make sure to read through the other helpful answers via the thread link shared below!

确保通过下面共享的线程链接通读其他有用的答案!



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/220804/what-is-the-difference-between-pinging-with-and-without-http/

>>d:/ping

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
http-ping是一个小型的,免费的,易于使用的Windows命令行实用程序,它可以探测给定的URL并显示相关的统计信息。 它与流行的ping工具类似,但是通过HTTP / S而不是ICMP工作,并且使用URL而不是计算机名/ IP地址。 http-ping支持IPv6地址。 http-ping提供了一组丰富的命令行选项,可以通过运行“http-ping.exe /?”来查看。从DOS提示符下: http-ping [-t] [-n count] [-i interval] [-f file-name] [-s] [-v] [-q] [-c] [-r] [-w timeout] [-p] [-d] [-o data | -of file-name] [-ua user-agent] [-h header-line] [-e | -et | -eb] [-ipv4 | -ipv6] URL Where: URL The URL you wish to check. For example, http://www.kiva.org, http://209.191.122.70, or http://www.yourhost:8080. Be sure to surround an IPv6 address with square brackets. For example, http://[2a00:1450:4007:800::1014]. Options: -t Ping the specified URL until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C. -n count Send 'count' requests. Supercedes -t. -i interval Wait 'interval' seconds between each request. There is a 1-second wait if this option is not specified. -f file-name Save responses to file 'file-name'. Please specify the full path, and use quotes around file names with spaces. -s Silent. Print no output. -v Verbose. Print detailed output. Supercedes -s. -q Quick. Perform HTTP HEAD requests instead of GETs. This will retrieve headers only, and bytes reported will be 0. -c Perform a full connection on each request; ignore keep-alive. -r Follow HTTP redirects. -w timeout Wait 'timeout' seconds for a response before timing out. Specify 0 to avoid timing out. If not specified, the default timeout is 30 seconds. -p Use the proxy defined in the Windows Internet settings. -d Print the date and time of each ping attempt. -o dat
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值