Some websites are flat out inappropriate for work or family while others are simply discouraged. This may include adult or malicious websites. Paid software can be used to block access to particular groups or whole domain names, providing safety and reducing unnecessary browser time.

A restriction option that won’t cost a dime, and is already built into Windows, is the hosts file. The Windows hosts file is located in the Windows System32 folder and provides easy setup for redirecting traffic to a more suitable location. Follow our steps and screenshots to configure the hosts file.

Editing Windows Hosts File

Opening the hosts file to block websites

The hosts file isn’t always cooperative when editing directly from its default location. Begin by copying this to your Desktop before editing.

Navigate to “C:\Windows\System32\drivers\etc” to right-click and copy the “hosts” file. Now paste it to your Desktop and double-click it. Because the hosts file contains no file extension, you’ll then be asked to choose what program to use for opening it. Choose an installed text editor like Notepad or Notepad++.


Editing the hosts file to block websites

Scrolling down to the bottom of the file will be a few examples. Notice that “#” signs are comments and have no effect on functionality.


Blocking a website:

The first line to the left, like “” above, is where the redirect should end up while the right side is the source. So if you want to block, just enter Please make sure that there is no # sign preceding it as shown in the image below.

Redirecting one website to another:

To find the IP address of the domain in question, pull open a command prompt from “Start > All Programs > Accessories > Command Prompt” and enter “ping” to get the address of

For example, enter “” to the left, in a new line, tab over to the right and enter “”


Now navigate to and notice the domain name for the specified IP address is now shown:


This can be done for any URL and any IP address. Enter the combination “” and “favoritewebsite” to gain access to via the URL “http://favoritewebsite.” This is also evident when files like the following are used as the hosts file:

This is a list of adverts and/or spyware domains that can be blocked by pointing their traffic to the local address of Copy and paste the contents of this page into your hosts file to add these entries.

If the hosts file appears to be unrecognized by the installed browsers, there is a setting in the “LAN settings” window of the “Connections” tab in Internet Explorer’s options.


Uncheck the topmost setting of “Automatically detect settings.”


The hosts file will now be used in browsers before the Internet DNS is polled. This is necessary for these changes in the hosts file to take effect.


While the hosts file has no graphical user interface, it can still be quite effective when restricting or redirecting web traffic. Configuring the hosts file to point to a local web server or device via HTTP is a quite common task completed in this file. So go ahead, enter all your favorite websites to the right most section of the hosts file and enter our IP to the left – you won’t ever miss our updates!