IPv4 and IPv6
Your database's hostname is crucial for establishing a direct connection. It resolves to the underlying IP address of your database.
Today we are solving the one and only “could not translate host name” error — the symptom when your stack and Supabase’s network don’t match.
Often the missing piece is IPv6 vs IPv4.
Section 1 — The problem
IPv4 looks like four groups of numbers (older standard). IPv6 is longer — more space, same job: identify a host on the network.
Dotted decimal · familiar tooling
Hex groups · the replacement
Why it matters
There are about 4.3 billion possible IPv4 addresses. IPv6 was designed for a vastly larger space. (Bar lengths are conceptual, not to scale.)
We’ve largely run out of free IPv4 — carriers and clouds still ship a lot of IPv4-only paths.
Incompatibility
An IPv4-only machine cannot open a socket to an IPv6-only destination — formats and routing don’t line up. Same job, incompatible wires.
Incompatibility
Supabase
Supabase’s direct database hostname resolves to an IPv6 address by default. If your server or network is IPv4-only, the connection attempt fails.
Section 2 — Diagnose
Check 1: Does this machine speak IPv6? Check 2: What does DNS say for the database host — AAAA vs A?
curl -6 https://ifconfig.co/ip — see if you get an IPv6 route.nslookup -type=AAAA db.[ref].supabase.co — IPv6 record.nslookup -type=A db.[ref].supabase.co — IPv4 record (may be empty without add-on).You can also use test-ipv6.com in a browser.
Animated example
Click a scenario to animate sample CLI output — useful for B-roll or live demo.
Section 3 — Fixes
If your system doesn’t support IPv6, pick one of these (often pooler or SDK first).
Fixes 1 & 2
Supavisor connection strings use an IPv4-compatible pooler. supabase-js (and friends) talk to the project URL over HTTPS — not a direct Postgres wire connection.
Pooler (example)
Client SDK
Fix 3
Enable Dedicated IPv4 under Project Settings → Add-ons (paid plan, about $4/mo). For db.[ref].supabase.co, DNS is updated so the hostname targets your dedicated IPv4. In practice, AAAA may return no answer after that — that is expected, not a broken IPv6 stack.
Example ref cqesudmnzjvyhffjvipn — your output may vary slightly by resolver.
Fix 4
Many cloud providers support IPv6 but leave it off by default. If your VPC, subnet, or load balancer can get a public IPv6 address, enabling it gives your workloads a native path to IPv6-only endpoints — including the direct DB host.
Check your provider’s docs for “IPv6” or dual-stack VPC — naming varies.
Section 4 — Summary
If you’re on IPv4-only: use the pooler, use SDKs, pay for the IPv4 add-on, or enable IPv6 where you deploy.
That’s the IPv4 and IPv6 story: two commands to diagnose, several ways to fix it.