Skip to content

Instantly share code, notes, and snippets.

@paulogdm
Last active May 30, 2026 22:21
Show Gist options
  • Select an option

  • Save paulogdm/93cf32684383a42fa1414649271c9c7a to your computer and use it in GitHub Desktop.

Select an option

Save paulogdm/93cf32684383a42fa1414649271c9c7a to your computer and use it in GitHub Desktop.
Useful `dig` and `curl` commands
# Query any record
dig A paulogdm.com
dig NS paulogdm.com
dig CNAME www.paulogdm.com
# Query any record using a specific DNS resolver
dig A paulogdm.com @1.1.1.1
dig A paulogdm.com @8.8.8.8
# Query record with a trace of the DNS resolution
dig NS paulogdm.com @1.1.1.1 +trace
# Get headers
curl https://paulogdm.com -I
# Get a specific header
curl https://paulogdm.com -I | grep etag
# Chain / Redirects
curl https://paulogdm.com -ILs # Headers for every hop
curl https://paulogdm.com -L -o /dev/null -s -w '%{url_effective}\n' # Final URL
# Make a POST request
curl -d '{"key1":"value1"}' -H "Content-Type: application/json" -X POST http://paulogdm.com/api
# Check if SSL is working as expected from the Vercel server
# Useful for "Zero Downtime" migrations.
curl https://paulogdm.com --resolve paulogdm.com:443:76.76.21.21 -I
curl https://paulogdm.com -L -o /dev/null -s -w '%{url_effective}\n' # Final URL
# Timing
curl https://paulogdm.com -v # Full request + response trace
curl https://paulogdm.com -o /dev/null -s -w \
'dns:%{time_namelookup}s connect:%{time_connect}s ttfb:%{time_starttransfer}s total:%{time_total}s\n'
# Zero-Downtime Migration Checks
# Check that SSL/HTTPS works on the new server (e.g. Vercel: 76.76.21.21)
curl https://paulogdm.com --resolve paulogdm.com:443:76.76.21.21 -I
# Same idea for plain HTTP
curl http://paulogdm.com --resolve paulogdm.com:80:76.76.21.21 -I
@naserjr23

Copy link
Copy Markdown

``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment