Created
June 15, 2023 19:01
-
-
Save BirkhoffLee/a92e1b4853551f4e0715b7a3faba8e21 to your computer and use it in GitHub Desktop.
Probe Cloudflare colocation for various plans
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
lookup() { | |
ips=$(dig @1.1.1.1 +short $1.cdn.cloudflare.net) | |
echo "$1:" | |
for ip in $ips; do | |
curl -s --resolve $1:443:$ip https://$1/cdn-cgi/trace | grep "colo=" | |
done | |
echo "" | |
} | |
lookup "noc.one" # Free | |
lookup "js.org" # Pro | |
lookup "nodejs.org" # Pro | |
lookup "cdnjs.com" # Pro | |
lookup "mokeedev.com" # Business | |
lookup "www.zendesk.com" # Enterprise | |
lookup "gitlab.com" # "Spectrum" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment