Difference between revisions of "Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up Add blocking with dnsmasq"

From bering-uClibc
Jump to: navigation, search
(Prerequisites)
(manual setup)
Line 12: Line 12:
 
Enter the command:
 
Enter the command:
  
curl -s -d mimetype=plaintext http://pgl.yoyo.org/as/serverlist.php?hostformat=dnsmasqserver > /root/tmpfile.list
+
curl -s -d mimetype=plaintext http://pgl.yoyo.org/as/serverlist.php?hostformat=dnsmasqserver > /root/tmpfile.list
 +
 
 +
Check your file <code class ="filename">tmpfile.list</code>, you should have a list of server with the following format:
 +
server=/yieldlab.net/
 +
server=/yieldmanager.com/
 +
server=/yieldmanager.net/
 +
server=/... etc /
 +
 
 +
Then:
 +
 
 +
cp /root/tmpfile.list /etc/dnsmasq.d/addblock.list
 +
 
 +
Edit <code class ="filename">/etc/dnsmasq.conf</code> and enter:
 +
 
 +
conf-dir=/etc/dnsmasq.d
 +
 
 +
Restart <code class ="filename">dnsmasq</code> with:
 +
 
 +
/etc/init.d/dnsmasq restart
 +
 
 +
That's it, all the nasty adds should be gone !

Revision as of 05:55, 14 November 2016

Objectives

There is a lot of info on the net about setting dnsmasq to block advertisements, trackings... etc. This is a quick guide that shows a simple setup to filter add sites with dnsmasq.

Prerequisites

  • You will need Bering-uClibc 5.x or higher.
  • The curl.lrp package.

manual setup

Enter the command:

curl -s -d mimetype=plaintext http://pgl.yoyo.org/as/serverlist.php?hostformat=dnsmasqserver > /root/tmpfile.list

Check your file tmpfile.list, you should have a list of server with the following format:

server=/yieldlab.net/
server=/yieldmanager.com/
server=/yieldmanager.net/
server=/... etc /

Then:

cp /root/tmpfile.list /etc/dnsmasq.d/addblock.list

Edit /etc/dnsmasq.conf and enter:

conf-dir=/etc/dnsmasq.d

Restart dnsmasq with:

/etc/init.d/dnsmasq restart

That's it, all the nasty adds should be gone !