> Most of the speed-ups come thanks to caching anyway.
I'm afraid you trivially dismiss how hard this is.
For e2e response times as low as 10s from any ___location, one needs a global footprint behind an anycast network. Both these things aren't easy to do (on your own), especially for something as ubiquitous as name resolution which needs near 100% uptime and consistently low latencies.
Fast isn't the only thing here though, nextdns provides custom configuration and logging over multiple endpoints (including ipv4) served from 33 points of presence. I'm sure keeping lights on with this setup gets tricky pretty quick, let alone implementing features at the pace that they have been. Romain Contepas and Olivier Poitrus are the only reasons nextdns is what it is-- They are world-class experts in building such systems.
> I'm afraid you trivially dismiss how hard this is.
I ask, in what world do you have "slow DNS"? The choices out there is ISP run which virtually always low latency, an anycast run service, or running your own.
I don't care what technology you throw at the problem or who designed it, there really isn't "slow DNS", just bad choices of DNS servers that incur a round-trip latency penalty. I will assert again what keeps DNS "fast" is the aggressive caching of responses.