Running Pi-hole on Synology alongside DNS Server

Jan 20, 2019

I use my Synology RS3618xs extensively at home, because it’s a beast that’s always on. With the power of BIND and the ease of use of Synology’s web application GUI, I’ve been using DNS Server for a number of years to provide internal DNS services at home. But I’ve been on the lookout for a way to integrate Pi-Hole, an internal ad-blocking solution that uses DNS to stop ads even being fetched.

I had planned to install the docker image. The problem as I saw it was that I couldn’t have two services running on port 53 — the port allocated to DNS resolution. I wasn’t interested in buying and learning about Raspberry Pi just to get this working on my LAN.

Solution

The solution is to use DNS forwarding, and the IP each docker image gets from its host.

Step 1

Run the following script to set up the container, from https://hub.docker.com/r/pihole/pihole but with a modified listening port (this ultimately doesn’t matter and won’t be referred to again — it just needs to not conflict with anything current running on the Synology).

Step 2

This should spit out something like 172.17.0.16. It’s as simple as plugging this into ‘Forwarder 1’ under ‘Resolution’ in the Synology DNS Server configuration pane:

Synology DNS configured to refer to Pi-hole

Step 3

That’s it! Configure your pi-hole as needed.

Your LAN clients will continue to refer to your Synology DNS server as usual. Your DNS Server will now point to straight to your Pi-hole setup. The Pi-hole can be configured to point towards internet-based DNS servers for general resolution.