frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Async DNS

https://flak.tedunangst.com/post/async-dns
65•todsacerdoti•3h ago

Comments

albertzeyer•2h ago
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

frumplestlatz•1h ago
I am always amused when folks rediscover the bad idea that is `pthread_cancel()` — it’s amazing that it was ever part of the standard.

We knew it was a bad idea at the time it was standardized in the 1990s, but politics — and the inevitable allure of a very convenient sounding (but very bad) idea — meant that the bad idea won.

Funny enough, while Java has deprecated their version of thread cancellation for the same reasons, Haskell still has theirs. When you’re writing code in IO, you have to be prepared for async cancellation anywhere, at any time.

This leads to common bugs in the standard library that you really wouldn’t expect from a language like Haskell; e.g. https://github.com/haskell/process/issues/183 (withCreateProcess async exception safety)

AndyKelley•54m ago
What's crazy is that it's almost good. All they had to do was make the next syscall return ECANCELED (already a defined error code!) rather than terminating the thread.

Musl has an undocumented extension that does exactly this: PTHREAD_CANCEL_MASKED passed to pthread_setcancelstate.

It's great and it should be standardized.

paulddraper•37m ago
IO can fail at any point though, so that’s not particularly bad.
kccqzy•33m ago
It’s extremely easy to write application code in Haskell that handles async cancellation correctly without even thinking about it. The async library provides high level abstractions. However your point is still valid as I do think if you write library code at a low level of abstraction (the standard library must) it is just as error prone as in Java or C.
javantanna•2h ago
Just curious how you approached performance bottlenecks — anything surprising you discovered while testing?
01HNNWZ0MV43FF•2h ago
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.
frumplestlatz•1h ago
it’s a weird problem, in that (1) DNS is hard, and (2) you really need the upstream vendor to solve the problem, because correct applications want to use the system resolver.

If you don’t use the system resolver, you have to glue into the system’s configuration mechanism for resolvers somehow … which isn’t simple — for example, there’s a lot of complex logic on macOS around handling which resolver to use based on what connections, VPNs, etc, are present.

And the there’s nsswitch and other plugin systems that are meant to allow globally configured hooks plug into the name resolution path.

AndyKelley•13m ago
(1) DNS is hard

It's really not.

Just because some systems took something fundamentally simple and wrapped a bunch of unnecessary complexity around it does not make it hard.

At its core, it's an elegant, minimal protocol.

benatkin•2h ago
Another related article: https://ziglang.org/devlog/2025/#2025-10-15
brcmthrowaway•57m ago
Who can fix getaddrinfo?
AndyKelley•33m ago
There are steps that three different parties can take, which do not depend on other parties to cooperate:

POSIX can specify a new version of DNS resolution.

libcs can add extensions, allowing applications to detect when they are targeting those systems and use them.

Applications on Linux and Windows can bypass libc.

btown•49m ago
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
petcat•12m ago
gevent. Man that's a blast from the past
dweekly•10m ago
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!

AaronFriel•5m ago
A lot of folks think this, but did you also implement EDNS0?

The golang team also thought DNS clients were simple, and it led to almost ten years of difficult to debug panics in Docker, Mesos, Terraform, Mesos, and countless other services and CLI tools written in Go. (Search "cannot unmarshal DNS message" and marvel at the thousands of forum threads and GitHub issues that all bottom out at Go implementing the original DNS spec and not following later updates.)

SQLite JSON at Full Index Speed Using Generated Columns

https://www.dbpro.app/blog/sqlite-json-virtual-columns-indexing
257•upmostly•6h ago•86 comments

Async DNS

https://flak.tedunangst.com/post/async-dns
66•todsacerdoti•3h ago•16 comments

4 billion if statements (2023)

https://andreasjhkarlsson.github.io//jekyll/update/2023/12/27/4-billion-if-statements.html
484•damethos•6d ago•142 comments

CM0 – a new Raspberry Pi you can't buy

https://www.jeffgeerling.com/blog/2025/cm0-new-raspberry-pi-you-cant-buy
99•speckx•5h ago•10 comments

String Theory Inspires a Brilliant, Baffling New Math Proof

https://www.quantamagazine.org/string-theory-inspires-a-brilliant-baffling-new-math-proof-20251212/
54•ArmageddonIt•3h ago•39 comments

Benn Jordan's flock camera jammer will send you to jail in Florida now [video]

