I am setting up two Pihole server on my network on two raspberry pi 3 with static ip. I want to use overlayFS to avoid writing on the sd card and since both are on UPS, they will be pretty much running 24/7.
My router is still the gateway and the DHCP server on my whole network, and my 2 pihole servers has their IP reserved, but the pihole server does not need to query the dhcp server to boot.
My problem comes from the /etc/resolv.conf that gets both pihole server ips while I do not want them. They seem to come from the router by DHCP:
That would configure your Pi-hole's DHCP server to ignore DHCP requests arriving at its eth0 interface.
But your issue isn't Pi-hole related at all, it's a basic networking issue.
If you want a static configuration for your DNS servers, define them statically in /etc/dhcpcd.conf. Look for the lines similar to the following and add or adapt them as required:
Yes, that's already done, but I keep on receiving the 2 dns servers ip address from the router, even when static domain_name_servers=127.0.0.1 is defined on each one of them.
That would suggest that your RPi is requesting DHCP over a different interface, or it's not using dhcpcd for its network configuration, or your OverlayFS is not reading the configuration from that file.
because sd card dies and are not meant to be constantly being written on 24/7.
That's a personal choice, even if both raspberry are on an UPS, I cannot stand to loose my dns server because I did a mistake and disconnected the power plug or any other reason.
I run RPi on my home for several years, and I already lost so many sd cards over time.
It is important to have something 100% reliable, not 90% and you end up having no internet when you need the most (I am working at home now).
Invest in a reputable brand SD card and it will run for longer than the device it's in. If you've lost SD Cards then your power is not up to par, that's what kills cards. Not writes or reads. I've lost maybe 3 cards since my first Raspberry Pi (the original model) and once the firmware issue was fixed years ago it's been stable.
Of course you are free to choose to overcomplicate and spend more on other solutions, but you're causing yourself many more headaches and more points of failure this way.
ok thanks. Just to let you know, I have disabled overlayfs and tried log2ram as I saw in another thread. This would I hope decrease the among of writes on the sdcard. So far (this night) I had the right behavior too.
Do you know if there are other part of pihole that write to the disk, for the graph for examples? or everything is in /var/log ?