How to Block any website or redirect any website in window PC.
There are many reasons to block certain websites to be accessible from our browser. Maybe we don't want our kids to access some naughty website. Just telling them to stop opening them wouldn't be a great solution. we must do something so our kids can't open these websites. We are here to learn how to block any website manually by just changing certain settings on our system.
Basic Concept - Host file.
Before we proceed, Let's introduceWindows Host File.. The windows host file is a file that windows use to control and map IP addresses. The hostnames connected to a network needs to be mapped to their corresponding IP addresses. This is done so to uniquely identify a particular system in a pool of systems connected to the internet. This windows Host file is responsible for providing this mapping function. Slight Modifications made to this file can help us to block any website.
Open Hosts file.
1 » Press start button and search for Notepad and run it as administrator.
2 » Click file and select open.
3 » Windows explorer will open, then navigate to C: » Windows » System32 » drivers » etc.
4 » Select "All files" from drop down list.
5 » Double click at hosts file to open it.
Edit Host file to Block website.
Blocking a website in windows is very simple. We use the following format to block the website.
System IP-Address website-url
For example, if we want to block YouTube in our system. we can write the command as-
In above command we just tell windows that the website "www.youtube.com" should redirect to the IP address 127.0.0.1, which is just the loopback address on our local system. If we don't have a local website setup on our system. we will just get an error page in our web browser.
How to redirect a website to another website?
Using host file, we can redirect a website to another website. by just replacing the Local IP address with website IP address, we can redirect any website to another website. In order to do this - follow the given steps.
Open a command prompt (press start and type cmd) and type the following command and press enter. This command will get you the IP address of the selected website.
Now in Host file, replace the local IP address with the website IP address. This Will tell system to redirect the youtube.com to the Facebook.com.