The Internet is beneficial as long as you utilise it for productive activities like education, information seeking, online shopping, etc. There are, however, a number of additional factors that can hurt consumers. If you are a parent and your kids have access to a computer, you should stop them from entering the shadowy online space. Many employees use social media during work hours because they are glued to it, even in the workplace. On our PC, we may block websites in a number of methods. Using the Windows Firewall, a third-party firewall, or antivirus software with Cybersecurity, you can block websites. Additionally, you may use extensions and plugins to restrict particular websites on particular browsers.
However,it would be simple for your child or the staff to figure it out and remove the websites off the prohibited list. So that websites cannot be readily unblocked, we will ban them using a technical tool: command prompt. As a result, it is advised to choose a more traditional technique, such as altering the hosts file on the computer’s system.Every time a user sees a web page, their browser consults this hosts file, which serves a similar purpose as DNS servers. Because of this, opening the file and adding the link to the page are required if you want to block access to a web page.In this post, we’ll show you where to find the file and how to alter it.
What is a Hosts File?
Do you know what DNS (Domain Name System) is? It alludes to an Internet-wide collection of files that assist in translating domain names into their real Internet Protocol (IP) addresses. In order to see this site, your computer will benefit from knowing which server to contact. This was accomplished via the hosts file, a local file on your computer, prior to the creation of DNS in 1984. There weren’t many connections between computers back then. We may have connected with a dozen people at most. Keeping all of the data in a simple text file was simple. The hosts file is still active today. As an example hosts file line 216.58.216.164 converts to the google domain.
Working of Hosts File
The IP address for each of them is included next to the name in the hosts file, which enables the computer to seek for other computer names such as localhost or domain names. Similar to how the names of your friends’ phone numbers appear next to them in your phone. Find the person’s name; you don’t need to remember or dial the number. It’s essential to remember that some IP addresses are set aside for local usage before moving on. They are hence limited to pointing to your computer and other devices connected to your current network. That includes everything that happens before your communication is connected to the Internet.
For instance, the pc you’re using, often known as localhost, has the IP address 127.0.0.1. Try entering it in your internet browser. Most likely, a blank page will appear.
How to Block Websites?
The Domain name system (DNS), one of the foundations of the Internet, converts simple names like www.google.com into comparable IP addresses (8.8.8.8). In addition to using DNS servers to access websites, your computer also includes a hosts file that may keep this data locally. You may use this to block access to undesirable websites.
- Verify that your computer has administrator access. Go to C:\Windows\System32\drivers\etc\ after signing into your computer as the administrator.
- Double-click the “hosts” file and choose Notepad from the list of available applications to open it. Select OK. Your hosts file’s final two lines should be “#::1 localhost” and “#::127.0.0.1 localhost.”
- If you are unable to modify the file, you must right-click the hosts file and choose Properties. Select the administrator account by clicking the Security tab, then click Edit.
- Re-select the account in the pop-up and tick Full control. Click Select Yes under Apply. Now choose OK in each pop-up window.
- The addresses of the websites you want to ban can be added at the file’s conclusion. Simply add a line at the end of the file that begins with 127.0.0.1 and ends with the name of the website you wish to block to redirect its name to your local machine.
- For instance, put “127.0.0.1 www.google.com” without the quotation marks at the end of the file to block Google. This allows you to block as many websites as you’d like, but keep in mind that you can only add one per line.
- Continue until all of the websites you want to ban have been added.
Other Uses of Host Files
A website can be redirected to another website using the same technique. Enter the IP address of the website you wish to get a redirect from the other website. The domain name of the website you are rerouting to the IP address you just specified should then be typed. For instance, if you wish to reroute Google.com to Bing.com, enter Bing.com’s IP address first in the Hosts file, followed by Google.com. Hosts file must be saved. The URL bar of your web browser will now open Bing.com instead of Google.com when you input and enter Google.com.
The identical method may also be used, but instead of pasting in the URLs of different viruses and tracking ad sites, do so. You may copy and paste malicious and advertising websites from a pre-made hosts file into your hosts file.
Conclusion
You can stop your children from seeing websites with adult material, gambling, and other undesirable information. It may be helpful in offices as well because you can stop your staff from wasting time on social networking sites during business hours. Furthermore, you may prevent other users from accessing any website by blocking it.