I’m trying to block a certain user from viewing certain sites on a computer running WinXP SP2. If all users are unable to view the sites, that’s fine too.
I made entries like this in the hosts file, using Yahoo as a test:
127.0.0.1 yahoo.com
And I saved it. I’m still able to view yahoo.com, though.
I searched for some tips and based on what I found, I ran the “ipconfig /flushdns” command, I completely cleared the browser cache, and I also rebooted. No dice. IE still loads the page. When I try to PING yahoo.com from a command prompt, it looks for it on the localhost like it should, but IE7 simply refuses to cooperate.
Also, failing this, is there any other way to block specific web sites in IE without installing any other programs?
Go to Internet Options in IE7, click on the Content tab at the top, Enable the Content Advisor, click on the Approved Sites tab. Enter the website you want blocked and click Never. Repeat for as many sites as you wish.
There’s a page here which leads you through the process.
This sounds wrong… the “hosts” file is low-level – lower than the browser asking for an address.
Did you make sure to call the file – just – “hosts”? Not “hosts.txt”, not anything with a suffix, just “hosts” without anything else?
Did you place it in C:\WINDOWS\system32\drivers\etc?
Did you access yahoo as “yahoo.com” (the exact way you put it in the “hosts” file) or is your shortcut pointing at “www.yahoo.com” or somesuch? If the latter, then putting “yahoo.com” in your “hosts” file still won’t do anything.
Just a few ideas OTTOMH.
Also - what aldiboronti said. Probably a better idea than playing with the “hosts” file.
Could be this. I can’t check right this moment because a co-worker is using the computer in question. I’m not sure I understand how blocking the entire domain yahoo.com fails to block the subdomain www.yahoo.com, though.
Yeah, I figured this out through a web search shortly after I posted my question. Thanks, though, aldiboronti. I would prefer it to look like the site just wasn’t responding or something so I don’t have the creepy guy at work who browses assault rifle sites all night start questioning me about blocking them, but I guess he would have figured it out eventually anyway.
Because the “hosts” file, as stated, is rather low-level. It’s just used as a textual lookup – if the exact text of the Internet Address** that you type exists in column 2, it uses the IP Address in column 1; otherwise, it uses whatever DNS server is configured or default to figure it out.
**everything between the “[protocol]://” at the beginning (if there is one) and the “:” (if there’s a specific port), or the “/”, or the end of the address) – E.g., if you type “Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos”, the “Internet Address” portion that gets resolved is “www.yahoo.com”. Having “yahoo.com” in your “hosts” file won’t do any good – it’s not the same string!
aldiboronti: Except that can be undone by anyone even minimally clueful, whereas the hosts file is (theoretically) protected by the filesystem and permissions model.*
In short, IE7 is broken.
*(Or is Windows so broken even that is not guaranteed?)
First of all, anything I put in the hosts file, I put in as (for yahoo) both yahoo.com AND www.yahoo.com as separate lines.
Second, at this point, you’ve probably done this anyways, but if you save the hosts file while IE is open, you have to close all instances of it and reopen it.
First of all, anything I put in the hosts file, I put in as (for yahoo) both yahoo.com AND www.yahoo.com as separate lines.
Second, at this point, you’ve probably done this anyways, but if you save the hosts file while IE is open, you have to close all instances of it and reopen it.
Also, make sure you are using the hosts file, when searching for hosts on most computers I’ve done this on, there’s usually more then one, I beleive the one you should be working on is the one in the widows folder (a few subfolders down though).
Does the same thing happen in other browsers? If it does, then it is not an IE7 problem. I’d be curious to know if the same problem occurs in Firefox or Opera.