~/bend-docscommunity

dns.bend source

dns.bend on the hub · documented module

# 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"))import Basedef resolve(host: String) -> IO(Result<&1, &1, U32 & String, String>):  import "./dns_resolve.c"  import "./dns_resolve.js"