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 – 11 years ago
I thought it's
Onofrei
:)) – Iulian Onofrei – 8 years ago8What 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 – 11 years ago
@AndreaNobili - This is a good question. Please address Daniel's questions but I can tell you did proper research before asking this question. – Ramhound – 11 years ago
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 – 11 years agoAre you talking about the tcptraceroute tool maybe? – PlasmaHH – 11 years ago
7@FrankThomas
HTTP\1.1
? Really? – glglgl – 11 years ago@glglgl What's should he use for the protocol version? – Navin – 11 years ago
5@Navin Maybe
HTTP/1.1
... – glglgl – 11 years ago3@glglgl; what? you never put a hack where a slash should go? but you are correct, it should be a slash. – Frank Thomas – 11 years ago
@FrankThomas If I would do so, many things wouldn't work correctly, so I avoid it. – glglgl – 11 years ago
@glglgl Ah, didn't see that. It's odd that it still works with a backslash. – Navin – 11 years ago
@Navin I just noticed that at least my Apache2 accepts everything there. Even if I write
GET / WHATEVER
, it gets me the page... – glglgl – 11 years ago@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 – 11 years ago
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 – 11 years ago