The Internet is a vast and ultimate source of information but like faces of the coin, it has downsides as well. Sometimes you would like to block certain websites because of malicious content, tracking, cookies or lot of ads. Parents would like to block sites so that their child could not access harmful content. In this tutorial, we are going to tell you how to block a website without using any software. Additionally, you will also learn a simple way to get rid of annoying ads by manipulating hosts file.
You can simply block any unsafe website using antivirus, browser add-on, or parental control software. But believe me, it is very easy to block a whole army of worst web sites and advertisement servers using built-in feature of windows. For this, you do not need to download any software or app. Just follow some simple steps to block a website without using software which is a super easy process.
Table of Contents
What is system hosts file?
When you enter any URL in your web browser, then browser immediately requests IP address of that site from Domain Name System (DNS). At the same time, windows system checks hosts file for redirection related information. Means traffic can be diverted to any desired website or back to the local computer by modifying the hosts file.
Simply, hosts file can redirect traffic back to a blank page of your computer instead of any website.
How to edit Windows hosts file?
- First of all open Notepad with administrator privileges. To open notepad in windows 7, go to Start > All Programs > Accessories then right click on notepad and select run as administrator.
To open notepad as an administrator in windows 8, right click on the bottom left corner of your desktop window and select Command Prompt (Admin). Now a black command prompt window will open, simply type there “notepad.exe” with or without quotations (as shown in image). Done, admin notepad is now open.
- In notepad, go to File >> Open using menu-bar in top left corner. After that, navigate to C:\Windows\System32\Drivers\etc. You will be able to see an empty folder. Now switch the view from Text Documents to All files using drop-down menu located at the bottom right corner. Then select hosts file and hit open. The hosts file is open now in notepad with administrator permissions.
- It is highly recommended to keep a backup of hosts file before editing. You can copy it in another location to avoid any future problem. It will also allow you to undo all changes and return to the default state.
How to block website without using software?
- This is most interesting part of this tutorial of block website without using software. Click on the last line of textual document and start a new line. Type there “127.0.0.1 www.site-to-block.com” and replace domain of your website in place of site-to-block.
- Note that there is no need to put http:// or https:// part of URL. Directly start with www.
Similarly, you can type as many as websites to block in different lines. But remember that each line should start with 127.0.0.1 because here 127.0.0.1 is IP address of the blank page. This IP address overrides original IP address of any malicious/unsafe website.
Note:- If you are using windows 8/10, you may need to temporarily disable Windows Defender to alter hosts file. You can read full tutorial here to update hosts file in window 8.
How to unblock website using the hosts file?
Well, this is very simple and I know you already guessed it. You have to just remove extra lines from the hosts file. Alternatively, you can restore hosts file from backup.
How to block advertisement without using any software?
Nowadays almost all websites and blogs are full of affiliate banners or pop-up ads. These ads not only slow down browsing speed but provide worst experience to users. You can also use the hosts file to block advertisement.
Let me explain how it works. Most of the banners and other ads are hosted on servers. Means if we can somehow block those culprit ad-servers, ads will automatically disappear. Now here the overriding power of hosts file can be used.
You can simply block ads by typing “127.0.0.1 server-address” without quotes.
Suppose you have to block a banner that is hosted on ads.click.com/banner.png address. You have to simply type “127.0.0.1 ads.click.com” in your hosts file. It will block ads.click.com server, ultimately all ads coming from that server will be blocked.
But a new problem arises that how will you identify each advertisement hosting server. Don’t worry, we have a solution for this problem also. You can copy or download the list of all such server from WinHelp2002.
WinHelp2002 is trusted, regularly updated and free service which keeps the list of ad-servers. After downloading list from WinHelp2002, copy all ad-servers as it is in your hosts file. That’s it. Almost all ads would be blocked before loading in your browser. It will also significantly boost your browser’s speed.
Now you know how to block a website without using software and how to use hosts file to boost internet browsing speed. Hope you find this tutorial helpful and successfully blocked unwanted websites and ads. Still, if you face difficulty in any step, remember that we are only one comment away. We will be happy to help you. You can also read 7 best emulators to run android in PC. If you enjoyed this tutorial do not forget to share with your friends.