Use Pi-Hole to block ads on all devices in your network

Sure ad blockers have been around for a long while now, but those are typically only available for your web browsers and not ever device allows you to install them such as cell phones, media players, smart TV’s, etc. I came across a neat project that allows you to block web ads on every device in your network, called Pi-Hole.

In a nutshell Pi-Hole was developed to run on a Raspberry Pi, but will run on most any Debian based distro, and will act as a DNS server to which you point your devices or router to use as the DNS server so that all requests are filtered through Pi-Hole. Pi-Hole then blocks 100’s of thousands ad domains. All without having to use a single browser extension and for FREE!

So while Pi-Hole is made to run on a Raspberry Pi I decided to run Pi-Hole within my VMware home lab on a Ubuntu 16.04 LTS virtual machine using 1 vCPU and 1GB memory.

Below are the steps I performed to install Pi-Hole after I had Ubuntu installed on the VM.

How to install Pi-Hole on Ubuntu

  1. Lets start off making sure our Ubuntu install is updated so type in the following command:
    sudo apt-get update && sudo apt-get upgrade -y

    ubuntu ssh update system

  2. Lets get the Pi-Hole script and save it as pihole-install.sh by typing the following:
    sudo wget -O pihole-install.sh https://install.pi-hole.net

    pi hole download script

  3. It’s best practice not to blindly run any script you download from the internet and at least give it a quick look over, so lets open it in nano:
    sudo nano pihole-install.sh

    pi-hole view script

  4. After you’re done looking at pihole-install.sh simply press CTRL+X to exit nano.
    pi-hole close view script
  5. Now we need to make pihole-install.sh executable by typing:
    sudo chmod +x pihole-install.sh

    pi-hole chmod script

  6. Start the Pi-Hole installer:
    sudo ./pihole-install.sh

    pi-hole install script

  7. Press ENTER at the introduction screen.
    pi-hole install 1
  8. Press ENTER again to start configuring the network settings.
    pi-hole install 2
  9. Select the network adapter you want to use and press ENTER.
    pi-hole install 3
  10. Select which protocols you want to block ads.
    pi-hole install 4
  11. Next you can configure a static IP for Pi-Hole. I’ll use the current settings and select YES.
    pi-hole install 5
  12. Now select which upstream DNS service you want to use with Pi-Hole.
    pi-hole install 6
  13. Pi-Hole is now installed and ready for use. Either update all your devices DNS settings to your Pi-Hole IP or simply set your Router DNS to the Pi-Hole server IP.
    pi-hole install 7

Once you’ve changed your devices or router to use Pi-Hole as the primary DNS server you are essentially done and will no longer see any ads. If you want to enable/disable pi-hole ad blocking or whitelist certain ad domains then you can easily do so by accessing the Pi-Hole admin panel by going to: http://<PIHOLE_IP>/admin

pi-hole admin panel

They also give you a cool dashboard to see just how many ads Pi-Hole has been blocking for you and other stats – very neat stuff!

Check out the Pi-Hole website here and donate to help them out!

