Why blocking sites using Hosts file isn't working?
Hello
I need to block a few websites on my home computer. Did a quick search and found out I had to work with the hosts files. So opened up Notepad, ran it as Admin and then opened Hosts and at the bottom added ' 127.0.0.1 facebook.com' then saved the file. But
facebook is still opening when I go to the page.
can someone tell me why using the Hosts file isn't working?
I did read somewhere that it might have something to do with security features on my system. FYI, I m using a trial version of Norton Anti Virus and I am running a Windows 7 machine.
Thanks. Any help would be appreciated.
October 23rd, 2010 2:43pm
Are you sure your entry was in fact saved to the hosts file? The hosts file on my computer blocks unwanted sites.Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
October 23rd, 2010 4:12pm
Are you sure your entry was in fact saved to the hosts file? The hosts file on my computer blocks unwanted sites.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
Yes
This is a copy paste of CMD.exe. It shows what's in the host files.
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\mehdi>cd C:\windows\system32\drivers\etc
C:\Windows\System32\drivers\etc>dir \a-d
Volume in drive C is Gateway
Volume Serial Number is B291-A8C6
Directory of C:\
File Not Found
C:\Windows\System32\drivers\etc>dir /a-d
Volume in drive C is Gateway
Volume Serial Number is B291-A8C6
Directory of C:\Windows\System32\drivers\etc
10/23/2010 01:06 PM 846 hosts
06/10/2009 02:00 PM 3,683 lmhosts.sam
06/10/2009 02:00 PM 407 networks
06/10/2009 02:00 PM 1,358 protocol
06/10/2009 02:00 PM 17,463 services
5 File(s) 23,757 bytes
0 Dir(s) 936,919,461,888 bytes free
C:\Windows\System32\drivers\etc>type hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 facebook.com
C:\Windows\System32\drivers\etc>
October 23rd, 2010 4:23pm
It looks like you only put a single space 127.0.0.1 and facebook.com. I can't find a reference right now, but I believe I read years ago when I first started playing with the hosts file you had to sepearate the entries with a Tab instead of a
space.
So, your entry should look like:
127.0.0.1 facebook.comPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
October 24th, 2010 3:22pm
You're trying to redirect the entire domain, which I don't believe you can do with HOSTS. Try adding a "www." to facebook.com and see if that works.
October 24th, 2010 5:12pm
Hello
I need to block a few websites on my home computer. Did a quick search and found out I had to work with the hosts files. So opened up Notepad, ran it as Admin and then opened Hosts and at the bottom added ' 127.0.0.1 facebook.com' then saved the file. But
facebook is still opening when I go to the page.
can someone tell me why using the Hosts file isn't working?
I did read somewhere that it might have something to do with security features on my system. FYI, I m using a trial version of Norton Anti Virus and I am running a Windows 7 machine.
Thanks. Any help would be appreciated.
you did right.
Upon testing and retesting (w7 ult only), I noticed that sometimes when you edit the hosts file more than once involving same domain, it may not recognize it until you restart your computer.
http://www.cesabarre.com/
Free Windows Admin Tool Kit Click here and download it now
October 24th, 2010 7:00pm