{"id":12,"date":"2021-01-06T17:04:00","date_gmt":"2021-01-06T17:04:00","guid":{"rendered":""},"modified":"2021-06-08T18:51:42","modified_gmt":"2021-06-08T17:51:42","slug":"pihole-adblocker","status":"publish","type":"post","link":"https:\/\/blog.hslracing.com\/myhome\/2021\/01\/pihole-adblocker.html","title":{"rendered":"PiHole AdBlocker"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>Many websites these days do not like you using traditional ad blockers such as <a href=\"https:\/\/adblockplus.org\/\">Adblock Plus<\/a>.<\/p>\n<p><a href=\"http:\/\/yahoo.com\/\">Yahoo<\/a>, for example will not even let you use their latest mail interface if you are using an ad blocker.<\/p>\n<p>Another alternative is to use something that blocks adverts at the DNS level such as <a href=\"https:\/\/pi-hole.net\/\">Pi-Hole<\/a>, you then set your <a href=\"https:\/\/pi-hole.net\/\">Pi-Hole<\/a> as your DNS resolver making use of some known lists of ad websites and  what happens is that for the majority of adverts, a zero DNS entry is  returned and that simply shows as blank space.<\/p>\n<p><a href=\"https:\/\/pi-hole.net\/\">Pi-Hole<\/a> was originally developed for use on a <a href=\"https:\/\/www.raspberrypi.org\/\">Raspberry Pi<\/a> (hence the name), however it can also be used on a stand-alone server or in a <a href=\"https:\/\/www.docker.com\/\">Docker<\/a> container.<\/p>\n<p>I chose to make use of the <a href=\"https:\/\/www.docker.com\/\">Docker<\/a> image <a href=\"https:\/\/hub.docker.com\/r\/pihole\/pihole\">pihole\/pihole<\/a>, and additionally use the <a href=\"https:\/\/hub.docker.com\/r\/klutchell\/unbound\">klutchell\/unbound<\/a> image as a local caching resolver.<\/p>\n<p>The  pihole configuration needs to be tweaked to make use of unbound, having  the IP of the unbound container as the primary and secondary DNS  resolvers.<\/p>\n<p>pihole configuration:<\/p>\n<p><span style=\"font-family: courier\">sudo docker run -d <br \/>&#8211;name=pihole <br \/>&#8211;network web <br \/>&#8211;link unbound <br \/>&#8211;hostname pi.hole <br \/>&#8211;restart=unless-stopped <br \/>&#8211;dns=127.0.0.1 <br \/>&#8211;dns=1.1.1.1 <br \/>-e PUID=1001 -e PGID=1001 <br \/>-e TZ=Europe\/London <br \/>-e VIRTUAL_HOST=pi.hole <br \/>-e VIRTUAL_PORT=80 <br \/>-e PROXY_LOCATION=pi.hole <br \/>-e WEBPASSWORD=&#8221;&lt;password&gt;&#8221; <br \/>-e ServerIP=192.169.99.30 <br \/>-e DNS1=172.20.0.5#5053 <br \/>-e DNS2=172.20.0.5#5053 <br \/>-p 6080:80 <br \/>-p 6443:443 <br \/>-p 53:53\/tcp <br \/>-p 53:53\/udp <br \/>-v \/Web\/pihole\/etc\/pihole:\/etc\/pihole <br \/>-v \/Web\/pihole\/etc\/dnsmasq.d:\/etc\/dnsmasq.d\/:z <br \/>-v \/Web\/pihole\/log\/pihole.log:\/var\/log\/pihole.log <br \/>pihole\/pihole<\/span><\/p>\n<p>unbound configuration:<\/p>\n<p><span style=\"font-family: courier\">sudo docker run -d <br \/>&#8211;name=unbound <br \/>&#8211;network web <br \/>&#8211;ip=172.20.0.5 <br \/>&#8211;restart=unless-stopped <br \/>-e PUID=1001 -e PGID=1001 <br \/>-e TZ=Europe\/London <br \/>-p 5053:5053\/tcp <br \/>-p 5053:5053\/udp <br \/>klutchell\/unbound<\/span><\/p>\n<p>Once up and running, you simply change your primary DNS resolver to be the <a href=\"https:\/\/pi-hole.net\/\">Pi-Hole<\/a> and it intercepts and removes the adverts for you.<\/p>\n<p>Since I run a <a href=\"https:\/\/unifi-network.ui.com\/dreammachine\">Ubiquiti UDM-Pro<\/a> as my DHCP server, I can set this at the DHCP level so by default everyone in my house uses the <a href=\"https:\/\/pi-hole.net\/\">Pi-Hole<\/a> as their primary resolver. <\/p>\n<p>I  have had this working happily for a number of months now and apart from  my son moaning about some of his gaming sites being blocked, it has  been pretty seamless.<\/p>\n<div style=\"clear: both;text-align: center\"><a href=\"https:\/\/blog.hslracing.com\/wp-content\/uploads\/sites\/6\/2021\/01\/Screenshot-2B2021-03-10-2Bat-2B16.39.21.png\" style=\"margin-left: 1em;margin-right: 1em\"><img decoding=\"async\" border=\"0\" data-original-height=\"1662\" data-original-width=\"2048\" src=\"https:\/\/blog.hslracing.com\/wp-content\/uploads\/sites\/6\/2021\/01\/Screenshot-2B2021-03-10-2Bat-2B16.39.21-300x243.png\" width=\"320\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Many websites these days do not like you using traditional ad blockers such as Adblock Plus. Yahoo, for example will not even let you use their latest mail interface if you are using an ad blocker. Another alternative is to use something that blocks adverts at the DNS level such as Pi-Hole, you then&hellip;<\/p>\n","protected":false},"author":1,"featured_media":119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5,3],"class_list":["post-12","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-homelab","tag-networking"],"_links":{"self":[{"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":2,"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/posts\/12\/revisions\/253"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/media\/119"}],"wp:attachment":[{"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hslracing.com\/myhome\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}