For those interested I've posted an initial implementation of the ip-name-lookup
interface to https://github.com/bytecodealliance/wasmtime/issues/7070. The implementation and tests are pretty bare bones for now as I mostly wanted to set up the plumbing of types and bindgen and all that.
@Badeend (sorry for the ping both on github and here) I suspect you have an implementation already in mind and/or a test suite already in mind, and I'd be happy to switch implementations and/or fill out tests as well, so was wondering if you do indeed already have these things in mind to share here. If not, no worries!
I'm developing a tool which will perform DNS lookups. I could write it directly in Rust, however I'd like to target a wasm+wasi environment if possible. I require two features: 1. To resolve name => [ipv4|6] address(es), 2. To obtain the associated TTL for the record. Will both be offered by Preview 2?
Currently wasi:sockets/ip-name-lookup
can perform translation to ip addresses, but I don't believe it currently has information about TTL. If you're interested in that I think it'd be good to open an issue on the wasi-sockets repository
https://github.com/WebAssembly/wasi-sockets/issues/65#issuecomment-1757809815 provided an update and answer to my feature request. ""TTL" is a concept specific to DNS and ip-name-lookup is not a DNS API."... "If you need access to the TTL value, the only option available in WASI right now is to perform the UDP communication yourself."
Last updated: Nov 22 2024 at 17:03 UTC