Ookla’s Speedtest measures the ping time to each server it operates around the world. What it lacks is the ability to run extended ping tests that the command prompt offers. With each test, it also runs a full speed test. This is incredibly bandwidth intensive if all the user wants to check is the response times to various countries or cities.
One workaround is to ping from the command line. Before we start, we first need the host name or IP address to ping.
Worldwide servers that respond to ping requests
Most Linux distributions host their downloadable files across many mirrors around the world. Unlike accessing many websites, the user can choose which server to download from, regardless of the location.
The popular Debian OS provides mirror servers in over 50 countries around the world, most of which respond to ping requests. Unlike webhosting servers, these mirror servers are in the respective countries. Just ping the FTP name, such as ‘ftp.nz.debian.org’:
Unfortunately, the list does not mention the city location of each server. This becomes an issue for large countries such as the USA, which have substantial latency variations across the country.
VPN servers that respond to ping requests
Most privacy VPN services provide the ability to evade geographic restrictions by operating VPN servers in countries around the world. For example, if a user wants to spoof its location as being in the UK, they connect to a UK server. Some VPN providers permit ping requests to all their servers, which lets the user measure the latency before using the server.
HMA claims to have servers in over 190 countries, many of which have servers in various cities. All their online servers respond to ping requests. While not as extensive as Ookla’s server list, it is by far the most extensive list of servers around the world that respond to ping requests that I’m aware of. No account is required.
This page lists all their VPN server DNS addresses, grouped by country and city. Ignore any ‘Virtual (country)’ servers, which are effectively servers running a smart DNS to reduce latency. Search the page for the country (e.g. USA) and then look for the desired city.
For example, to ping Fes in Morocco, just ping the DNS address mentioned. HMA recently named their server DNS names to end in ‘hma.rocks’, such as ‘ma.hma.rocks’ for their Moroccan server:
Unlike Ookla’s Speedtest which provides an average round trip time, we can clearly see just how erratic the latency is to Morocco from the command line.
What not to ping
One common mistake when pinging hosts is assuming a host for a specific region is in the same country. In fact, many websites use CDNs (content delivery networks) to serve content from servers nearest the user. The same host name can point to different servers, depending on the country or region where the ping request takes place. Many web hosting servers also drop ping requests, rendering them useless for ping requests.
For example, Google.ie brings up the Irish website for Google, the default website I get when I access Google.com here in Ireland. If I go to Google.ca, it brings up the Canadian website for Google. However, if we try pinging google.ca, the round-trip time is identical to pinging google.ie. In fact, both google.ca and google.ie resolve to the same IP address! This is due to Google using CDNs around the world, which serve content from servers nearest the user, regardless of which Google website one accesses.
As latency can fluctuate over time, it can be useful to monitor the round trip times over a period of time. For example, if a video conference call, VPN connection, game server, etc. experiences significant lag, start a ping test for 500 or 1000 counts immediately before using the service. It takes roughly 10 minutes per 500 pings to complete, depending on the latency and packet loss.
Check the results after using the service and look at the packet loss percentage and the average. Compare this to running the same ping test with an idle connection.
Update 25th July 2017: Updated the section on HMA servers. HMA removed the PPTP page that showed all its server IP addresses due to their recent overhaul. I replaced the link to point to a published page I came across showing the new server names.