When a customer reports that a website feels slow, itβs important to isolate whether the slowness is due to DNS resolution or something else (like the web server or routing). This guide outlines how to measure DNS performance using CleanBrowsing and compare it with other DNS services using built-in tools on Windows (PowerShell), macOS (Terminal), and Linux (bash).
π¦ What Are We Testing?
We’re testing how long it takes a DNS resolver to return the IP address for a domain. This is called query time or DNS lookup latency. If CleanBrowsing takes significantly longer than other DNS resolvers (Google or Cloudflare), it may indicate:
- a network routing issue
- a cache miss
- a configuration-specific block/filter
- or, rarely, an upstream DNS resolution delay
π§° Tools Used
nslookup
β available on all platforms by default (but doesnβt show query time)dig
β available by default on macOS/Linux. On Windows, use WSL or install via BIND tools- PowerShell β built-in to all modern Windows systems
π» Operating System: DNS Testing by Platform
This section shows you how to measure DNS lookup time across platforms using the native tools available on Windows, macOS, and Linux.
πͺ Windows (PowerShell)
In this section, we use PowerShell to test the DNS resolution speed of multiple resolvers. The script captures the time it takes for each nslookup
command to complete, giving a rough estimate of DNS performance across providers.
π§ One-liner to measure DNS query times
$dnsServers = @("185.228.168.9", "185.228.168.144", "8.8.8.8", "1.1.1.1")
foreach ($dns in $dnsServers) {
Write-Host "Testing DNS: $dns"
$start = Get-Date
nslookup espn.com $dns | Out-Null
$end = Get-Date
$duration = $end - $start
Write-Host "Query time: $($duration.TotalMilliseconds) ms`n"
}
β Sample Output
Testing DNS: 185.228.168.9
Query time: 48.31 ms
Testing DNS: 185.228.168.144
Query time: 51.75 ms
Testing DNS: 8.8.8.8
Query time: 14.23 ms
Testing DNS: 1.1.1.1
Query time: 13.89 ms
π macOS (Terminal)
On macOS, the dig
command provides direct access to query time in milliseconds. We use a one-liner shell command to test CleanBrowsing, Google, and Cloudflare for a side-by-side comparison.
π§ One-liner using dig
for dns in 185.228.168.9 185.228.168.144 8.8.8.8 1.1.1.1; do echo "Testing $dns"; dig @$dns espn.com +stats | grep "Query time"; echo ""; done
β Sample Output
Testing 185.228.168.9
;; Query time: 41 msec
Testing 185.228.168.144
;; Query time: 38 msec
Testing 8.8.8.8
;; Query time: 14 msec
Testing 1.1.1.1
;; Query time: 16 msec
π§ Linux (bash shell)
Just like macOS, Linux users can use the dig
command to get precise DNS query times. The following examples show how to test a single domain across several resolvers, or multiple domains to get broader insight.
π§ One-liner for single domain
for dns in 185.228.168.9 185.228.168.144 8.8.8.8 1.1.1.1; do echo "Testing $dns"; dig @$dns espn.com +stats | grep "Query time"; echo ""; done
π§ Extended version for multiple domains
for domain in espn.com cnn.com bbc.com; do
echo "===== $domain ====="
for dns in 185.228.168.9 8.8.8.8 1.1.1.1; do
echo "DNS: $dns"
dig @$dns $domain +stats | grep "Query time"
echo ""
done
done
π‘ Tips for Interpreting Results
Use the following table to interpret the query times returned. Keep in mind that occasional high latency may be due to a cold cache, poor routing, or upstream DNS resolution delays.
Query Time | Interpretation |
---|---|
< 50ms | Excellent β very fast response |
50β150ms | Acceptable β likely normal latency |
> 150ms | Potential issue β investigate routing |
> 500ms | Clear delay β could be network or server |
Note: Some variation is normal due to caching, routing, and geography.
When a customer reports a slow-loading site, DNS is just one of many potential bottlenecks. These tests help rule in/out DNS performance as the cause. CleanBrowsing aims for sub-50ms responses globally, but routing or configuration can sometimes impact performance. These simple tools help diagnose and improve the customer experience.