https://www.youtube.com/watch?v=qEllWdK4l_A
94•givemeethekeys•1h ago•64 comments

Google Releases Its New Google Sans Flex Font as Open Source

https://www.omgubuntu.co.uk/2025/11/google-sans-flex-font-ubuntu
91•CharlesW•2h ago•27 comments

Epic celebrates "the end of the Apple Tax" after court win in iOS payments case

https://arstechnica.com/tech-policy/2025/12/epic-celebrates-the-end-of-the-apple-tax-after-appeal...
215•nobody9999•4h ago•118 comments

Fedora: Open-source repository for long-term digital preservation

https://fedorarepository.org/
81•cernocky•6h ago•38 comments

Home Depot GitHub token exposed for a year, granted access to internal systems

https://techcrunch.com/2025/12/12/home-depot-exposed-access-to-internal-systems-for-a-year-says-r...
64•kernelrocks•1h ago•34 comments

Id Software devs form "wall-to-wall" union

https://www.rockpapershotgun.com/id-software-devs-form-wall-to-wall-union-with-165-workers-at-doo...
216•simjue•2h ago•170 comments

Bit flips: How cosmic rays grounded a fleet of aircraft

https://www.bbc.com/future/article/20251201-how-cosmic-rays-grounded-thousands-of-aircraft
17•signa11•4d ago•14 comments

From text to token: How tokenization pipelines work

https://www.paradedb.com/blog/when-tokenization-becomes-token
90•philippemnoel•1d ago•18 comments

Open Sourcing the Remix Store

https://remix.run/blog/oss-remix-store
7•doppp•3d ago•0 comments

BpfJailer: eBPF Mandatory Access Control [pdf]

https://lpc.events/event/19/contributions/2159/attachments/1833/3929/BpfJailer%20LPC%202025.pdf
41•voxadam•6h ago•4 comments

Google de-indexed Bear Blog and I don't know why

https://journal.james-zhan.com/google-de-indexed-my-entire-bear-blog-and-i-dont-know-why/
382•nafnlj•19h ago•163 comments

The tiniest yet real telescope I've built

https://lucassifoni.info/blog/miniscope-tiny-telescope/
225•chantepierre•12h ago•58 comments

Japan law opening phone app stores to go into effect dec.18th

https://www3.nhk.or.jp/nhkworld/en/news/20251210_B1/
69•shlip•3h ago•13 comments

Nuclear energy key to decarbonising Europe, says EESC

https://www.eesc.europa.eu/en/news-media/news/nuclear-energy-key-decarbonising-europe-says-eesc
41•mpweiher•2h ago•27 comments

Guarding My Git Forge Against AI Scrapers

https://vulpinecitrus.info/blog/guarding-git-forge-ai-scrapers/
133•todsacerdoti•12h ago•85 comments

Show HN: Tripwire: A new anti evil maid defense

https://github.com/fr33-sh/Tripwire
67•DoctorFreeman•1d ago•37 comments

Koralm Railway

https://infrastruktur.oebb.at/en/projects-for-austria/railway-lines/southern-line-vienna-villach/...
284•fzeindl•9h ago•165 comments

Windows 3.1 'Hot Dog Stand' color scheme true story

https://www.pcgamer.com/software/windows/windows-3-1-included-a-red-and-yellow-hot-dog-stand-colo...
22•naves•1h ago•0 comments

He set out to walk around the world. After 27 years, his quest is nearly over

https://www.washingtonpost.com/lifestyle/2025/12/05/karl-bushby-walk-around-world/
220•wallflower•5d ago•191 comments

Octo: A Chip8 IDE

https://github.com/JohnEarnest/Octo
68•tosh•6d ago•10 comments

Show HN: tomcp.org – Turn any URL into an MCP server

https://github.com/Ami3466/tomcp
32•ami3466•3h ago•10 comments

Training LLMs for Honesty via Confessions

https://arxiv.org/abs/2512.08093
56•arabello•9h ago•34 comments

The Tor Project is switching to Rust

https://itsfoss.com/news/tor-rust-rewrite-progress/
295•giuliomagnifico•7h ago•205 comments

Microservices Should Form a Polytree

https://bytesauna.com/post/microservices
62•mapehe•4d ago•68 comments

Framework Raises DDR5 Memory Prices by 50% for DIY Laptops

https://www.phoronix.com/news/Framework-50p-DDR5-Memory
121•mikece•4h ago•108 comments