Block IPs or domains from network

I apologize if this is common knowledge, I am still a beginner user.

I would like to block malicious domains/ips from my network, preferably using external blocklists. I would like to have a good deal of control over what gets blocked.

I tried to research this problem, but the best solution I found was networking.stevenblack, which doesn’t give much control.

Is there a more customizable option? I’d like to gather my own blocklists.

I use blocky personally.

Thanks, that seems to be a wonderful solution! Exactly what I’m looking for!

Hmm…

I’m trying to use this on my laptop for use with untrusted networks, and I am having a hard time figuring out how to get it to work.

I’ve set networking.nameservers = [ "127.0.0.1" ]; and I’ve set up and configured services.blocky on port 53 (as is default)

I notice that KDE (which I am using) has its own DNS settings. Do I have to change those to reflect my NixOS settings? This seems a bit tedious…

(I’m testing if Blocky is working by visiting one of the websites I’ve redirected with services.blocky.settings.customDNS.rewrite.)