tl;dr what are all the ways I can block a website on linux? Debian if it’s relevant.
I want to stop myself using certain sites. Since I’m reasonably techy and can work round all blocks I’ve come up with, I’ve found an effective approach is to apply as many hurdles as possible, so that visiting the website takes effort.
So far I’ve added the site to ublock’s block list, and redirected sites via /etc/hosts. What other options are there?
While I have admin access to the router, I’m not allowed to block sites there.


You can also use a firewall to deny/reject outgoing and incoming traffic to those IPs. By example, with
ufw:# apt install ufw bind9-dnsutils # install Uncomplicated Firewall and dig # ufw enable # activate the firewall # dig +short reddit.com # get reddit A IPs 151.101.65.140 151.101.1.140 151.101.193.140 151.101.129.140 # ufw deny in on all from 151.101.65.140 comment 'deny in connections to reddit' # ufw deny out on all to 151.101.65.140 comment 'deny out connections to reddit' . . .Or in only one line:
uIPs=$(dig +short reddit.com); for uip in "${uIPs}"; do echo "$uip"; done;