How can I block websites?
2026-06-12 16:42 UTC
Replies (26)
-
@Holytimes@sh.itjust.works 2026-06-12 16:52
Just set the site to be hidden? If it’s not in the list you didn’t even know its an option and thus everything else is moot. Pretty sure every search engine at thing point has a option to just “not show results from this website” or equivalent. Out of sight out of mind.
-
@anamethatisnt@sopuli.xyz 2026-06-12 17:11
Only thing I can think of is to remove your default account from the sudoers file and have an account with a frustratingly long password written on physical paper hold the keys to the kingdom. That will make a whole lot of other things a hurdle too though.
-
@rain_worl@lemmy.world 2026-06-12 17:21
i’m curious what websites are you doing. what’s the threat model??
-
@kungen@feddit.nu 2026-06-12 17:31
Therapy of some sorts is probably going to be more effective than making self-blocks, especially if you’re technically competent. I wish you luck with stopping whatever addiction it is.
-
@Levi@lemmy.ca 2026-06-12 17:48
If redirecting with /etc/hosts isn’t enough, you could set up a cron job (I guess as root?) to re-copy a hosts file back to /etc/hosts every half hour or something. That way even if you do manually change /etc/hosts for an quick peak of an illicit website, it’ll go back to being blocked in a short amount of time. This’ll add a bit of the “pain in the ass” factor.
-
@BartyDeCanter@piefed.social 2026-06-12 18:00
Setup a PiHole and add them to the blocklist. Then make the PiHole password stupid long and write it down. Then take the paper, put it in a safe, and put it in the highest shelf in the back of your closet. Recurse safes and passwords as much as needed.
-
@whatiswrongwithyou@lemmy.ml 2026-06-12 18:17
You’re gonna have better luck changing your habits than you will making a block that you yourself can’t overcome.
-
@undefinedTruth@lemmy.zip 2026-06-12 22:25
NextDNS is a good option for your use case. It allows you to block entire categories of websites and even has an option to setup a schedule on when you are allowed to access them. It also has blocklists you can pick from and the ability to blacklist and whitelist individual domains. And the free plan is very generous. You can just try it and see how it works for you.
-
@Cyber@feddit.uk 2026-06-12 23:21
DNS… set your system up to use an external DNS provider like OpenDNS where you can select categories to block. I used this to block adult, gambling, malware, etc at the grandparent’s house when the kids were growing up and starting to search the internet for school homework, etc. If it’s done in the router you’ll cover all devices and you give someone else the password, so you can’t change it.
-
@MonkderVierte@lemmy.zip 2026-06-13 09:21
greasyfork.org/…/1682-google-hit-hider-by-domain-…
-
@staircase@programming.dev 2026-06-13 15:05
thanks all, these are good suggestions
-
@communism@lemmy.ml 2026-06-13 23:05
Maybe block on your router and save your router password such that you need to jump through several hoops to unlock it, eg password saved in one password manager DB whose master password is in another DB whose password is in another DB, etc. If you have to unlock like 10 password databases to get into your router, you’ll probably give up on whatever bad habit you were trying to do as it’s too much effort.
-
@jdnewmil@lemmy.ca 2026-06-14 02:07
See a psychiatrist. You already have root on these systems… if you are truly a split personality then fences aren’t going to prevent your other self from doing whatever they want.
-
@Tenderizer78@lemmy.ml 2026-06-14 02:18
DNS level blocking is a massive pain to circumvent. Adguard DNS and NextDNS allow you to do this. Mullvad DNS allows you to block adult websites, gambling sites, and (optionally) social media without creating an account.
-
@redrumBot@lemmy.ml 2026-06-14 04:18
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;
-
@racketlauncher831@lemmy.ml 2026-06-14 05:07
Don’t look for a solution that is technical where the problem is mental.
-
@barlog@lemmy.ml 2026-06-14 05:47
I use NextDNS and it has feature to block domains. Unfortunately i often unblock it back.
-
@Mensh123@lemmy.world 2026-06-14 08:08
LeechBlock NG isn’t exactly what your’e looking for but it still may help. Of course, it’ll have no effect if UBO and the DNS already shut everything off.
-
@redrumBot@lemmy.ml 2026-06-14 14:28
You can use iptables to block connections, by example, using ufw the uncomplicated firewall: # apt install ufw bind9-dnsutils # Install ufw and nslookup # uIPs=$((nslookup reddit.com && \ nslookup www.reddit.com && \ nslookup redd.it && \ nslookup redditstatic.com && \ nslookup www.redditstatic.com) \ | awk '/^Address: / { print $2 }' | sort -u); \ for uip in ${uIPs}; do \ echo -n "${uip} " && \ ufw deny from "${uip}" comment 'deny reddit.com'; \ ufw deny out to "${uip}" from any comment 'deny reddit.com'; \ done; # ufw enable # ufw status numbered
-
@dieTasse@feddit.org 2026-06-14 16:18
You could try behavioral therapy. Doesn’t need to be psychiatrist (but does have to be professional).
-
@hexagonwin@lemmy.today 2026-06-14 19:04
use the redirector addon to auto redirect somewhere else
-
@tarzst@sh.itjust.works 2026-06-13 12:11
/etc/hosts and set the websites to go to 0.0.0.0 or 127.0.0.1
-
@Delilah@lemmy.blahaj.zone 2026-06-12 18:25
Therapy is probably a better option.
-
@exaybachae@startrek.website 2026-06-14 04:49
Private DNS service.
-
@Novocirab@feddit.org 2026-06-12 20:09
Roughly from high level to low level: 1. uBlock custom filters 2. Make pages unusable or less attractive by wonky per-site browser or extension settings 3. IP and DNS blocks on your local machine 4. Run a DNS proxy on your local machine and block domains with it 4. Host a pihole server on a different machine, make it your DNS server and block domains there 5. IP and DNS blocks in your router (if your current one has no option for this, consider buying another, preferably used) Best apply the methods arbitrarily, so that you get even more confused about how you might restore access to a given website. Options 5 and 6 may be the only viable ones for locking down certain smartphones or tablets.
-
@D_Air1@lemmy.ml 2026-06-12 22:51
Any of the adblockers can do this. Pihole, adguard home, technitium. Ublock origin to. You can probably do it pretty painstakingly through the hosts file as well.