Skip to content

Run DNS/IP diagnostics even when IP range lookup fails#10

Open
justinvitale wants to merge 1 commit into
mainfrom
diagnose-on-range-lookup-failure
Open

Run DNS/IP diagnostics even when IP range lookup fails#10
justinvitale wants to merge 1 commit into
mainfrom
diagnose-on-range-lookup-failure

Conversation

@justinvitale
Copy link
Copy Markdown

Summary

  • When the IP range lookup returns Not on Vercel, DNS lookup failed, or an API error/empty response, the script previously exited immediately and reported nothing useful, even though these outcomes often indicate DNS-level hijacking by the local network or ISP.
  • Replace the early return/exit with a range_lookup_failed flag that skips only the per-IP reachability loop (which needs a valid IP range), and let the rest of the script run so we still capture:
    • Reporter's public IP + ASN/org via ipinfo.io
    • Local DNS resolution (nslookup -debug / dig) to reveal any hijacked IPs
    • Public DNS resolution via 8.8.8.8 for comparison
    • Final curl -svk https://$domain to capture the intercepting cert/headers/body
  • Move the start timestamp above the lookup so the Time elapsed line still computes correctly on the failure path.
  • Applied to both vercel-debug.ps1 and vercel-debug.sh to keep them in sync.

Test plan

  • bash -n vercel-debug.sh passes.
  • Successful domain: output is unchanged aside from whitespace/comment tweaks.
  • Failing domain (Not on Vercel): script prints the failure reason, skips the per-IP tests, and continues through IP info, DNS lookups, and the final curl.

A 'Not on Vercel' or 'DNS lookup failed' response often indicates
DNS-level hijacking by the local network or ISP, but the script
previously exited early and reported nothing actionable. Skip only
the per-IP reachability tests on failure and continue running the
reporter IP/ASN lookup, local + public DNS resolution, and the
domain response capture so the actual interception can be
investigated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant