pihole-sync is a tool for synchronizing local dns and cname records from master-pihole to slave-pihole server.
Installation
For master-pihole server:
- Copy files from the folder named 'server' to the master-pihole server.
- Write the {secret key} in the file '/var/www/sync.server.php'.
- Create a link for the file '/etc/lighttpd/20-pihole-sync.conf' with command:
cd /etc/lighttpd/conf-enabled && \
ln -s ../conf-available/20-pihole-sync.conf 20-pihole-sync.conf- Restart lighttpd with command (Debian example):
systemctl restart lighttpd.service- Check server by opening the link in the browser. The result should be 'ok:{sha256-hash}'
http://{master-pihole-ip}/sync/{secret-key}/dns/hashFor slave-pihole server:
- Copy files from the folder named 'client' to the slave-pihole server.
- Write {master-pihole-ip} and {secret key} (same as master-pihole) in the file '/root/sync.client.php'.
- Check client by executing the command:
/usr/bin/php /root/sync.client.php- create cron job:
*/30 * * * * /usr/bin/php /root/sync.client.php > /dev/null 2>&1