<p>Kevie, a co-host of <a href="https://tuxjam.otherside.network">TuxJam</a>, talks about setting up a Raspberry Pi as a network wide ad and domain blocker using the <a href="https://pi-hole.net/">Pi-hole</a> project.</p>
<p>Before starting this project you will need:</p>
<ul>
<li>A Raspberry Pi with Raspberry Pi OS installed and SSH enabled</li>
<li>A basic knowledge of changing the settings on your router. I can't talk you through this as every router is different. Specifically you need to know how to give a device a static IP address and set a DNS server</li>
<li>The ability to use SSH</li>
</ul>
<p>Once we have SSH'd into the Pi the first thing we should do is update it:</p>
<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y</code></pre>
<p>Then we need to install the Pi-hole software itself. We can do this with the command:</p>
<pre><code>curl -sSL https://install.pi-hole.net | bash</code></pre>
<p>This will start an installation wizard</p>
<p>Once this has completed, it is recommended that you set a new admin password:</p>
<pre><code>pihole -a -p</code></pre>
<p>Exit the Pi and go to the admin web page by entering <i>{the_IP_of_your_Pi}</i>/admin in your browser's address bar.</p>
<p>Click on <b>Adlist</b> on the left side and you should see 2 input boxes. The <b>address</b> is where we can enter our adlist, the comment box is purely optional. Go to <a href="https://firebog.net/">firebog.net/</a> Choose one or two from each category, but make sure that these are active (the ones in green).</p>
<p>Add the following two addresses to Adlist if you wish to block pornographic site:</p>
<ul>
<li>https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/pornography-hosts</li>
<li>https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/porn/hosts</li>
</ul>
<p>For a list of specific types of sites to block then visit <a href="https://blocklistproject.github.io/Lists/">https://blocklistproject.github.io/Lists/</a></p>
<p>If using Cloudflare, you can add another pornography filter. Click on <b>Settings</b> on the left and then the <b>DNS</b> tab at the top. In <b>Custom 1 (IPv4)</b> enter the value <b>1.1.1.3</b>, make sure that it is ticked.</p>
<p>If there is a specific site that you want to block then click on <b>Domains</b> in the menu on the left and add the domain. If you want to block it, then click <b>Blacklist</b> or if Pi-hole is blocking a site that you want to access then click on <b>Whitelist</b>.</p>
<p>Before we exit we must apply these changes or they will not take effect. On the left click on <b>tools</b> and then <b>Update Gravity</b> from the drop down menu. Press the Update button (it will take a couple of minutes to complete). You must do this every time that you make a change. Any time you add a new Adlist, Domain, Whitelist or Blacklist, it will not take effect until you do this.</p>
<p>Go to your Router's homepage, <b>set the DNS server to the IP address of the Pi</b>. This means that all traffic will run through the Pi-hole. Don't forget to hit apply if necessary before exiting.</p>
<p>One final task: <b>reboot your router</b>. This will force every device to reconnect and everything will be running through the Pi-hole. </p>

