Home Automation Home Assistant eBook Applied Artificial Intelligence eBook Cryptocurrency Blockchain Bitcoin ebook eBook TabShop Android Point of Sale (POS)

Kick out annoying Ads running a Pi-Hole Docker Container on your Synology NAS!

First things first: I did fell in love with my Synology NAS! After a year of running my DS-218+, I can’t believe how I used to work without it before. What is so special about the DS-218+ Synology DiskStation is not that it is an incredibly flexible network storage, BUT much more that it is capable of running docker containers!

When I first realized that I can seamlessly run my home assistant automation system as well as my MQTT broker right from my Synology NAS I was astonished.

No more additional hardware, no additional power consumption, just run it inside your NAS (which is powered on anyway).

But now, I came across another absolutely amazing use-case, which is to block all the annoying advertisements from every website I am reading. By running a Pi-Hole Docker container on my DiscStation, I can route all DNS requests through that local DNS server in order to block all the advertisement domains.

Sounds cool? It definitely is, as it is transparently blocking all ads for all your devices in your local network without any change within your browser.

Best thing is: As your browser is not even aware that all ads are automatically blocked by DNS, all the news sites can’t detect that you are blocking their content requests.

Blocking all the ads within the web pages you are loading by DNS is even speeding up your local network, as it simply avoids to load all the ad resources and annoying video ads and it renders web pages much faster than before.

How to set up Pi-Hole with your DiskStation?

See below the necessary steps for installing Pi-Hole on your NAS. I will go into detail for each of the steps in the following sections:

  1. Install Docker package within your DiskStation
  2. Install Pi-Hole docker image
  3. Launch Pi-Hole docker image on your NAS
  4. Configure your router to use your NAS as new DNS server
  5. Alternatively, configure your local devices network to use the NAS as new DNS server
  6. You are ready!

1. Install Docker package

First step, if you not already done so, install the docker package within your Synology package manager as shown below:

2. Install Pi-hole Docker image

After installing the docker package, you are ready to download your Pi-Hole docker image. You do so by navigating to the docker package, open it, search for the Pi-hole container, as shown below and download the image:

3. Configure and Launch Pi-Hole Docker Image

Launch the Pi-hole docker image and configure all its ports to ‘Auto’ except the DNS ports, as shown below:

Once the Pi-hole image is launched, you can check which port was automatically assigned to the HTTP administration interface. In my case it’s the port 32781. If you open your web browser you can reach your local Pi-Hole web interface by typing your IP along with YOUR_NAS-IP:32781/admin.

Your Pi-Hole web interface will show statistics about how many ads were already blocked, as shown below:

4. Configure your Router to use Pi-Hole as DNS server

The router configuration depends on your own router model. Check your router manual and search for the configuration of the DNS servers. Typically, you will find a Google DNS server configured there, which you delete and replace with the IP of your own Synology DiskStation.

Once you replaced the DNS configuration on your router to point to the address of your DiskStation IP, all devices within your network will route the DNS queries through your DiskStation’s Pi-Hole DNS server. The Pi-Hole server will then only return a correct DNS address for non-advertising addresses, which leaves all your browsers to not show the embedded adverts.

5. Alternatively, configure your device to use Pi-Hole as DNS

In my case, unfortunately my router does not offer the possibility to configure the DNS address.

An alternative here is to change the config on all your local devices, such as laptop, PC and tablets, to use your own Pi-Hole DNS server, as it is shown below:

I hope that my short article did gave you some ideas how to get rid of all the annoying ads within the websites you are reading day by day.

Overall, the Pi-Hole DNS server is a great way of kicking out the ads and to speed up your browsing experience.

Again a fine solution running on my beloved Synology drive.

Finally, I want to thank the team around Pi-Hole for building and maintaining such a great solution!! 🚀 🚀