Closed acagastya closed 2 years ago
Hey the update flag validates and updates the hosts.
Make sure your running it as sudo.
Also all you have to do is remove your local etc/hosts
and than run the install flag.
A better way to use this is to is with a VPN or a dns server.
@Prajwal-Koirala I ran sudo go run main.go -install
after sudo rm /etc/hosts
on macos, and it did not create a /etc/hosts
file. Why so?
Also, while this we figure that out, should putting these lines in /etc/hosts
do the work?
0.0.0.0 example.com
0.0.0.0 some-other-ad-site.com
@Prajwal-Koirala I ran
sudo go run main.go -install
aftersudo rm /etc/hosts
on macos, and it did not create a/etc/hosts
file. Why so?Also, while this we figure that out, should putting these lines in
/etc/hosts
do the work?0.0.0.0 example.com 0.0.0.0 some-other-ad-site.com
What error did it give u? No. That's the format of the file and not the actual content.
Hey.
try this.
sudo mv /etc/hosts /etc/hosts.old
sudo curl -o /etc/hosts https://raw.githubusercontent.com/complexorganizations/content-blocker/main/assets/hosts
sudo sed -i -e "s/^/0.0.0.0 /" /etc/hosts
@acagastya Any update?
@Prajwal-Koirala I gave it a shot (go binary is still not editing the hosts file). What I was looking for (and was pointed out to this repo on #ublock-origin on libera.chat) a OS-wide ublock-origin type of tool. I tried the 0.0.0.0 example.com
and after restarting, I opened, just for testing, youtube.com on safari, which does not have ublock origin add-on. I could still see ads. What kind of ads should I not be seeing using this tool? I think I might be using it incorrectly?
@Prajwal-Koirala I gave it a shot (go binary is still not editing the hosts file). What I was looking for (and was pointed out to this repo on #ublock-origin on libera.chat) a OS-wide ublock-origin type of tool. I tried the
0.0.0.0 example.com
and after restarting, I opened, just for testing, youtube.com on safari, which does not have ublock origin add-on. I could still see ads. What kind of ads should I not be seeing using this tool? I think I might be using it incorrectly?
Hey, There is no dns based blocking tool that's perfect, it's not possible at the current time, this will block a lot of the ads and other stuff based on domain names but what most people are looking for is stuff like ublock origin which has the ability to edit and block the content on a webpage rather than a dns based blocking tool.
So for example lets say you wanted to block all of example.com
this is the perfect tool but if u wanted to block example.com/ads
this isn't the right tool.
Its really good with blocking ads on a smaller services rather than larger ones, for example some random blog or something that rely on google than it will be blocked but something like youtube that can spin up 10000x new domains to server ads it will be harder and than they will just use youtube.com to server them too.
Hi, I was suggested this software yesterday, when I was looking for something like ublock-origin, but for the whole OS. I tried
go run main.go -install
on macos and it says"2021/09/19 09:26:43 Error: There is already a system host file presnet."
. I already have/etc/hosts
which has some localhost mappings. Is this programme supposed to make an entry for the blacklisted URLs in that file? When I rungo run main.go -update
, it echoes:but has a clean exit. What is supposed to happen after that?