Add extra name server for pihole in resolv.conf

Bottom line is that my instance of raspbian that pihole runs on only uses 127.0.0.1 in the resolv.conf file. This adds extra steps to get my system running again when pihole breaks (due to beta testing 5.0 or some other dumb thing I am doing). I have to manually change the 127.0.0.1 to my other pihole server ip, or to some public name server. Then try to fix pihole, or whatever else is broken. This only lasts so long, as it just gets overwritten often.

I have added the extra name server I want (my other pihole) in the /etc/dhcpcd.conf file, but the system does not seem to respect this setting.

This other article seems to be saying that pihole is inserting the 127.0.0.1 manually somehow in the running service, but i'm not smart enough to figure out how. How do I disable Pi-hole automatic add 127.0.0.1 in resolv.conf - #21 by deHakkelaar

If my raspberry pi could have a backup nameserver, it would alleviate two problems I have encountered:

  1. recovering pihole when pihole ftl stops working and requires the internet to resolve itself, or post debug logs
  2. once my rapsberry pi crashed while I was away, and was down for a couple days. After getting started again, the pi could not update the time because unbound could not resolve the NTP servers because it needs a relatively accurate clock to resolve nameservers. (My work around for this is to hard code a few backup NTP servers).

Below describes a super method to add a second nameserver without interfering too much with Pi-hole:

But the web GUI part will not display names of individual devices if the other nameserver is used!
Pi-hole beta version 5 doesnt depend on 127.0.0.1 being the local resolver anymore to display device hostnames but have to wait a bit till stable version is released.