-1

Is there anyway to ping a web domain from another location in command line ?

I found some websites who provide this kind of services but was wondering if I can do this from terminal.

Thank you.

JazZ
  • 4,469
  • 2
  • 20
  • 40

2 Answers2

1

search online ping site; for example i found helloacm

i wrote this:

#!/bin/bash
echo -e $(curl -s https://helloacm.com/api/ping/?host=${1:-"yahoo.com"})

run and output is:

/tmp$ ./siteping anubis.ir
"PING anubis.ir (5.56.133.10) 56(84) bytes of data.
64 bytes from host4.azaronline.com (5.56.133.10): icmp_seq=1 ttl=54 time=14.9 ms
64 bytes from host4.azaronline.com (5.56.133.10): icmp_seq=2 ttl=54 time=14.8 ms
64 bytes from host4.azaronline.com (5.56.133.10): icmp_seq=3 ttl=54 time=14.8 ms

--- anubis.ir ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min\/avg\/max\/mdev = 14.849\/14.888\/14.951\/0.109 ms
"

OR you can write mini php script and upload it on your site..

then run it with curl from terminal

for example see this link's link1 link2 link3

Community
  • 1
  • 1
Baba
  • 852
  • 1
  • 17
  • 31
  • Hello, thanks for this. I thought there was a way to execute the ping command from another server than localhost but it seems not. – JazZ Aug 15 '16 at 08:01
0

If the domain's server firewall allows it you can use

ping www.domain.com

Of course it's only an example, the top level domain doesn't have to be '.com' If ICMP is not allowed, you'll get timeouts.

Niels
  • 1