How to Block a Website
Sometimes you come across pesky websites that are not only bugging you, but also can cause harm to your PC or compromise security. Such websites can display countless ads, annoying popup windows, can open multiple new windows within a fraction of a second or install viruses on your computer.
To hide such websites, you can use a simple trick that will display locally stored html files instead of the remote malicious website.
Here is what to do:
- Locate the file called hosts in C:\WINDOWS\system32\drivers\etc
- Open the file hosts either using notepad.exe (just right-click on the filename and select notepad to open it) or enter the command line mode and type edit hosts. This file allows you to configure customised IP addresses for Internet and local hosts. If you provide an IP here, it will override IPs that your DNS suggests you.
- Now, go to the bottom of this file and add new entries to it following the notation pattern.
For example adding: 127.0.0.1 somebadcrackers.com will effectively "block" the listed domain name, meaning that all requests sent by you to this domain name (intentionally or unintentionally) will be redirected to your local host.
Be careful using this method. You can easily block some important sites if you misspell something.
