Block New Gtlds in all Browsers on Linux Mint?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
linuxdog
Level 2
Level 2
Posts: 57
Joined: Thu Sep 26, 2013 2:48 pm

Block New Gtlds in all Browsers on Linux Mint?

Post by linuxdog » Sun Aug 21, 2016 11:09 pm

I want to block mostly all new domain extensions on Linux Mint. All sites I've come across are just spam garbage.

First I tried using the gui domain blocker and wildcarding the entire domain extension. So I used - *.tld - but that didn't work.

Any suggestions for how to do this?

linuxdog
Level 2
Level 2
Posts: 57
Joined: Thu Sep 26, 2013 2:48 pm

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by linuxdog » Tue Aug 23, 2016 10:00 am

Someone recommended using IPTables. Good idea?

User avatar
JohnBobSmith
Level 4
Level 4
Posts: 338
Joined: Wed Nov 06, 2013 5:42 pm
Location: Canada

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by JohnBobSmith » Tue Aug 23, 2016 11:48 am

I would say that using your router is the easiest way to catch all traffic. Which make, model, and firmware are you using on your router? You can find this out by connecting to 192.168.1.0 or 192.168.1.1 in any web browser. You may need a username/password, though that's for you to figure out. Once logged in to your router, usually you can find a tab/label called something along the lines of "restrictions" or "security" or "DNS". From there, you should be able to add your device's MAC address. This is to guarantee your computer is the only one being affected, 100% of the time. IP addresses can change. Then block whatever you want. Just be careful not to lock yourself out! Most changes will be instant, and wont require a network restart. So long as your mac address isn't being spoofed, all web traffic (not just strictly speaking web browsers) will be subject to whatever rules you setup. :)

A word on iptables: While you can configure iptables, I've never really bothered with it. I have no idea what it has for features; only that it is a powerful firewall. I see no reason to mess with it at this time. :)

EDIT: A really easy way to block strictly browser based adverts and spam would be to use an ad-blocker. AdBlock+ is one such example. This program installs as a browser plugin, and last I remember is pretty customizeable. Compared to the risk of trashing your network, this might be the best approach ;)
Image
If you want to change the world, start by changing yourself.
Success is often 1% inspiration and 99% perspiration.
You get one shot at life, so live to the maximum, not the minimum.

linuxdog
Level 2
Level 2
Posts: 57
Joined: Thu Sep 26, 2013 2:48 pm

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by linuxdog » Tue Aug 23, 2016 11:52 am

So your thoughts on this is I shouldn't mess the router settings to block all DNS traffic from a particular domain extension?
JohnBobSmith wrote:I would say that using your router is the easiest way to catch all traffic. Which make, model, and firmware are you using on your router? You can find this out by connecting to 192.168.1.0 or 192.168.1.1 in any web browser. You may need a username/password, though that's for you to figure out. Once logged in to your router, usually you can find a tab/label called something along the lines of "restrictions" or "security" or "DNS". From there, you should be able to add your device's MAC address. This is to guarantee your computer is the only one being affected, 100% of the time. IP addresses can change. Then block whatever you want. Just be careful not to lock yourself out! Most changes will be instant, and wont require a network restart. So long as your mac address isn't being spoofed, all web traffic (not just strictly speaking web browsers) will be subject to whatever rules you setup. :)

A word on iptables: While you can configure iptables, I've never really bothered with it. I have no idea what it has for features; only that it is a powerful firewall. I see no reason to mess with it at this time. :)

User avatar
JohnBobSmith
Level 4
Level 4
Posts: 338
Joined: Wed Nov 06, 2013 5:42 pm
Location: Canada

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by JohnBobSmith » Tue Aug 23, 2016 12:04 pm

No, I'm saying that you should. Unless adblock+ works for you, in which case messing with the router would just be redundant.
Image
If you want to change the world, start by changing yourself.
Success is often 1% inspiration and 99% perspiration.
You get one shot at life, so live to the maximum, not the minimum.

linuxdog
Level 2
Level 2
Posts: 57
Joined: Thu Sep 26, 2013 2:48 pm

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by linuxdog » Tue Aug 23, 2016 12:05 pm

