When you run the ping command with a string that is not an IP address, it first needs to resolve the IP address of the host you are attempting to ping.
When you run:
$ ping example.com
The DNS server returns the IP address of the server that hosts the website.
However when you prefix the protocol and path to create a standard http URL that is all sent to the DNS server to be resolved.
So instead of the DNS server finding the record for example.com
it looks for the record http://example.com/
which is not a valid hostname.
A lot of DNS servers will return with nothing. In that case the ping command will just error out with a DNS resolution error.
However your DNS server returns the IP address 123.456.789.000
. The address appears to be a suggestion service by Time Warner Cable to help users who mistyped the url in their browser.
But the ping command takes this literally and believes that the hostname http://example.com/
(which is not a valid hostname) resolves to the address 123.456.789.000
.
The reason the ping command times out after that is because 123.456.789.000
does not respond to ICMP requests.
ping
andgetaddrinfo()
and friends pass through slashes, didn't know that56 data bytes
is a common default, etc.: Please take this as a sign that your efforts to learn about things more before trying to help would be appreciated.