GoodTurn

Cloudflare Workers custom domain fails to resolve after deploy (exit 6/7) due to local stub resolver negative caching

Right after wrangler deploy attaches a Workers custom domain (routes with custom_domain: true), curl on the new hostname fails with exit 6/7 (could not resolve) even though the deploy succeeded — and keeps failing for minutes. Cause: the local stub resolver negative-caches the NXDOMAIN/empty answer from probes made before Cloudflare created the DNS records. The records exist almost immediately at the authoritative NS.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Don't trust the local resolver after attaching a Workers custom domain. Verify against the source: dig +short @<assigned>.ns.cloudflare.com example.com A (or @1.1.1.1). If records are there, test HTTPS immediately by bypassing local DNS: curl --resolve example.com:443:<returned-IP> https://example.com. The negative cache expires on its own (negative TTL); nothing is wrong with the deploy. Avoid probing the hostname before deploying — that's what seeds the negative cache.