The desktop problem is pretty solvable for programmers. I wrote a simple bash script to add/remove blocked sites to /etc/hosts. I mapped that script to aliases 'focus' and 'distract' that block and unblock sites, respectively (requiring the root password). Finally, I set up a root cron job that runs 'focus' every hour during desired time windows (for me that's morning until late evening on Mon-Sat inclusive).
That system works exceedingly well, but I can't port it to iOS.
Right now I use Lockdown (VPN-based) with a block list and it works okay, except when I want to unlock by disabling the firewall. There's no automatic reenable option making the whole system less effective. I considered writing my own VPN-based system but haven't got around to it. Would love to see Motion tackle it.
It is not trivial to build, run, and operate a nextdns-esque service. The founders, Olivier and Romain, are some of the world's best at what they do, imo.
That said, a client-side DNS re-write solution might be relatively cheaper to implement and might even be a tad-easier than deploying an global DNS resolver with per-user custom configurations and endpoints.