Windows offers us a wide range of possibilities when configuring our networks and tools. We have many options that are integrated into the system itself, as well as others that we will find when using third-party programs. In this article we are going to focus on how to block an IP address or web page through PowerShell . In this way we can easily do it from Windows 10 without having to install anything additional.
How to block a web or IP page with PowerShell

There are many web pages on the Internet. We have at our disposal millions of sites in all languages and with a wide variety of subjects. It may happen that at any given time we are interested in blocking a specific site. We want that when you open the browser and put your address it does not open.
We can do this in different ways. We can make use of third-party firewalls and other tools, for example. This will prevent our system from accessing a specific site. However, the operating system itself also has tools to achieve the same goal in a simple and fast way.
This is where PowerShell comes into play. We can use it to carry out a series of steps and block both access to a specific web page and an IP address. You just have to do some simple actions that we are going to explain.
Block an IP address or website
We will explain how to block a webpage IP address from PowerShell. Keep in mind that we can block a specific IP or also a range of addresses. For this, the first thing we are going to do is go to Start , write PowerShell and run it as administrator.
The command to be executed is the following:
New-NetFirewallRule -DisplayName «Block NAME.com IP address» -Direction Outbound –LocalPort Any -Protocol TCP -Action Block -RemoteAddress ADDRESS
From that command you just have to change two things: NAME and ADDRESS. In name you have to put the website of the site, the domain; In address we will put the IP of that site. Later we will only have to give it to execute and the process will begin.

In our example we have tested a random web that we have found on the Internet. The goal was simply to prove that it worked properly. Once we run it we can open Google Chrome, Mozilla Firefox or any browser and check that the page does not load. A message would appear as we see in the image below.

We can also access the Windows firewall and check, within the exit rules, if it is blocked correctly. There will appear the page that we have decided to block. We can even right-click on it and disable the rule. In this way we will be able to access that site again without problems. Change is instantaneous.

As we can see, we can block both a web page and an IP address of a server, etc.
In short, by following these steps we can block access to any domain on the Internet in a simple way. Basically it is the same as if we create a rule in the Windows firewall. However in this case you just have to execute the code we have mentioned, change the parameters and that’s it. We won’t need to waste any more time creating rules of any kind.
Also, as we have reported, we can access the firewall of the operating system and check there that the rule or rules that we have created have actually been stored. This way we can ensure that they are indeed active at all times. We can always revoke the action and in this way we can access that site that at a given moment we have decided to block.
Keep in mind that this block will be present in any browser. It is not something that can affect only Google Chrome or the main browser that we use, but it will be present in whatever we install. After all, our system is blocking access to that site or IP address.