![]() |
VOOZH | about |
Are you spending too much time on social media websites such as Instagram, Twitter, Facebook, etc.? Or is your younger brother, sister, son or anyone wasting too much time on a particular website or visiting the website he/she is not supposed to visit? What if we tell you in this article that you can block any website with just 1 line of code. You don't even have to be a coder to do this task and that too with ease. So let us get started.
For Windows:
127.0.0.1 www.instagram.com instagram.comFor Mac & Linux:
This is going to work most of the time, and then you won't be able to open the website mentioned in the host's file. The below result will come up after going through all the steps.
👁 ImageJust in case the above method does not work, then you are going to have to clear the cache of the browser.
For Google Chrome:
For Mozilla Firefox:
Easy Explanation:
Every website on our internet is not found by its name of the domain. Instead, it is found by it's IP address. The host's file contains the list of IP addresses and all the hostnames associated along with it, in an address book. When any website like
www.instagram.com
is entered by the client in the browser, the consultation happens from the host's file, and we get the IP address for that particular site. After that, the compiler is going to open the website after calling it. If that doesn't happen, the computer will be going to ask for the Internet Service Provider AKA ISP for the IP Address, before requesting that particular site. For most of the times, the host's file will not be having any addresses, just because we haven't put anything there. So the computer will inquire for the IP address from the required ISP, which will in return going to consult a DNS server, which will further be going to find the IP address. Once the browser is going to receive the accurate IP address, the connection is going to be built with the server that is going to match the IP address which will further transfer and receive data & information. This is how the page of the website will load up. For the given example above, the website
www.instagram.com
is pointed to 127.0.0.1, which is localhost. Localhost a synonym for the home computer, which is a method of portraying to the machine, that the user is currently logged into and since the server is not running locally, it will lead us to "the site cannot be reached." The web server could be set up on the computer and 127.0.0.1 could be used to point it to the server in the local machine, and the local server will return something similar to this.
👁 Image