Edit a host file to block websites?

Does this exist with Manjaro?
Essentially I want to block websites and clear the internet up for personal use and for when others use it too.

Just edit the /etc/hosts and add something like: www.google.com

That way, it blocks the domain. There are a lot of rules for that. A collection would for example hblock.

rerouting to can also be an acceptable block

PS another point for hblock :slight_smile: - I have it handle multiple lists and do the bulk of my blocking … with ublock:origin in the browser having many less lists and more doing cosmetic things.
You can also easily add/modify it with head/tail configurations and custom source lists.

EDIT - hey, you changed it from so now my first sentence makes no sense :stuck_out_tongue:
anyhoo - routing to yourself (often, but not always or to should usually work. Though that is also to say nothing of IPv6.

Anechdotally … on some system of old that accepted both it could be demonstrated that the ‘nowhere’ address ( performed marginally better.

1 Like

You could install dansguardian from the AUR. It has been around for ages already and it has quite a good reputation. :arrow_down:

pamac build dansguardian

DansGuardian documentation at the Debian Wiki

I dont think that will be working …

With upstream entirely gone … that AUR package wont build - it should either be removed or somehow updated with a new source (it hasnt been touched since 2016).

Hmm… Apparently it is has become superseded by another Smoothwall product — they were the ones developing it in the first place. :thinking:

Technitium DNS Server might be the one you are looking for (works similar to Pi-Hole). To quote from their description:

Technitium DNS Server is an open source authoritative as well as recursive DNS server that can be used for self hosting a DNS server for privacy & security. It works out-of-the-box with no or minimal configuration and provides a user friendly web console accessible using any modern web browser.

It is available in AUR. It is built with .NET and needs .NET installed.
I’m using it and it works great.

Another one is AdGuard Home, which is available also in AUR.

Avoid hblock. It’s know to have a lot of sites listed that one does not want blocked.

hblock is entirely customizable … you dont have to include larger lists.
Though … I’m not sure theres anything worth mentioning that the defaults would bother.

I use Diversion and pixelserv at the router level (Asuswrt-Merlin) with several lists. I also use ublockOrigin on my browsers.
Here are some list resources that may be of interest:

As always, you may need to whitelist some websites.

I just use a pihole as a dns (but not dhcp) server on my network. If I want to disable internet for others, I can disable all traffic (blocking reg expr *) only letting x client through, OR I can specifically block specific clients by using groups (enabled and disabled groups).
You don’t actually block traffic per se, but you block all dns-lookups in effect disabeling all internet traffic demanding a dns lookup, witch is most of it.
Ie, if someone is already watching a youtube, disabling them in the pihole wont stop that, but if they try to start a new youtube, it wont work. :smiley:

Quck and dirty but effective af.