Adding a second pihole, copying sd card, which files to edit?


#1

Hi all,

I’ve recently started using pihole on a Raspberry Pi Zero W, and it’s been working great and so I decided I wanted to add a second one for redundancy. I already ordered the new Pi Zero and was thinking about trying to get an sd card setup for it before it gets here so that I could hopefully just pop it in when the new pi gets here and be up and running. So here’s what I’m planning on doing, and I just want to be sure I’m not missing anything.
First, my current unit has got pihole, unbound and samba installed. Nothing else. It’s all configured and working exactly as I want. I have a usb sd card reader that I attached, and I loaded up vnc and used the SD Card Copier utility to copy my existing card. I then mounted the main partition and am planning to edit the following files:

  • /etc/pihole/local.list - Add ip for new pihole, make sure it is updated on both piholes.
  • /etc/unbound/unbound.conf.d/pi-hole.conf - Add ip and name for new pihole to the local zone, make sure it is updated on both piholes.
  • /etc/hostname - Change to a unique name that is different than the primary pi-hole. The changed file should be placed on the new pihole only.
  • /etc/hosts - Add ip and name of the new pihole, make sure it is updated on both piholes.
    I am using my router for DHCP, so I will be reserving a pre-determined ip address to the new pi when it gets here, so there shouldn’t be any DHCP configuration files I should need to worry about.
    My question is, are there any other files that I’m overlooking that need to be edited for the second pihole, or should those files be enough?

Thanks in advance,
-George


#2

I would suggest building PI new and then use the teleporter option in the GUI to back everything up and restore on the new PI. Teleporter backs up all the pi-hole configuration files. The other configurations you can copy / edit as needed to support the new PI.


#3

I echo the comments of RonV42. It would be best to do a separate clean install of the OS and Pi-Hole onto the new device, then transfer your settings via teleporter or copy/paste as necessary (teleporter won’t transfer unbound configuration files).


#4

Thank you both for taking the time to reply. May I ask why it’s better to do the new install cleanly vs copying and changing the relevant files? I figured since I wanted them both to be identical, it would just be easier to copy the sd card from my existing pi Zero W and just edit some configuration files, but with two of you recommending a clean install, I’m guessing there’s more under the hood that I’m unaware of that may “break” if I tried it my way. I’m just trying to understand what that could be.


#5

Nothing will break if you clone the card, but you will have to change a number of settings, and if you miss something you will have problems with the second Pi-Hole. I have done both methods, and ended up with the clean install method as my preferred method.


#6

Change to a unique name that is different than the primary pi-hole.