0

I want to use the windows 7 hosts file (in C:\Windows\System32\drivers\etc\hosts) to block this page :

play.chessbase.com/js/apps/playchess

However, it is not working despite all these entries:

127.0.0.1 localhost
127.0.0.1 http://play.chessbase.com/js/apps/playchess/
127.0.0.1 play.chessbase.com/js/apps/playchess
127.0.0.1 play.chessbase.com/js/apps/playchess/
127.0.0.1 chessbase.com
127.0.0.1 www.chessbase.com
127.0.0.1 80.237.188.82
127.0.0.1 http://en.playchess.com/
127.0.0.1 5.35.251.47
127.0.0.1 Play.chessbase.com

When I add

127.0.0.1 www.altavista.com

The site is sucessfully blocked. However, it does not work for the other link above.

How can I block this page?

emcor
  • 103
  • 5
  • Why can't you block it at the router level and/or DNS server level? OpenDNS allows you to block domains and is far more effective then using the hosts file. – Ramhound Jan 20 '15 at 12:02
  • @Ramhound I do not want to install an extra program, I dont know how to block it on "router level and/or DNS server level"? – emcor Jan 20 '15 at 12:03
  • I gave you an example of a DNS service that has the feature your looking for. How you do it at the router level entirely depends on your hardware. – Ramhound Jan 20 '15 at 12:06

1 Answers1

2

When blocking a site in your hosts file, don't give it a place to go.

0.0.0.0 play.chessbase.com

None of the other entries you have there work, please remove them. You can't reference a http:// address or URL in your hosts file.

Optichip
  • 789
  • 1
  • 4
  • 10
  • This solution blocks "play.chessbase.com", but I want to block "play.chessbase.com/js/apps/playchess" (I can still access this link)? – emcor Jan 20 '15 at 12:01
  • If you are looking to block layer 7 you will need a software or hardware solution to actually block the URL. This can't be done with a hosts file. You will need a content filter of some kind. – Optichip Jan 20 '15 at 12:05
  • @emcor - If you redirect the domain name play.chessbase.com you will concomitantly block any paths appended to it, such as play.chessbase.com/js/apps/playchess, but other domains, such as chessbase.com and www.chessbase.com will be unaffected unless you redirect them individually. For more comprehensive control, you may be able to use your firewall settings or the parental controls in your security software. – AFH Jan 20 '15 at 13:14
  • I still can access "play.chessbase.com/js/apps/playchess" (while "play.chessbase.com" is correctly blocked)? – emcor Jan 20 '15 at 13:55
  • If you block access to the site then the page can't be displayed. If you have a cached connection you will still be connected, you would need to close the web browser and reopen it to test. – Optichip Jan 20 '15 at 14:14
  • I reopened the browser and it is still displaying the site (play.chessbase.com/js/apps/playchess), maybe because it is a Java App. Did you try it on your browser? – emcor Jan 20 '15 at 14:29
  • ok now I see: I was logged in with a user account on that page, after I manually logged out and reloaded the page it is now blocked. – emcor Jan 20 '15 at 14:31
  • If you're running a java app from your machine it might be hard coded with IP addresses. You would need to remove the java app, then try to go to the page. – Optichip Jan 20 '15 at 14:31
  • Gotta love chasing ghosts. – Damon Jan 22 '15 at 07:15