Ping Online Tool
About Ping Online Tool:
This online ping tool return ping result from Linux server. You can choose how much time to ping a domain name, and the interval between two ping query.
Ping with or without www prefix?
Notice: You need to ping with www
prefix for some (not common) domains such as www.microsoft.com
and www.quora.com
. If you have no luck with your query, try to add www.
in
the front and try again. This happens because of how the domain owners set up the DNS.
Why Ping?
Have you ever stuck long delay in a Skype conversation? Have you ever frustrated about the latency during a online game session? You definitely should test the Internet delay time from your home to the website.
Ping calculates the round-trip time (from you click a link to the content return from web server) from your home to any web server with a public IP address or a domain name. It also tells you how many packets has been transmitted, how many packets has been received, and how many packets has been loss.
For online gaming, the ping latency to the game server should be kept under 100ms
, it will be unbearable if the ping latency is over 200ms
. For regular web browsing activities, the ping
latency has less effect on
user experience. You should keep in mind, ping latency and Internet speed is 2
different concept, high latency doesn't mean you are stuck at 480p
resolution Netflix streaming, although
they are often found correlated.
There are a few ways to lower your home's ping latency, the heavy Internet traffic has negative effect on ping latency, so Internet is faster and has lower package loss rate at night compare to daytime. A more fundamental strategy is to switch your ISP (Internet service provider).
More information about Ping:
Wikipedia (ping): https://en.wikipedia.org/wiki/Ping_(networking_utility)
RFC 792 (ping): https://tools.ietf.org/html/rfc792
Ping in Linux(Ubuntu): https://linux.die.net/man/8/ping
Ping in Windows: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ping
Ping Command in Linux:
NAME ping - send ICMP ECHO_REQUEST to network hosts SYNOPSIS ping [-aAbBdDfhLnOqrRUvV46] [-c count] [-F flowlabel] [-i interval] [-I interface] [-l preload] [-m mark] [-M pmtudisc_option] [-N nodeinfo_option] [-w deadline] [-W timeout] [-p pattern] [-Q tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop ...] destination
root@instance-1:/var/log/apache2# ping -c 4 -i 1 facebook.com PING facebook.com (157.240.22.35) 56(84) bytes of data. 64 bytes from edge-star-mini-shv-01-sjc3.facebook.com (157.240.22.35): icmp_seq=1 ttl=52 time=19.1 ms 64 bytes from edge-star-mini-shv-01-sjc3.facebook.com (157.240.22.35): icmp_seq=2 ttl=52 time=18.6 ms 64 bytes from edge-star-mini-shv-01-sjc3.facebook.com (157.240.22.35): icmp_seq=3 ttl=52 time=18.9 ms 64 bytes from edge-star-mini-shv-01-sjc3.facebook.com (157.240.22.35): icmp_seq=4 ttl=52 time=18.7 ms --- facebook.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 18.697/18.857/19.102/0.189 ms
Ping IP Address or domain with Python (with package socket):
import socket import time def ping(ip_or_domain, count): for i in range(1, count): try: start_time = time.time() socket.gethostbyname(ip_or_domain) end_time = time.time() total_time = round((end_time - start_time) * 1000, 2) print('{0} is reachable: icmp_seq={1} time={2}ms'.format(ip_or_domain, i, total_time)) except socket.herror: print('{0} is NOT reachable'.format(ip_or_domain)) if __name__ == "__main__": # ping ip address ping("93.184.216.34", 4) # ping domain ping("coding.tools", 2) ------------------- 93.184.216.34 is reachable: icmp_seq=1 time=19ms 93.184.216.34 is reachable: icmp_seq=2 time=31ms 93.184.216.34 is reachable: icmp_seq=3 time=15ms 93.184.216.34 is reachable: icmp_seq=4 time=13ms coding.tools is reachable: icmp_seq=1 time=14ms coding.tools is reachable: icmp_seq=2 time=7ms
Ping IP Address or domain with Java (with package java.net.InetAddress):
import java.io.IOException; import java.net.InetAddress; public class Ping { public static void ping(String ip_or_domain, int count) throws IOException { InetAddress remote_host = InetAddress.getByName(ip_or_domain); // send ping request "count" times in total for (int i = 1; i <= count; i++) { // Sending ping request long start_time = System.currentTimeMillis(); boolean is_reachable = remote_host.isReachable(5000); long end_time = System.currentTimeMillis(); long total_time = end_time - start_time; if (is_reachable) System.out.println(ip_or_domain + " is reachable: icmp_seq=" + i + " time=" + total_time + "ms"); else System.out.println(ip_or_domain + "is NOT reachable"); } } public static void main(String[] args) throws IOException { // ping ip address ping("93.184.216.34", 4); // ping domain ping("coding.tools", 2); } } ------------------- 93.184.216.34 is reachable: icmp_seq=1 time=19ms 93.184.216.34 is reachable: icmp_seq=2 time=19ms 93.184.216.34 is reachable: icmp_seq=3 time=15ms 93.184.216.34 is reachable: icmp_seq=4 time=14ms coding.tools is reachable: icmp_seq=1 time=8ms coding.tools is reachable: icmp_seq=2 time=3ms