Trying blockwebsites in Linux..
Steps to block websites in Linux
Open terminal shortcut keys Ctrl + Alt + T. Type sudo gedit /etc/hosts and type Ubuntu password. Then at the bottom of file. Type each website’s name you want to block like this: 127.0.0.1 www.facebook.com 127.0.0.1 www.youtube.com Blocking websites has gone well but now blocking websites through this doesn't work anymore.. I don't know why.. I tried to block 127.0.0.1 www.lichess.org and it didn't block it.. Terminal just stated (gedit:6059) warning: 03:11:57.960: Set document metadata failed: Setting attribute metadata: gedit- encoding not supported. This blocking way doesn't work anymore.. It doesn't block anymore. |
There is a lot to this question.
One is how a FQDN can be looked up. Might use dig to see what is being returned. Also in that is ipv6 lookup. The order of lookup used to be almost always hosts file first but can be changed to different orders. Cache can be causing. Any number of variations on the URL might need to be edited to hosts or wild cards used like 0.0.0.0 *.ru Last part is what seems to be the way you are trying to edit the file. Might use vim instead. |
You might also find it more useful to route through Squid and / or block using NFTables. As far as trackers go, there is a lot more to either the two examples than the single domain.
|
Quote:
Code:
file /etc/hosts |
Quote:
|
You are not blocking network traffic to websites, you are only blocking DNS resolution, and modern browsers tend to use secure DNS which is impervious to this type of blocking e.g. in firefox - 'enable DNS over HTTPS' in network settings.
|
another easy option is to look into Pi-Hole. You can run it as a VM, local, or on the RPi. This is a full DNS local resolver and you can block domains with or without wildcards.
|
Linux Hebrews
jefro,turbocapitalist and ondoho, it's hard for me to follow your advice because can you give more simple advices like just simple step by step advices for total linux beginner. It's hard to follow that linux programming language.. I don't understand those texts..
|
Quote:
|
Sure:
Code:
export EDITOR=geany Code:
export EDITOR=nano |
Doesn't all of the only work as long as your browser and/or devices are NOT allowed to use DoH - DNS over HTTPS or DoT - DNS over TLS?
Modern or current version browses may default to an external secure DNS. If it's not using port 53 and/or local DNS, will any of this solve an issue? https://support.mozilla.org/en-US/kb...dns-over-https https://blog.chromium.org/2020/05/a-...wsing-DoH.html |
|
Quote:
|
Ondoho:
file /etc/hosts ls -l /etc/hosts cat /etc/hosts When i tried to wrote those in the terminal. Nothing happened.. Jefro: One is how a FQDN can be looked up. Might use dig to see what is being returned. Also in that is ipv6 lookup. The order of lookup used to be almost always hosts file first but can be changed to different orders. Cache can be causing. Any number of variations on the URL might need to be edited to hosts or wild cards used like 0.0.0.0 *.ru How i look FQDN in my computer and what is even FQDN? Okay, how do i look ipv6 and what is ip6b?? What is cache and and how do i handle cache??? So can i block websites just writing 0.0.0.0 and then websites in the hosts?? Turbocapitalist: What is Squid and how can i use Squick to block websites??? Where do i find squid from my computer?? LVM: You are not blocking network traffic to websites, you are only blocking DNS resolution, and modern browsers tend to use secure DNS which is impervious to this type of blocking e.g. in firefox - 'enable DNS over HTTPS' in network settings. What is DNS resolutions? How do i block then these websites if that doesn't work?? Ileb: another easy option is to look into Pi-Hole. You can run it as a VM, local, or on the RPi. This is a full DNS local resolver and you can block domains with or without wildcards. So what is Pi- Hole? How do i look Pi-Hole? Does it happen through terminal or what? What commands i should use it order to look it??? What is VM,Local and the RPi?? I don't understand those words.. How do i even run those??? What is DNS Local resolver ??? Turbocapitalist: export EDITOR=geany sudoedit /etc/hosts Or Code: export EDITOR=nano sudoedit /etc/hosts I was writing those in my terminal but nothing happened... DJK:I have only google chrome in my computer not mozilla.. Ondoho: I tried to type those commands in terminal and nothing happened.. |
pihole has its own website. https://pi-hole.net/
|
All times are GMT -5. The time now is 10:58 PM. |