Home » How To » How to Block Website or IP Address in Windows Firewall

How To Block Website or IP Address Using Windows Firewall

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:

  1. Press the “Windows key” to open the Start menu.
  2. Search and open “Command Prompt“.
  3. Run the nslookup example.com command while replacing “example.com” with the actual website URL.
  4. Note down the list of IP addresses in Notepad.
  5. Close the Command Prompt window.
use nslookup command to find IP address of a website

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

  1. Open the Start menu.
  2. Search and open “Windows Defender Firewall with Advanced Security“.
  3. Right-click “Outbound Rules“.
  4. Select “New Rules“.
  5. Choose “Custom” and click “Next“.
  6. Select “All Programs” and click “Next“.
  7. Select “Any” from the “Protocol type” dropdown menu and click “Next“.
  8. Choose “These IP addresses” option under the “Remote IP Addresses” section.
  9. Click “Add“.
  10. Select “This IP address or subnet“.
  11. Type the IP address in the first field and click “OK“.
  12. Repeat steps 9 and 10 if you have multiple IP addresses to enter.
  13. After adding, click “Next“.
  14. Select “Block the connection” and click “Next“.
  15. Select all the checkboxes and click “Next“.
  16. Type a name of your choice in the “Name” field and click “Finish“.
  17. 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“.

open Windows firewall advanced security

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

right-click on outbound rules and select new rule

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

select custom

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

select any program

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

select any from the protocol type dropdown menu

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.

click add

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

add IP address to block

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.

add all IP addresses to block in firewall

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

select block this connection option

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.

select all profiles and click next

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

name the new firewall rule

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

new firewall rule is created to block outgoing connections to a specific 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.

website and IP address blocked using Windows Firewall

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.

disable outbound rule in Windows Firewall

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.

4 thoughts on “How To Block Website or IP Address Using Windows Firewall”

    1. Avatar for Bashkarla

      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.

Leave a Comment

Your email address will not be published. Required fields are marked *