217
49
I am not into networking, and I have the following question related to the Linux ping command.
Can I only ping an address? For example:
miner@raspberrypi ~ $ ping onofri.org
PING onofri.org (67.222.36.105) 56(84) bytes of data.
64 bytes from onofri.org (67.222.36.105): icmp_req=1 ttl=47 time=202 ms
64 bytes from onofri.org (67.222.36.105): icmp_req=2 ttl=47 time=206 ms
64 bytes from onofri.org (67.222.36.105): icmp_req=3 ttl=47 time=215 ms
Or can I also ping an address:port, for example: onofri.org:80?
If I try this one it doesn't work:
miner@raspberrypi ~ $ ping onofri.org:80
ping: unknown host onofri.org:80
Is it possible ping something like address:port? If it is possible, why doesn't what I tried work?
I think you have a misunderstanding about what a port is. When you're told that a web server is listening on port 80, that means TCP port 80. There's isn't some notion of an IP and port apart from the protocol involved. – David Schwartz – 2014-06-21T08:01:44.807
I thought it's
Onofrei
:)) – Iulian Onofrei – 2017-03-25T16:55:11.7878What are you trying to accomplish? Verifying correct service operation requires you to actually query the service and evaluate the response. A web server, could, for example, accept your connection, but return an error because of misconfiguration. – Daniel B – 2014-06-16T18:36:59.820
@AndreaNobili - This is a good question. Please address Daniel's questions but I can tell you did proper research before asking this question. – Ramhound – 2014-06-16T18:43:14.687
5Thats part of what I like about Telnet. you can connect to a webserver, and type
GET /index.html HTTP\1.1
and see the 200 response (or error code) along with the resultant markup. – Frank Thomas – 2014-06-16T18:45:15.047Are you talking about the tcptraceroute tool maybe? – PlasmaHH – 2014-06-16T21:13:42.530
7@FrankThomas
HTTP\1.1
? Really? – glglgl – 2014-06-17T09:08:05.090@glglgl What's should he use for the protocol version? – Navin – 2014-06-17T10:11:17.997
5@Navin Maybe
HTTP/1.1
... – glglgl – 2014-06-17T11:40:04.3903@glglgl; what? you never put a hack where a slash should go? but you are correct, it should be a slash. – Frank Thomas – 2014-06-17T11:45:18.133
@FrankThomas If I would do so, many things wouldn't work correctly, so I avoid it. – glglgl – 2014-06-17T11:54:25.270
@glglgl Ah, didn't see that. It's odd that it still works with a backslash. – Navin – 2014-06-17T13:06:30.890
@Navin I just noticed that at least my Apache2 accepts everything there. Even if I write
GET / WHATEVER
, it gets me the page... – glglgl – 2014-06-17T13:20:14.480@glglgl Try it with the non-default host on a name-based virtual hosting setup. It likely won't work as well there. My guess would be that Apache is falling back to HTTP 1.0 behavior when it doesn't recognize the protocol specifier. – a CVn – 2014-06-17T16:40:51.153
1@MichaelKjörling It seems that even with a wrong protocol specifier,
Host:
is correctly evaluated. And, tested with a WSGI test page, it seems that the wrong protocol specifier even makes its way toenviron['SERVER_PROTOCOL']
. – glglgl – 2014-06-18T13:28:55.617