Why not use getaddrinfo_a / getaddrinfo_async_start / GetAddrInfoExW?
Or just use some standalone DNS resolve code or library (which basically replicates getaddrinfo but supports this in an async way)?
See also here the discussion: https://github.com/crystal-lang/crystal/issues/13619