This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I want to block sites through my PC's hosts file, why won't it work?
02-19-2014, 12:28 PM
Post: #1
I want to block sites through my PC's hosts file, why won't it work?
I heard you could block sites on your computer by use of the hosts file. I have followed instructions found online:
Leave a blank line after the last bit of original text, the localhost.
Then put 127.0.0.1 http://www.facebook.com

And thus, facebook should be blocked. However, this hasn't worked. Not even after restarting and shutting down my laptop.

One site suggested I need to put in both facebook.com and http://www.facebook.com in order for it to work. Another said I had to use a tab space, rather than a normal space, between the 127 and the web address for it to work. Are either of these really necessary?

I should note that while there was already a hosts file in the system32 folder, there was no file type listed for it. I opened and saved it with the Notepad, so now there is actually more than one hosts file in that folder, which might be making a difference.

Note also that I used facebook above just as an example. There are websites I want to block; facebook is not among them. Just mentioning this as I'm sure there are plenty of easy ways of blocking ONLY facebook, which wouldn't suit what I want.
Is there any risk in deleting the original file?

Also, I notice now that there is a third hosts file- a BAK file, which I understand is just a backup file. Should I delete that too, leaving the txt file as the only one?

Ads

Find all posts by this user
Quote this message in a reply
02-19-2014, 12:36 PM
Post: #2
 
Oops....more than one hosts file? There's your problem. Notepad saved your file as HOSTS.TXT, but you have file extensions for known file types enabled so you only see two hosts files without their extension.

Delete the original hosts. file and rename your hosts.txt file as hosts. (without the file extension).

I know that Internet Explorer uses the Hosts file, but I'm not sure that Google Chrome, Firefox, and others do.

[Addendum]

No, there's no risk in deleting the original file. The system runs fine with or without it. The Hosts. file (note, no file extension) is used to associate domain names with IP addresses and a few other configuration settings that are beyond the scope of your question. The web browser looks at the HOSTS. file first and then to the DNS server to resolve a domain name. Many anti-spyware programs use the HOSTS. file to block your access to unwanted or dangerous websites (as in spyware-laced or pornography-laced advertisements).

Whatever anti-spyware software that you use, should put any settings back that are lost be deleting the HOSTS. file.

I've added my own entries to the HOSTS. file. Every time I manage to isolate an advertisement server (those webservers that serve advertisements on websites) I enter an entry in the HOSTS. file to redirect those to 127.0.0.1. This effectively blocks the ads and causes the web pages to load faster.

You can delete the .BAK file too. When you're done, you want the HOSTS. file (no extension) to remain. Windows only looks at that file.
[/ADDENDUM]

Ads

Find all posts by this user
Quote this message in a reply
02-19-2014, 12:42 PM
Post: #3
 
Have you seen here>>>
http://winhelp2002.mvps.org/hosts.htm
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)