Block ads with alias?

Started by conanTheRouter, June 17, 2018, 11:32:55 PM

Previous topic - Next topic
Hi!

So I'm trying to block ads why adding aliases.

I have found this thread: https://forum.opnsense.org/index.php?topic=7207.msg32357#msg32357

I have added my list under "Firewall -> Aliases -> View", https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

Then, according to the thread, I added a block rule under "Rules -> Floating". But, it doesn't work when visiting https://pi-hole.net/pages-to-test-ad-blocking-performance/

Can someone pls tell me how the floating rule should be set-up to work?

June 18, 2018, 09:09:19 AM #1 Last Edit: June 18, 2018, 09:13:30 AM by marjohn56
That's for Geo IP blocking. What you need is DNS bocking. I found a good method a couple of weeks ago, works perfectly.


Try this..

https://devinstechblog.com/
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Nice! Seems to a hassle comparing to updating lists with pfBlocker or the geoIP.  ???

It's a serious hassle... took me all of three minutes to configure.. 8)
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

I've tried the script using the MVPS hosts file on OPNsense 18.1.10-i386 but the script just generates a 0 byte file and doesn't work.

What is the correct format of the /var/unbound/ad-blacklist.conf file?

I've tried
abcstats.com 0.0.0.0

and
0.0.0.0 abcstats.com

and
abcstats.com 127.0.0.1

and
127.0.0.1 abcstats.com

but I keep getting the error

opnsense: /usr/local/etc/rc.bootup: The command '/usr/local/sbin/unbound -c '/var/unbound/unbound.conf'' returned exit code '1', the output was '/var/unbound/ad-blacklist.conf:1: error: unknown keyword '127.0.0.1' /var/unbound/ad-blacklist.conf:1: error: unknown keyword 'abcstats.com' read /var/unbound/unbound.conf failed: 2 errors in configuration file [1530118919] unbound[39953:0] fatal error: Could not read config file: /var/unbound/unbound.conf'

and DNS crashes

I am currently away having a few days R&R, so I cannot check the format. However I suggest you do exactly as said in the link provided and examine the file created to see what the format is. It worked first time when I initially set it up.
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member