
New-NetFirewallRule -DisplayName "Block Web Sites" -Direction Outbound –LocalPort Any -Protocol Any -Action Block -RemoteAddress $IPAddress $IPAddress = $SitesToBlock | Resolve-DnsName -NoHostsFile | Select-Object -ExpandProperty IPAddress
UBLOCK HOW TO WHITELIST A WEBSITE WINDOWS
So you can now add a blocking rule to your Windows Firewall for multiple websites at once: New-NetFirewallRule -DisplayName "Block Site" -Direction Outbound –LocalPort Any -Protocol Any -Action Block -RemoteAddress $IPAddress $IPAddress = Resolve-DnsName ""| Select-Object -ExpandProperty IPAddress Thus, you can convert the name of the website into its IP addresses and add a block rule to the firewall settings: Resolve-DnsName ""| Select-Object -ExpandProperty IPAddress In order not to resolve the website names into IP addresses manually, you can use the Resolve-DnsName PowerShell cmdlet to get the website IP addresses: You can find it in the graphical interface of your Windows Defender Firewall.

The string “The rule was parsed successfully from the store” means that the new Firewall rule has been successfully applied. New-NetFirewallRule -DisplayName "Block Site" -Direction Outbound –LocalPort Any -Protocol Any -Action Block -RemoteAddress 104.244.42.129, 104.244.42.0/24 You can also create a Firewall rule that blocks the connection to the website using PowerShell: Using PowerShell to Create Firewall Rule to Block Website by Domain Name or IP Address It is better to filter websites on your Internet access router (gateway). In your AD domain you can deploy a Windows Firewall policy to block access to a website on user computers using GPO.
UBLOCK HOW TO WHITELIST A WEBSITE SOFTWARE
The following message will appear in your browser when trying to connect to the blocked site: Unable to connectįirewall or antivirus software may have blocked the connection Then specify the rule name and save it.Īfter that Windows Defender Firewall will block all outgoing connections to the specified website’s IP addresses. Leave all options as they are in the window with Firewall profiles the rule is applied to. In the next window, enter the IP addresses, subnets or a range of IP addresses you want to block.Ĭlick OK -> Next -> Action -> Block the connection. Scope: In the “Which remote IP addresses does this rule apply to?” section select “These IP addresses” -> Add.In the Outbound Rules section, create a new rule with the following settings: Run the Windows Defender Firewall management snap-in (Control Panel\All Control Panel Items\Windows Defender Firewall\Advanced Settings or by running firewall.cpl).

It is easier to do it using the nslookup command:Īs you can see, the command has returned several IP addresses assigned to the website. Windows Defender Firewall allows you to specify only an IP address or a subnet as a source/destination.įirst of all, you have to get the IP address of the website you want to block. The main disadvantage of this method is that you won’t be able to use the name of a domain or a website URL in the blocking rule. How to Block Website IP Address in Windows Defender Firewall?Īlso, you can block some websites using the built-in Windows Defender Firewall.
