OPNsense Forum

English Forums => General Discussion => Topic started by: conanTheRouter on June 17, 2018, 11:32:55 pm

Title: Block ads with alias?
Post by: conanTheRouter on June 17, 2018, 11:32:55 pm
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?
Title: Re: Block ads with alias?
Post by: marjohn56 on June 18, 2018, 09:09:19 am
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/ (https://devinstechblog.com/)
Title: Re: Block ads with alias?
Post by: conanTheRouter on June 19, 2018, 05:40:17 pm
Nice! Seems to a hassle comparing to updating lists with pfBlocker or the geoIP.  ???
Title: Re: Block ads with alias?
Post by: marjohn56 on June 19, 2018, 06:47:06 pm
It's a serious hassle... took me all of three minutes to configure.. 8)
Title: Re: Block ads with alias?
Post by: nospam on June 27, 2018, 07:45:34 pm
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
Title: Re: Block ads with alias?
Post by: marjohn56 on June 28, 2018, 08:25:01 am
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.