dns.bend relies on unsafe/foreign
raw source on the hub · import 0xf45a7ca0255c5a863fba26e24971a8e0/dns.bend as Dns
DNS: one IPv4 dotted quad via getaddrinfo. A numeric host is Base's shared canonical-quad rule (no leading zeros). A name looks up through getaddrinfo on both lanes (JS via bun:ffi, blocking; C on a helper thread), so /etc/hosts and search domains apply. TCP.connect stays numeric — compose with IO.try.
import 0x…/dns.bend as DNS ip : String <- IO.try(String, DNS.resolve("example.com"))
1 import
import Base
Effects (foreign code)
effect resolve source · line 11 · raw
@host:String -> IO(Result<&1, &1, Pair(U32, String), String>)
foreign: dns_resolve.c, dns_resolve.js