https://docs.pi-hole.net/guides/unbound/ may be one place to start if this is for a home network.
If you’re into the DoH thing, I run a service at commons.host that does not log requests/queries at all. Use the DoH URL https://commons.host in Firefox or your DoH client of choice, e.g. Dohnut can proxy DNS (udp/53) to DoH.
Couple of salient points:
– It’s a CDN with a few dozen servers worldwide. You’ll get routed to the nearest edge server, identified in the Via header.
– All the edge servers are contributed & owned by the Commons Host community. I’m just the main developer and administrator of the software and network. You could contribute a server (most are Odroids of Raspbery Pi) and I’ll manage it as part of the network. Good way to get a local managed DoH server for yourself, with other public users helping to increase your cache hit rate.
– Entire Commons Host stack is open source. You can replicate the whole CDN if you really wanted to.