I personally run PiHole on a Raspberry Pi with it set as my DNS for network connected clients with Cloudflare as router and server-level DNS and fallback for clients. You can whitelist and blacklist whatever you want with PiHole
As already mentioned, many routers have the capability to filter Internet sites as do many DNS solutions. You certainly don't need to add hardware (although I have a software based [docker] PiHole solution as well) as I did.