To block all browsers from accessing certain websites on a Windows Server 2019 machine using the Windows Firewall, you can follow these steps:
How To Block All Browsers From Accessing Certain Websites
1. Open the Windows Defender Firewall with Advanced Security by typing “Windows Defender Firewall” in the Start menu search bar and selecting it from the search results.
2. Click on “Inbound Rules” in the left pane.
3. Click on “New Rule” in the right pane.
4. Select “Custom” and click “Next”.,
5. Select “All Programs” and click “Next”.
6. Select “Protocol type” and choose”TCP” and click “Next”.
7. Select “Local port” and enter “80” and “443” as the port numbers (these are the default ports used for HTTP and HTTPS traffic) and click “Next”.
8. Select “Block the connection” and click “Next”.
9. Leave all checkboxes checked and click “Next”.
10. Give the rule a name (e.g. “Block website.com”) and click “Finish”.
11. Open the rule “Scope” tab and enter the IP’s of websites you want to block and hit apply.
Conclusion:
This will create a firewall rule that blocks incoming traffic on ports 80 and 443 (used by most web browsers for HTTD and HTTPS traffic) for the specified websites. This should effectively block access to the websites from any browser on the Windows Server 2019 machine.
Note: This method will only work on the machine where the firewall rule has been created. To apply this to multiple machines on a network, you will need to create the same firewall rule on each machine individually or use a different method such as modifying the DNS settings or using a proxy server.