How to Block a Range of Websites in the Host File

Internet browsers normally use the DNS, or Domain Network Server, to determine what IP address to contact for a website's data. The hosts file embedded in Windows overrides the DNS. Therefore, adding websites' IP addresses to the hosts file tells your computer what addresses to search without consulting the DNS. Modifying the hosts file is a method of blocking websites that cannot easily be reversed. You need to know the IP addresses of the sites you want to block; you can find this by pinging the site's server from Command Prompt.

Instructions

    • 1

      Click "Start," "All Programs" and "Accessories." Right-click Notepad and select "Run as administrator."

    • 2

      Click "File," then "Open" to open a Notepad document. Navigate to "C:\Windows\System32\drivers\etc\." Select "All file types" and open the file labeled "hosts."

    • 3

      Scroll to the bottom of the document. Type in the site's IP address -- for example, 125.23.43.12 -- followed by a space. Then type "http://" followed by the URL of the site domain.

    • 4

      Press "Enter" to insert a line break. Type the IP address of the next site you want to block followed by the URL. Repeat for all subsequent sites.

    • 5

      Save the file.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured