After browsing for several hours, I’m completely stumped on how to prevent Windows 7 from accessing specific addresses. This is basically a blacklist program. Do I need to use a module meant for packets or something?
Edit: My goal is to block certain domains/ips across all browsers and any other apps that access the internet. So a system wide block is preferable.
Windows Firewall settings
It doesn’t mention blocking particular addresses on that page, but you can create a custom rule and under the ‘Scope’ Step, you can have it apply to certain remote IP addresses. This doesn’t really solve your problem for particular domain names (as they could have multiple IP’s) but it’s a start.
If you wanted to tie that in with your python program I believe the relevant commands are along the lines of a system command called ‘netsh’. In particular, “netsh advfirewall firewall add”, which I don’t know the arguments for.