1

Is there are a simple way to not allow a couple of websites?

I tried the /etc/hosts and hosts.deny things and it did not work.

For the example for

  • youtube.com 172.217.194.190
  • google.com 172.217.194.100

I am looking at gufw, but I have no idea how it works. It does not let me add anything.

Is there a simple interface? Am I missing something? Is firewall protection a whole big philosophy and effort? Perhaps so, since people make it their single subject career. But surely there is or should be a simple way by GUI.

3
  • Are you asking about gufw? Feb 4, 2020 at 1:13
  • I want to use the GUI tool for ufw. I will change my question gufw. Feb 4, 2020 at 9:06
  • The other doc listed does not explain how to block websites. Feb 4, 2020 at 9:09

2 Answers 2

1

I would suggest setting up a proxy, like Squid, if the hosts file is not working for you. It would be a more effective method. You could block IPs with UFW. I am not familiar with GUFW(prefer CLI), but it is just a GUI for UFW.

sudo ufw deny from 172.217.194.190  to any

The problem with that is that youtube and google have many IP addresses. Your DNS resolver may return a different IP every 10 minutes or so for load balancing. To see how many IP addresses youtube has run this command:

whois -h whois.radb.net -- '-i origin AS15169'

A proxy would be a easier option than assinging a rule for every ip address. They could be blocked as an entire range, but you may block something else unintentionally. A proxy could be set up on your network. Configure the browsers to use the proxy and then blocking by Domain Name becomes a whole lot easier. But your more technical users will find a way to bypass.

6
  • thanks for your help. Interesting. Not sure what CLI is . It is not in Synaptic. Proxy I am not sure of . This is just a single computer. Feb 5, 2020 at 11:03
  • 1
    lol... I can add this to ufw and then see it in gufw However, I cannot open a gui to see how it was done. Likewise.. youtube.com still works with google chrome with hosts also turned off for youtube.com ip. chrome must have its own proxy. Feb 5, 2020 at 11:35
  • 1
    Command Line Interface(CLI) or otherwise known as a terminal. Graphic User Interface(GUI). If you use the command dig youtube.com A in a terminal to find the IP for youtube evey 5 minutes, you will see that the IP will change eventually. Squid, Privoxy, Tinyproxy, Polipo are just a few examples of proxy servers for linux. They could be used on a single computer. It may be a little over kill but an option.
    – da_kingpin
    Feb 5, 2020 at 13:50
  • proxy is based on web browser? and you need to pay for a proxy service right? It looks like openDNS.com is the way to go. Feb 6, 2020 at 0:31
  • 1
    No you do not need to pay for a proxy service. You can set up a proxy server on you own system to act as sort of web filter to block sites you don't want users to have access to. I suggest reading about the programs I mentioned in my last comment before trying to install any. There are many articles available that can be "googled" to learn about setting them up on your system and how they work.
    – da_kingpin
    Feb 6, 2020 at 3:05
-1

You can easily block websites in /etc/hosts by adding entries:

0.0.0.0 youtube.com
0.0.0.0 google.com
1
  • 1
    It seems that google chrome will find youtube.com but opera cannot. Feb 5, 2020 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .