For my home network, I run Pi-Hole in docker containers in separate hosts. Whenever making a change such as creating a local DNS entry on one Pi-hole means logging into the other Pi-hole and making the same change, not ideal. So I’ve tried looking for a solution to this. I did give Gravity sync a go however seemed a little hard to get going. Doing my Google search I also stumbled on Orbital-Sycn on GitHub which seems to do the same thing albeit much easier to configure and get going.
Using Orbital sync, it behaves similar to a HA pair where one becomes the primary and the config is synchronised to the secondary nodes. It was super simple to get going, making sure that it was on the correct docker network so it can see all the Pi-Hole containers in my network I then just creating the additional container using the docker compose file below.
version: '3' services: orbital-sync: image: mattwebbio/orbital-sync:1 environment: PRIMARY_HOST_BASE_URL: 'https://pihole1.home.lab' PRIMARY_HOST_PASSWORD: 'supersecretpassword' SECONDARY_HOSTS_1_BASE_URL: 'https://pihole2.home.lab' SECONDARY_HOSTS_1_PASSWORD: 'supersecretpassword' INTERVAL_MINUTES: 5
Replace the environment variables with settings for your setup. Based on this compose file, orbital-sync connects my two Pi-Hole containers and synchronises them every 5 minutes.
Additional configuration variables can be found on the CONFIG page on the orbital-sync GitHub.