Using docker-compose, with the included docker-compose.yaml file, you can run Pi-Hole + Unbound, each in its own container, on a Synology NAS. The docker-compose.yaml file will also create a MacVLAN and a custom bridge network for the containers. The MacVLAN network will be a /30 subnet, allowing for two assignable IP addresses from your Local LAN that will be assigned to the individual containers. The custom bridge network will be a /32 subnet, allowing for 1 assignable IP address that will be assigned to the Pi-Hole container.
Much of the setup for this project is influenced by my Pi-Hole Docker Synology NAS Setup Guide and Unbound Pi-Hole Synology Setup videos, which I encourage you to view for details on how things are is setup. As an overview, the videos describe how to setup Pi-Hole and Unbound through the command line and from the Docker package from within DSM. This generally works great except, on reboot, Unbound may start up prior to Pi-Hole which causes the MacVLAN IP assignment to switch between the containers resulting in a problem with the setup. The work around is to manually stop both containers, then restart the containers in the proper order or use a custom startup script to stop the containers and start them up again in the proper order (see the pinned comment from the second video listed above). The setup configured in this project resolves this issue.
You'll need to make sure the prerequisites are fulfilled on your Synology NAS first, then run through the setup steps below. I also run through setting everything up in this video here -> https://youtu.be/nOlx10aRZjk.
On your Synology NAS you'll need to do the following:
ssh <admin account>@<IP address of Synology NAS>
cd /volume1/docker
sudo git clone https://github.com/digtalaloha/synology-docker-pihole-unbound.git
cd synology-docker-pihole-unbound
mkdir -p pihole/pihole; mkdir -p pihole/dnsmasq.d
HOSTNAME=<Enter the hostname you would like to assign to the Pi-hole container>
PIHOLE_MACVLAN_IP=<Enter the first assignable IP address from the /30 MacVLAN subnet you created>
PIHOLE_BRIDGE_IP=<Enter the one assignable IP address from the /32 custom bridge subnet you created>
UNBOUND_MACVLAN_IP=<Enter the second assignable IP address from the /30 MacVLAN subnet you created>
WEBPASSWORD='<Enter the Pi-Hole GUI password you would like to use (keep the single quotes)>'
NETWORK_INTERFACE=<Enter the network interface your Synology NAS uses to access your LAN>
MACVLAN_SUBNET=<Enter the LAN network>/24
MACVLAN_GATEWAY=<Enter the LAN Gateway>
MACVLAN_IP_RANGE=<Enter the starting IP address of the LAN subnet that the MacVLAN network will use>/30
BRIDGE_SUBNET=<Enter the custom bridge network>/24
BRIDGE_GATEWAY=<Enter the custom bridge network gateway>
BRIDGE_IP_RANGE=<Enter the IP address of the custom bridge network>/32
TIMEZONE=<Enter the timezone you are in>
sudo docker-compose up -d
At this point if everything was created and started up properly you should be able to...