From time to time, you will see a website you just want to block. Maybe the website is a spammy one or is just a lot of distraction, like Facebook. This is especially true when children are involved and spending a lot of time on those websites. If you regularly use Microsoft Edge browser, you might have seen that there are no obvious options to block websites on Edge browser. That being said, you can use the hosts file to block a website on Edge browser. Let me show you how.
How to Block Website on Edge
To block website on edge browser, we will use the hosts file method. In the hosts file, we will add the website we want to block. In case you don’t know, the hosts file is used to map IP addresses to human-readable website addresses. So, what we will do is map the website we want to block to a local IP address called localhost. i.e., 127.0.0.1.
Once you map a website address to localhost, you cannot access that website. This is because whenever you enter the URL in the browser’s address bar, it tries to access the localhost. Since localhost is just our computer, the website does not load. For more information on the hosts file, visit this page.
Steps to Block Websites on Microsoft Edge Browser
1. First, open the start menu and search for Notepad. Now, click on the Run as Administrator option in the right panel. You can also right-click on Notepad and select Run as Administrator option.
2. In the Notepad, we need to open the hosts file. To do that, go to File and select Open.
3. The above action will open the file selector window. Here, go to
C:\Windows\System32\drivers\etc folder. Once you are here, select All Files from the bottom right drop-down menu.
4. Now, select the hosts file and click on the Open button. This action opens the hosts file inside notepad where you can add the website to block in Edge.
5. In the hosts file, use the below format to block websites on Edge browser. Don’t forget to replace example.com with the website name of your choice. The line starting with
# is a comment line where you can write why you are blocking the website. This makes it easy to remember why you blocked the website when you next open the hosts file. This is not a requirement. So, if you want to, you can delete the comment line.
Note: make sure there is at least one space between the localhost IP address and the actual website address.
# Comment line to write why you blocked the site (useful but not required) 127.0.0.1 example.com
6. You can follow the same procedure to add as many websites as you want to block websites on Microsoft edge browser. For instance, I’ve blocked Facebook on Edge with a custom comment.
7. After adding websites to block on Edge we need to save the changes. To do that click on the File menu and select Save. You can also press the keyboard shortcut Ctrl + S.
8. After saving the file, close it by clicking on the X icon appearing on the top right corner.
That is it. From now on, Edge browser blocks the website.
Keep in mind that once you block a website using the hosts file method, it is blocked system-wide including on all other browsers.