logoalt Hacker News

Async DNS

117 pointsby todsacerdotiyesterday at 4:52 PM39 commentsview on HN

Comments

albertzeyeryesterday at 5:50 PM

The first linked article was recently discussed here: RIP pthread_cancel (https://news.ycombinator.com/item?id=45233713)

In that discussion, most of the same points as in this article were already discussed, specifically some async DNS alternatives.

See also here the discussion: https://github.com/crystal-lang/crystal/issues/13619

show 1 reply
dweeklyyesterday at 8:10 PM

I was able in an afternoon to implement a pretty decent completely async Swift DNS resolver client for my app. DNS clients are simple enough to build that rolling your own async is not a big deal anymore.

Yes, there is separate work to discern what DNS server the system is currently using: on macOS this requires a call to an undocumented function in libSystem - that both Chromium and Tailscale use!

show 2 replies
btownyesterday at 7:31 PM

For those using it in Python, Gevent provides a pluggable set of DNS resolvers that monkey-patch the standard library's functions for async/cooperative use, including one built on c-ares: https://www.gevent.org/dns.html

show 1 reply
cryptonectortoday at 3:02 AM

I'm digging dns.c and asr. I might get dns.c building and use it.

javantannayesterday at 6:04 PM

Just curious how you approached performance bottlenecks — anything surprising you discovered while testing?

brcmthrowawayyesterday at 7:23 PM

Who can fix getaddrinfo?

show 1 reply
01HNNWZ0MV43FFyesterday at 6:09 PM

It's weird to me that event-based DNS using epoll or similar doesn't have a battle-tested implementation. I know it's harder to do in C than in Rust but I'm pretty sure that's what Hickory does internally.

show 2 replies
jupp0rtoday at 12:09 AM

libuv? libevent?