dnsmasq: blocking ad sites


#1

What is the proper way to configure dnsmasq to include block lists for ad files?

The configuration mode command “set service dns forwarding…”
doesn’t have options to include other files in dnsmasq.conf


#2

This is my own ugly hack.

— /config/vyatta-dns-forwarding.pl.orig 2016-04-30 14:47:06.497357294 +0200
+++ /opt/vyatta/sbin/vyatta-dns-forwarding.pl 2016-04-30 14:36:30.768321111 +0200
@@ -161,6 +161,8 @@
open(my $fh, ‘>’, $dnsforwarding_conf) || die “Couldn’t open $dnsforwarding_conf - $!”;
print $fh $config;
close $fh;

  • system(“cat /config/dnsmasq.bl >> /etc/dnsmasq.conf”);

}