Qual è la differenza tra il ping con e senza http: //?

Sommario:

Qual è la differenza tra il ping con e senza http: //?
Qual è la differenza tra il ping con e senza http: //?

Video: Qual è la differenza tra il ping con e senza http: //?

Video: Qual è la differenza tra il ping con e senza http: //?
Video: Creare, salvare e modificare documento - WORD TUTORIAL ITALIANO 03 [Corso 2023] - YouTube 2024, Aprile
Anonim
Se stai sperimentando e imparando a fare il ping di un sito web, potresti essere sorpreso dai risultati basati su "cosa" fai ping. Il post di Q & A di SuperUser di oggi aiuta a chiarire le cose a un lettore confuso e frustrato.
Se stai sperimentando e imparando a fare il ping di un sito web, potresti essere sorpreso dai risultati basati su "cosa" fai ping. Il post di Q & A di SuperUser di oggi aiuta a chiarire le cose a un lettore confuso e frustrato.

La sessione di domande e risposte di oggi ci viene fornita per gentile concessione di SuperUser, una suddivisione di Stack Exchange, un raggruppamento di domande e risposte basato sulla comunità.

Schermata per gentile concessione di Cristianzambrano (Wikimedia Commons).

La domanda

Il lettore SuperUser Saransh Singh vuole sapere qual è la differenza tra il ping con e senza 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 è la differenza tra eseguire il ping con e senza https://?

La risposta

Il collaboratore di SuperUser DavidPostill ha la risposta per noi:

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.

Assicurati di leggere le altre risposte utili tramite il link thread condiviso qui sotto!

Hai qualcosa da aggiungere alla spiegazione? Audio disattivato nei commenti. Vuoi leggere più risposte dagli altri utenti di Stack Exchange esperti di tecnologia? Controlla la discussione completa qui.

Consigliato: