-1

I have blocked websites for a user in Lan environment through changing host file on his pc. like this- 127.0.0.1 youtube.com (Succeded). But i want that if user use other ip address (mobile hotspot or wifi) to access this site, then it should be open. Please suggest how to modify in host file. because there is no option in my router (iball baton) firewall setting.

  • 1
    Doing this client side is pointless when the end user has privileges to modify the hosts file. Normally, you'd do something like this on either a proxy server or as you mentioned a firewall. Would a proxy server be a solution for you? – Jeroen Apr 16 '19 at 06:43

1 Answers1

1

If you want to block all the users in your network, you can achieve this in two ways:

  • Using a firewall (the best solution)
  • Filtering through DNS (for example https://www.opendns.com/). Configuration can be changed or bypassed like when you modify hosts file. The configuration in hosts file bypasses DNS settings, so any user can do the same.
  • Hello @Cristian-urrutia Is there any other option. I want to use only host file to block. Can i define abc ip address in host file to block a website. Means if user tries to access youtube.com through xyz ip then it should be access and if he tries with other abc ip, than it should not access. – systronics Apr 16 '19 at 08:03
  • @systronics No there is not. Please read some documentation about what a ``hosts`` file actually is and what it does. – allo Apr 16 '19 at 13:49