How To Restrict Linux To Certain Websites?

Discussion in 'all things UNIX' started by lucygrl, Mar 21, 2015.

  1. lucygrl

    lucygrl Registered Member

    Nov 6, 2013
    Hello, Im just wondering is there any way to restrict a PC with Linux so it can only access certain websites that it has been allowed to access and nothing else? I want to be able to restrict some of our work PC down to just websites that are relevant to our work.

  2. oneeyed25

    oneeyed25 Registered Member

    Nov 26, 2013
    You can always use a firewall. Even ufw, which is pretty simple allows filtering by IP. Keep in mind that to block everything and allow only a few URLs can be very limiting for users or a nightmare to maintain for the admin.

    Another solution might be to use something like OpenDNS. You'll have to change your DNS servers on your router and/or PC. No idea if it can filter by URL in the non-paying version. Still even the free version offers parental controls to limit what you can access, and it is pretty good at blocking porn and things like that.
    Last edited: Mar 21, 2015
  3. mirimir

    mirimir Registered Member

    Oct 1, 2011
    You can also configure with no DNS server, and put URLs of allowed sites and their IPs in a hosts file. then specify outgoing in iptables by IP, maybe just on port 443 for HTTPS, to allowed sites.