Setup on Synology Docker

I made this account just to start sharing my experience moving pi-hole to my Synology docker.

Many of you may have seen and this got me doing some research on macvlan with docker.

If you ssh into your Synology as a root user and use the following command:

docker network create -d macvlan /
–subnet= /
–ip-range= /
–gateway= /
-o parent=eth0 Pi-hole

This will create a macvlan with the ip forced as a single ip ( to use as a network for your docker image.You can then create your pi-hole docker image all through the UI now as this network will show up in docker. No port forwarding or anything is needed for your docker image just select Pi-hole as your network and delete bridge in the network section of the interface and set the ServerIP.

Using an IP calculator you can configure this to a single ip in ip-range section of the command.

Now modifying this a little I am trying to get cloudflared DOH running in a docker image but being that I am using eth0 for both pi-hole and cloudflared I am unable to have eth0 talking to itself. I hopefully will have some time over the weekend to further my research on this subject.

1 Like

Ok a little more messing around tonight I have managed to do a complete setup of Pi-hole using synologies docker UI besides creating the macvlan in SSH above.

I mean complete setup by binding volumes for the etc/pihole and etc/dnsmasq.d to maintain settings even after deleting my docker image or restarting the synology. Pi.hole in the browser takes me to my pihole page. Everthing I tried works as expected and functions just like my pi3 install.

I dont have it set as my DHCP yet because I plan on doing an easy setup guide to install this through the GUI as tony’s UI guide is a little outdated. But to use DCHP it should be as simple as setting a static IP on the synology as pihole is not actually running until the synology has booted completely.

I did manage to get a cloudflared docker instance working but its not quiet how I would like it as I had to send the pihole to the router and have the router send requests from the pihole to the cloudflared container due to the Linux kernel blocking macvlan communication to the host.

1 Like

Ok here is a little write up I did. I was unable to load the word version to the site so I uploaded the a zip file with the original document but attached pictures of the write up.
The only downside of this is it will only show an IP for the Synology in the pi-hole interface because the Synology uses pi-hole through a docker bridge being that it is unable to contact it through the macvlan. (387.9 KB)

1 Like

Thank you so much for this guide. I tried a lot of guides, and nothing would work. This is by far the most easy and elegant way of installing Pi-Hole on a Synology NAS with Docker. Good job!

Thanks Morten, It may not be the cleanest write-up, but to me was the nicest way as to avoid doing a majority of the work in a headless environment as I really dont like to keep SSH available on the NAS and the Tony Lawrence how-to didn’t address the issue of the NAS not being able to talk to its own mcvlan. Now everything on my network runs through Pi-hole.

Only issue I encountered was that setting the DNS for the NAS to didn’t work. It would break quickconnect functionality and also couldn’t connect to the docker repository. I fixed it by just setting the DNS for the NAS to as it doesn’t need adblocking anyways.

I had that issue when first trying this install. In your setup of the docker image did you make sure to set DNSMASQ_LISTENING: Local? Without it set to local pihole will not listen to the bridge interface you created and will only listen over the mcvlan which the host device is unable to do because of the security of a mcvlan.

Edit: If I remember later when I get home ill look into it further. One of my big requirements for running pihole on my NAS was that all network device had to use it.