Whois: fix ccTLD lookups (RDAP overrides + classic whois fallback) - #1
Merged
Conversation
Whois failed for many ccTLDs (.de, .ch, .io, .eu, .at, .dk, …) because rdap.org only knows TLDs in the IANA RDAP bootstrap, and our 502 error response was replaced by Cloudflare's bare "error code: 502" page, so users just saw "Whois lookup failed (502)". - RDAP_BOOTSTRAP_OVERRIDES: registries that run public RDAP but aren't in the bootstrap (de/ch/li via DENIC & SWITCH, io/sh/ac via Identity Digital) — verified working and parseable. - TLDs with no RDAP at all now fall back to classic whois over TCP 43 (cloudflare:sockets): whois.iana.org referral -> registry server -> raw text, rendered in a <pre> with a source note. - Upstream failures now map to 4xx (404/429/424), never 502/504, so the JSON error message survives Cloudflare and reaches the browser; the frontend shows it plus a lookup.icann.org fallback link. - Smoke tests for rdapTarget/rdapFailure/parseWhoisReferral; e2e tests for the .de override and .eu raw fallback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Whois was broken for many ccTLDs (
.de,.ch,.io,.eu,.at,.dk, …):error code: 502page — so the JSON error never reached the browser and users saw only "Whois lookup failed (502)"..com/.net/.org/.ukand IP lookups were unaffected.Fix
.de(DENIC),.ch/.li(SWITCH),.io/.sh/.ac(Identity Digital). These now return the normal parsed table..eu,.at,.dk,.se,.nz, …) now usecloudflare:sockets: querywhois.iana.orgfor the TLD's referral server, then query that server and show the raw whois text in a<pre>with a source note. Strict input validation before anything touches a socket; 64 KB cap; 10 s timeout.Testing
node tests/smoke.mjs— 255 checks pass (new coverage forrdapTarget,rdapFailure,parseWhoisReferral).node tests/e2e.mjsagainstwrangler pages dev— all 38 checks pass, including new.deoverride and.euraw-fallback cases; also manually verified.com,.at,.dk, unregistered domains, and1.1.1.1.🤖 Generated with Claude Code