Two Pi-hole install in different machines

Hi!

I'm thinking to have two different Pi-hole installs in two different machines at home –with two different IP of course. This is just like a purpose of backup and have more than one IP as a DNS server in my computer, just in case I wanted to change something in one machine, and things like that.

Does this suppose any problem or caveat for Pi-hole??

An a more interesting question... Is there anyway I can sync the config between machines?

This should be possible. If you stay just with DNS. Two DHCP is a bad idea.
Sync should be possibly done by various means for example with rsync

so I just have to sync the config files and that's it? should I restart Pi Hole evey time I sync the files?

I´d say you should sync blocklists not config of IP and L2 related stuff.
How many clients do you have in network?

There is a feature request out there for what you are wanting to do. As is, we don't have a built in method but I'll leave this link here for anyone landing here.

This is exactly what I want to do. Thanks for sharing the feature request. I've voted for it.

I have like 8 clients. Where those files are located?

To continue with the topic... which files should, or which I shouldn't, sync?

lpuerto@opl-cubox:/etc/pihole$ ls
adlists.list    install.log                                list.6.hosts-file.net.domains  numBlocked
black.list      list.0.raw.githubusercontent.com.domains   list.7.local.domains           pihole-FTL.db
blacklist.txt   list.1.mirror1.malwaredomains.com.domains  list.preEventHorizon           setupVars.conf
dhcp.leases     list.2.sysctl.org.domains                  localbranches                  setupVars.conf.update.bak
ftlbranch       list.3.zeustracker.abuse.ch.domains        local.list                     whitelist.txt
GitHubVersions  list.4.s3.amazonaws.com.domains            localversions                  youtube.hosts
gravity.list    list.5.s3.amazonaws.com.domains            logrotate

I've been running multiple PiHoles on my LAN, one on a Zero W for the IOT devices (7 Echo's, Sense Monitor, 2 Sonos, Apple TV, garage door opener, Samsung Smartthings hub), and the other on a 3B+ for 5 computers, 3 tablets and 3 phones. I started this way to do some development work on one while the other was running, but it's convenient to leave them this way so far.

I found that they need slightly different whitelists and blacklists, but the block lists are the same. So far, I haven't found the need to keep them in synch. However, an option to do so could be helpful.

I wrote a Python script to keep whitelists and blacklists in sync across multiple devices: GitHub - simonwhitaker/pihole-sync: A script for syncing whitelist and blacklist entries between multiple devices running Pi-hole (https://pi-hole.net)

1 Like