Skip to content

Instantly share code, notes, and snippets.

@BirkhoffLee
Created June 15, 2023 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BirkhoffLee/a92e1b4853551f4e0715b7a3faba8e21 to your computer and use it in GitHub Desktop.
Save BirkhoffLee/a92e1b4853551f4e0715b7a3faba8e21 to your computer and use it in GitHub Desktop.
Probe Cloudflare colocation for various plans
#!/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