Qual é a diferença entre ping com e sem http: //?

Índice:

Qual é a diferença entre ping com e sem http: //?
Qual é a diferença entre ping com e sem http: //?

Vídeo: Qual é a diferença entre ping com e sem http: //?

Vídeo: Qual é a diferença entre ping com e sem http: //?
Vídeo: Aula 2 - Como Salvar e Abrir documento no Word - YouTube 2024, Maio
Anonim
Se você está experimentando e aprendendo sobre o ping de um site, você pode se surpreender com os resultados baseados em "o que" você pingar. O post de perguntas e respostas do SuperUser de hoje ajuda a esclarecer as coisas para um leitor confuso e frustrado.
Se você está experimentando e aprendendo sobre o ping de um site, você pode se surpreender com os resultados baseados em "o que" você pingar. O post de perguntas e respostas do SuperUser de hoje ajuda a esclarecer as coisas para um leitor confuso e frustrado.

A sessão de perguntas e respostas de hoje nos é oferecida por cortesia do SuperUser, uma subdivisão do Stack Exchange, um agrupamento de sites de perguntas e respostas conduzido pela comunidade.

Imagem cedida por Cristianzambrano (Wikimedia Commons).

A questão

SuperUser reader Saransh Singh quer saber qual a diferença entre o ping com e sem https:// é:

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

Image
Image

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

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

Qual é a diferença entre o ping com e sem https://?

A resposta

DavidPostill, colaborador do SuperUser, tem a resposta para nós:

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

Image
Image

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

A HTTP URL is made up of 4 parts:
A HTTP URL is made up of 4 parts:
  • Scheme - Always present
  • Host Name - Always present
  • Path or Stem - Always present but sometimes is null
  • Parameters - Optional

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

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.

DNS Hijacking

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.

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:

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.

Certifique-se de ler as outras respostas úteis através do link de discussão compartilhado abaixo!

Tem algo a acrescentar à explicação? Som desligado nos comentários. Quer ler mais respostas de outros usuários do Stack Exchange com experiência em tecnologia? Confira o tópico de discussão completo aqui.

Recomendado: