If you spend more than 2 hours/day on your social account, then you must be addicted to Facebook and other social network, which will drop your productivity in doing work or other important activities.
If you are businessman, then there is the possibility of dropping employee’s productivity rate at work on spending their work time on unwanted websites like Social networking, e-stores, political, YouTube, finance and news.
In addition, if you have a computer or laptop at home and your children are using it, then you may worry about your young children are spending too much time on websites like Facebook, YouTube etc. With the threats of Facebook addiction and negative impact on children, as parents or teachers you may concern about the children safety.
In my last post “Protect Your Kids Online With This Best Free Parental Control Tools” I discuss about some tools that that will help you protect your child and you can be aware of your kid’s activity on the Internet.
Also there are many unsafe websites that could be spreading viruses, contain explicit content or even be trying to steal your personal data.
In such cases, it might be best to block certain unwanted websites on your computer. But How?
There are different ways to block websites. You can use Firewall system, antivirus, browser Add-Ons or configure in your router to block certain websites. But you have to spend either money or time or both to use these methods.
Here is an effective method for restricting users of all ages from seeing the content you don’t want them to access. Just add the list of website you want to block in hosts file and it will block these sites for all users on all browsers of a Windows PC. This method is straightforward and free, and it doesn’t require you to download or install any additional software.
What is Hosts File?
A hosts file is an address translator and redirector plain text file stored on your computer, that is loaded into memory (cache) at startup. It maps hostnames to IP addresses. Every website has its specific IP address. When you type domain name in browser, hosts file translates that domain names or NetBIOS names into an IP addresses
When you access a website, your computer contacts your domain name system (DNS) server and requests its numerical IP address. Your computer will then connect to this numerical IP address and access the website. Every time when Windows queries a DNS server, it first checks the Hosts file for redirection information.
In Windows, this file is located at
Blocking Websites with Hosts File:
You can use a HOSTS file to block ads, banners and cookies, by adding them in its excluding lists. But you need to have Administrator rights, to do this.
- In the Start menu --> type notepad in search.
- Then Right-Click on the notepad and choose Run as Administrator. Now notepad files run as administrator
- Open Hosts File located in C:\Windows\System32\drivers\etc. Select the files type All --> choose hosts file and click Open.
- Once notepad is open, simply add a line like this-
- 0.0.0.0 www.example.com
- At last save this notepad file.
(Note: In Windows 8.1 and 10 use IP 0.0.0.0 while in earlier versions use 127.0.0.1 or use original IP of that website)
To find IP of any website--> Go To Command Prompt --> Type the command “ping facebook.com” --> Here you can find IP of that website.
Here in place of example you can add any website name like Facebook, YouTube etc.
(Make sure that there is more than one space between IP and domain name)
Now next time when you want to open Facebook.com, then operating system will check whether the site has already got its IP address defined in the hosts file. If it is there, then system will not load Facebook from its original IP address and shows a block page.
This method is very easy and suitable for a common user as you don’t need to install any software and browser Add-Ons.
But this hosts file can be easily edited if someone knows this trick and has administrator right on that computer. That’s why if you are using this method; always give user login for your children or employees so that they will not be able to edit the hosts files.
You can also use this trick to redirect any website to another website. For example, you want to redirect facebook.com to your desired website, let’s say iteguru.com. So when anyone type facebook.com into our address bars, we’ll redirect and open iteguru.com.
In this case type the IP address of iteguru.com before facebook.com
This tells the computer to connect facebook.com to IT eGuru’s IP address.