Windows Firewall gives you a simple way to block any website URL or IP address. Here’s how to do it in simple steps.
By default, Windows doesn’t block any website or IP address and as long as you have a browser, you can access them without any restrictions whatsoever. While this is how it should work, there might be times when you need to block a specific website, URL, or IP address. For example, maybe you want to block distracting social media sites, dangerous IP addresses, and more. In those cases, you don’t have to use any third-party app. You can use the built-in Windows Firewall to block any and all unwanted websites, URLs, and IP addresses. The best thing, the entire process is pretty simple and straightforward.
So, without further ado, Here’s how to block a website URL or an IP address using Windows Firewall on Windows 11 & 10.
Before You Begin
- Administrator rights are required to configure Windows Firewall to block websites and IP addresses.
- The steps shown in this tutorial are tested to work on Windows 11 and Windows 10.
Finding the Website’s IP Address
Before you can block a website using Windows Firewall, you’ll need to find its corresponding IP address. This is because, the built-in firewall doesn’t support direct URLs or web addresses. Luckily, the nslookup
command makes finding it easy Here’s how:
- Press the “Windows key” to open the Start menu.
- Search and open “Command Prompt“.
- Run the
nslookup example.com
command while replacing “example.com” with the actual website URL. - Note down the list of IP addresses in Notepad.
- Close the Command Prompt window.

Once you have the IP address(s) of the website you want to block, proceed with the below steps to block it using Windows Firewall.
Good to know: How to block all outgoing connections using Windows Firewall
Steps to Block Website or IP Address Using Windows Firewall
- Open the Start menu.
- Search and open “Windows Defender Firewall with Advanced Security“.
- Right-click “Outbound Rules“.
- Select “New Rules“.
- Choose “Custom” and click “Next“.
- Select “All Programs” and click “Next“.
- Select “Any” from the “Protocol type” dropdown menu and click “Next“.
- Choose “These IP addresses” option under the “Remote IP Addresses” section.
- Click “Add“.
- Select “This IP address or subnet“.
- Type the IP address in the first field and click “OK“.
- Repeat steps 9 and 10 if you have multiple IP addresses to enter.
- After adding, click “Next“.
- Select “Block the connection” and click “Next“.
- Select all the checkboxes and click “Next“.
- Type a name of your choice in the “Name” field and click “Finish“.
- With that, the website/IP address is blocked in Windows.
Detailed Steps (With Screenshots)
First, we must open the Windows Firewall’s Advanced Settings. To do that, search for “Windows Defender Firewall with Advanced Security” in the Start menu and click “Open“.

In the Advanced Security window, right-click on the “Outbound Rules” option on the left panel, and select “New Rule“.

The above action opens the rule configuration wizard. Here’, select the “Custom” option and click “Next“.

Since we want to block the IP address/website system wide, choose “All Programs” and click “Next“.

In the protocol section, select “Any” from the “Protocol type” dropdown menu and click “Next“.

Now, select “Any IP address” under the “Which local IP addresses does this rule apply to” and “These IP addresses” under the “Which remote IP addresses does this rule apply to” sections.
Next, click the “Add” button under the “Which remote IP addresses does this rule apply to” section.

Select the “This IP address or subnet” option, type the IP address, and click “OK“.

If you have more IP addresses to add, repeat the above two steps. i.e., click “Add”, enter the IP address, and click “OK”.
Once you’ve added all the IP addresses, click “Next” in the configuration window.

Since we want to block access to the IP address, select the “Block the connection” option and click “Next“.

Select all the checkboxes and click “Next“. This makes sure that no matter which network profile you are using (domain, private, and public), the IP address stays blocked.

Now, enter a descriptive name for the rule in the “Name” field, and click “Finish“.

That’s it. With that, you’ve created a Windows Firewall rule to block a website or IP address.

From this point forward, anytime you try to access the blocked website/IP address, you will see the “Your internet access is blocked” error message.

If you wish to no longer block the website/IP address, simply right-click on the rule you just created in the Advanced Security window and select the “Disable Rule” option.

Wrapping Up: Blocking Website and IP Addresses Using Windows Firewall
As you can see, using the built-in firewall, you can easily create custom outbound rules to block websites or IP addresses. Keep in mind: if a website’s IP address changes, you’ll need to update the firewall rule. Otherwise, the block will no longer be effective. For blocking on multiple devices, you’ll need to configure each device individually or use your router’s blocking features. Alternatively, you can also block websites using their URLs via the hosts file.
If you have any questions or need help, comment below. I’ll be happy to assist.
Update: The tutorial is updated to simplify the steps. Also, it is tested to work in both Windows 10 & 11.
thank you for your tutorials… It is very helpful to me…
Have a nice day!
i want to block a specific website but i can’t. i tried this one but still not working…
Sometimes, websites might have multiple IP addresses. In that case, you might have to list all those IP addresses. Moreover, you also have to clear the DNS cache in Windows and your browser. You can use the “ipconfig /flushdns” command to clear the Windows DNS cache.
does the description need to add the link of the website