I've tried a few browser plugins and nothing seems to work on an entire domain extension.
JohnBobSmith wrote:No, I'm saying that you should. Unless adblock+ works for you, in which case messing with the router would just be redundant.

User avatar
JohnBobSmith
Level 4
Level 4
Posts: 338
Joined: Wed Nov 06, 2013 5:42 pm
Location: Canada

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by JohnBobSmith » Tue Aug 23, 2016 12:10 pm

Then I'm pretty sure messing with the router, very carefully, is the best/only option. Good luck!
Image
If you want to change the world, start by changing yourself.
Success is often 1% inspiration and 99% perspiration.
You get one shot at life, so live to the maximum, not the minimum.

User avatar
killer de bug
Level 14
Level 14
Posts: 5415
Joined: Tue Jul 08, 2008 1:49 pm
Location: Leuven, Belgium

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by killer de bug » Tue Aug 23, 2016 12:25 pm

the solution is in the hostfile.
viewtopic.php?t=130466#p706081
If it ain't broke, fix it until it is.

linuxdog
Level 2
Level 2
Posts: 57
Joined: Thu Sep 26, 2013 2:48 pm

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by linuxdog » Tue Aug 23, 2016 12:31 pm

Thanks. This can work for blocking an whole domain extension? Would I set the settings as a wildcard DNS? Example - *.tld - would that work?
killer de bug wrote:the solution is in the hostfile.
viewtopic.php?t=130466#p706081

User avatar
killer de bug
Level 14
Level 14
Posts: 5415
Joined: Tue Jul 08, 2008 1:49 pm
Location: Leuven, Belgium

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by killer de bug » Tue Aug 23, 2016 2:58 pm

Using wildcard doesn't work in the host file.
The first answer here may help you: https://askubuntu.com/questions/150135/ ... hosts-file
If it ain't broke, fix it until it is.

User avatar
Flemur
Level 16
Level 16
Posts: 6850
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by Flemur » Tue Aug 23, 2016 3:25 pm

"privoxy" can block domains with wildcards.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 19.1 Xfce/fluxbox
Manjaro openbox/fluxbox

linuxdog
Level 2
Level 2
Posts: 57
Joined: Thu Sep 26, 2013 2:48 pm

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by linuxdog » Tue Aug 23, 2016 5:41 pm

Thank you! I will check it out.
Flemur wrote:"privoxy" can block domains with wildcards.

linuxdog
Level 2
Level 2
Posts: 57
Joined: Thu Sep 26, 2013 2:48 pm

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by linuxdog » Tue Aug 23, 2016 5:42 pm

Thank I might try that.
killer de bug wrote:Using wildcard doesn't work in the host file.
The first answer here may help you: https://askubuntu.com/questions/150135/ ... hosts-file

User avatar
Flemur
Level 16
Level 16
Posts: 6850
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Block New Gtlds in all Browsers on Linux Mint?

Post by Flemur » Sat Aug 27, 2016 3:53 pm

Because the privoxy documentation is kinda, er, involved, here's part of my /etc/privoxy/user.action file that was based on my /etc/hosts entries:

Code: Select all

# from /etc/hosts #######################
{+block{From HOSTS}}
.1stack.com
.2mdn.net
.4dsply.com
.BeNaughty.com
.abmr.net
.adap.tv
...dozens more...
So it blocks "www.1stack.com", "stats.1stack.com", "q716238.1stack.com" etc.

To block more specifically, syntax is like this:

Code: Select all

et.nytimes.com
notification.adblockplus.org
stats.cnevids.com
aus5.mozilla.org
shavar.services.mozilla.com
I can still go to mozilla.com, but the browser can't talk to shavar.services.mozilla.com when it starts up.

Privoxy has a lot of ad-blocking-by-pattern already set up; if you don't want that, it's easy to delete it.

It's also pretty easy to disable it thru firefox or it's own GUI when necessary (I use another firefox profile that doesn't run thru privoxy).
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 19.1 Xfce/fluxbox
Manjaro openbox/fluxbox

Post Reply

Return to “Newbie Questions”