Adding to the /etc/hosts file <resolved>

Message
Author
Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Adding to the /etc/hosts file <resolved>

#1 Post by Bierhundt »

I'm trying to add to my /etc/hosts file. The list I'm using is at this URL https://someonewhocares.org/
using the instructions from this site https://www.makeuseof.com/tag/modify-ma ... ile-linux/
When I went to the terminal and used nano, it said the /etc/hosts file is unwritable (??). There is already some info there, but it won't let me add the hosts file to stop all the ads I've been getting lately.

Is the /etc/hosts file in MX closed for some reason, or am I doing something wrong (wouldn't be the first time ;>) ). Years ago I used to modify my /etc/hosts file to get rid of ads, so I thought I'd do it with MX, since I saw a post here on post # 24 viewtopic.php?f=80&t=48115&start=20 by bigbenaugust.

He also says this:
I have a script for this: https://github.com/bigbenaugust/make_hosts that I have used for many distros.

But the block-advert.sh in the MX/antiX repos is nicer and has a GUI.
I have no idea how to use a script anymore (it's been too many years, and age has crept up on me). I'll do a search and look into using a bash script for now, but I'd really like to know why the /etc/hosts file is unwritable!
I went to the package manager and installed block advert, there was a selection named 'unblock' which I didn't check - is that another blocking service or is that checkbox meant for getting rid of the blocking services?

TIA, Bierhundt
Last edited by Bierhundt on Sun Jan 27, 2019 9:43 pm, edited 2 times in total.

User avatar
PondLife
Posts: 68
Joined: Wed May 09, 2018 12:24 pm

Re: Adding to the /etc/hosts file

#2 Post by PondLife »

You will need to use "sudo" for root access to do this.

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file

#3 Post by Bierhundt »

PondLife wrote: Sun Jan 27, 2019 9:32 am You will need to use "sudo" for root access to do this.
I did use sudo, at least once - maybe I forgot the second or third time around - THX

User avatar
PondLife
Posts: 68
Joined: Wed May 09, 2018 12:24 pm

Re: Adding to the /etc/hosts file

#4 Post by PondLife »

If using sudo/nano still gives you problems then you could try opening Thunar as root then copy and pasting the info into hosts that way, which worked for me.

User avatar
fehlix
Developer
Posts: 10379
Joined: Wed Apr 11, 2018 5:09 pm

Re: Adding to the /etc/hosts file

#5 Post by fehlix »

Bierhundt wrote: Sun Jan 27, 2019 9:25 am I'm trying to add to my /etc/hosts file. The list I'm using is at this URL https://someonewhocares.org/
using the instructions from this site https://www.makeuseof.com/tag/modify-ma ... ile-linux/
FWIW, antiX-Advert-Blocker is using /etc/hosts to block unwanted stuff.
In MX you'll find within populare apps.
antix-Advert-Blocker.png
:puppy:
You do not have the required permissions to view the files attached to this post.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file

#6 Post by Bierhundt »

Thanks all, I went back and found out that 'advert' uses many of the names in 'someonewhocares' so I've got both just to make sure, since someonewhocares was updated/upgraded Jan 25th, and antix may or may not have added anything in quite a while. I then went onto You Tube and found that most ads have either disappeared or are blank, but I found a few that didn't go away, so I added those to my /etc/hosts as well, and so far I get no ads on You Tube - hopefully that will continue, now that I know how to find and add the addresses of those ads. Here are the ones I found so far:

#ads I have added below
127.0.0.1 mcdonaldads.com
127.0.0.1 donaldjtrump.com
127.0.0.1 haveenergyatanyage.com
127.0.0.1 groupon.com
127.0.0.1 forthepeople.com
127.0.0.1 squattingslav.tv
127.0.0.1 action.donaldjtrump.com
127.0.0.1 get.blaze.com
127.0.0.1 grammarly.com
127.0.0.1 organifishop.org
#end of ads I have added

It seems to work, because I've been watching a lot of intros to You Tube videos just to see if it works, and I've seen no ads. I'm sure there will be one every so often, but I'll add them to my list so I can have as much ad-free videos as I can get!
Last edited by Bierhundt on Mon Feb 18, 2019 6:58 pm, edited 3 times in total.

User avatar
Stevo
Developer
Posts: 12838
Joined: Fri Dec 15, 2006 8:07 pm

Re: Adding to the /etc/hosts file

#7 Post by Stevo »

The Ublock Origin browser extension also does a fine job of blocking ads on YT, as well as many other sites, along with a lot of other crud.

User avatar
fehlix
Developer
Posts: 10379
Joined: Wed Apr 11, 2018 5:09 pm

Re: Adding to the /etc/hosts file

#8 Post by fehlix »

Bierhundt wrote: Sun Jan 27, 2019 4:28 pm ... and antix may or may not have added anything in quite a while.
antiX-advert Blocker will download the latest, when (re-) activating the lists.
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file

#9 Post by Bierhundt »

Stevo wrote: Sun Jan 27, 2019 4:44 pm The Ublock Origin browser extension also does a fine job of blocking ads on YT, as well as many other sites, along with a lot of other crud.
I mustof read that too fast, I thought it said Unblock - Thanks!!!

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file

#10 Post by Bierhundt »

fehlix wrote: Sun Jan 27, 2019 4:46 pm
Bierhundt wrote: Sun Jan 27, 2019 4:28 pm ... and antix may or may not have added anything in quite a while.
antiX-advert Blocker will download the latest, when (re-) activating the lists.
:puppy:
Oh, I figgered it would update sooner or later, I just wanted to get it over with, Thanks.

Post Reply

Return to “General”