Windows Hosts file - Can we restrict access to only selected websites?


Recommended Posts

opendns could, a free proxy/webfilter server could, k9 (which is free) can, hosts is not something that was designed to do this...hosts was designed to redirect individual sites not block every site but 1 or 2. All of these options wouldn't matter what browser the computer was using, unlike the links posted above which only works with IE (post 2) or FF (post 3).

Link to comment
Share on other sites

Sure you can do it, just set the dns server of the client to NOTHING, or an invalid address and then in the host file just put the hosts you want to resolve.

Problem you might have is google and yahoo are served off many different clusters and their IPs change all the time.. So its possible that the IP you put in for google.com etc.. might not be valid at some point down the road or not just work for times of the day, etc.

Link to comment
Share on other sites

@sc302 then they would have to be in the hosts file ;) I did not say it was a good solution! But if you don't have a dns setup, then the only sites that would resolve would be the ones in your host file. Which is what he asked.

The only sites he would be able to access with out a dns setup would be ones that resolve via the host file.. But yes he would not be able to resolve say groups.google.com unless he had an entry for that in his hosts file.

And like I said since these sites are served up from a farm, you never know what IP may or may not be active at any specific time.. So sure you can put in the IP you resolve now, but might not work tmrw, or even 20 minutes later. They change all the time for these domains.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.