Similar Posts

  • Setup Synology Syslog server for VMware ESXi

    After performing my home lab upgrade, ESXi now runs from a USB stick and because of that vSphere would complain that the system logs where on non-persistent storage:

    ESXi syslog error

    If I wanted I could have ran the vCenter Server Appliance (vCSA) as it comes with it’s own syslog server, or I could have used something like KIWI or Splunk to be my syslog server. I instead went the route of my Synology NAS as it too has the ability to act as a syslog server and these are the steps I performed to setting it up.

    Read More “Setup Synology Syslog server for VMware ESXi”

  • VMware ESXi 5 fails to install on Intel NUC, “No Network Adapters” error

    If you use the VMware ESXi 5 ISO image and try to install it on an Intel NUC you’ll receive the following error during the install.

    No Network Adapters

    No network adapters were detected. Either no network adapters are physically connected to the system, or a suitable driver could not be located. A third party driver my be required.

    Ensure that there is at least one network adapter physically connected to the system before attempting installation. If the problem persists, consult the VMware Knowledge Base.

    The “No Network Adapters” on the Intel NUC error message during the ESXi install is because VMware removed a number of drivers (non-enterprise drivers) from their ESXi 5.x image and in order to use the Intel NUC as an ESXi host you need to create a customized ESXi image with the NIC drivers added to the image.

    Read More “VMware ESXi 5 fails to install on Intel NUC, “No Network Adapters” error”

  • Secure your Synology NAS, install a SSL certificate

    I’ve been using the default setup on my Synology DS412+ with HTTPS enabled for a while now but knew it really wasn’t all that secure without a proper SSL certificate and creating a self-signed certificated isn’t all the much better and can be easily forged. I decided it was about time I used a “real” certificate to better secure the NAS.

    Prerequisites before starting

    • You need to own a domain name, for example MikeTabor.com and be able to receive email from the domain name.
      If you don’t already have a webhost for the domain, I’d suggest BlueHost.

    • You also need a DDNS service setup. In this case and for my use, I simply use the Synology DDNS service they offer for free.
    • With those two setup, you will also want to add a CNAME DNS forward from your domain (or subdomain if you wish to go that route) to your DDNS service.
    • Finally you’ll want to make sure Port Forwarding has been configured on your router.

    Read More “Secure your Synology NAS, install a SSL certificate”

  • How to use Site Recovery Manager DR IP Customizer

    As one of the tasks given to me include protecting critical virtual machines via Site Recovery Manager (SRM) I ran into an environment that needed to be protected and have static IP’s assigned to them. The environment consists of about 15 VM’s, all of the VM’s each have 5 NIC’s with two of the VM’s having 9 NIC’s – that’s a lot of NIC’s to manually configure on both the Protected and Recovery side in SRM.

    Looking through the SRM Documentation I was able to see that VMware has graced us with a wonderful tool to greatly speed up this process, dr-ip-customizer.exe!

    How to use VMware DR-IP-Customizer

    Read More “How to use Site Recovery Manager DR IP Customizer”

  • Crucial 16GB memory, perfect for Intel NUC

    crucial 16gb 204pin memory

    I’m a huge fan the of Intel NUC‘s for a VMware home lab. In fact I just recently picked up my third Intel NUC to give me more head room for a small VMware Horizon (View) environment at home.

    I typically use G.Skill memory in my NUC’s as I’ve had great luck with the brand in my desktop and laptop for years. However G.Skill has been increasing in price which made me look around for alternatives and came across Crucial DDR3 204-pin memory for less money, but days after I purchased it they too went up in price. However they are now back on sale and cost about $50 less then the G.Skill memory I have been using in my first two NUC’s.

    I’ve been using the Crucial memory now for the last several months without any problems and even though they are rated at a lower voltage I can’t say I really see any difference in power savings or consumption compared to the G.Skill 1.5V. If you’re looking to upgrade now might be a good time to take advantage of the sale price.

  • Installing DD-WRT on an ASUS RT-AC66U router

    I recently upgraded my EnGenius ESR-750H wireless N router to an Asus RT-AC66U wireless AC router. The EnGenius router has been pretty good for me but basic and no support for other firmware. The Asus RT-AC66U not only has a number of added features and support for 802.11ac, it also doesn’t seem to be plagued with the port 32764 bug or the Linksys “TheMoon” virus that’s been going around on select Linksys models, but the Asus also has a number of firmware options that can be used with this router such as Merlin, Tomato, and DD-WRT.

    I’ve used DD-WRT in the past with other routers and had great success and decided to go that route with my new AC66U router as well.

    How to install DD-WRT on Asus RT-AC66U

    Read More “Installing DD-WRT on an ASUS RT-AC66U router”

Leave a Reply to Stibbons Cancel reply

Your email address will not be published. Required fields are marked *

9 Comments

  1. I’m amazed this guide hasn’t gained more popularity considering its noob-friendly, curl-command-avoiding benefits. Took so long to find out the safest, most straightforward way to go about installing this.

    Kudos

    1. @disqus_V450ceqG3H:disqus I can’t say for sure as I’ve either never ran into a web site that blocks you entirely for adblock or maybe I have and just never been effected by it. Got a website in mind that I can test for you?

  2. i installed it in a vm as you suggested, but my pi hole is working only inside vm. Not even on my host or any other machine. i am able to ping that ip address but could not launch pihole admin. any other settings do i need to do?

  3. Tha k you for this simple step by step instruction using a VM. One of these says I’ll get an actual pi, but this will suit just nicely until then. Many thanks once more!