I have Pi-hole running in a proxmox container which is set to use 8.8.8.8 and 192.168.1.15 (internal dns). When I reboot my /etc/resolv.conf file looks like:
In Pi-Hole webui I have Google primary and secondary as my upstream DNS servers. So where is resolv.conf being populated from? If I edit the file, DNS for Pi-Hole works as expected for list and package updates until a reboot.
Do you simply want to know this, or[quote="Todd_Kieffer, post:1, topic:1298"]
DNS for Pi-Hole works as expected for list and package updates until a reboot.
[/quote]
Do you have an issue with Pi-hole not working as expected after a reboot?
Pi-hole (dnsmasq) is configured to don't read /etc/resolv.conf at all. It gets its upstream servers only from the configuration file. Did you do a change to this behavior?
I dug a bit deeper and /etc/dhcpcd.conf is overwriting my /etc/resolv.conf file at reboot with details at the end of the file which outline 192.168.1.1 as a nameserver.
A hook script is provided to lookup the hostname if not set by the DHCP
I think what happened here was pihole first got a dhcp address. I then set a static ip, but the dhcpcd service is still running and overwriting the resolv.conf at boot.
I never noticed an issue because my clients were using the upstream DNS settings. However once I tried to update pihole and my lists pihole could not resolve DNS.
This should be easy enough to fix by disabling dhcpcd at boot, however it would be nice to have a switch in the webui as I'm sure others will run into this as well.
I typically don't use dhcp on linux, so was a bit confused by dhcpcd.conf overwriting the resolv.conf file.
No I have not changed this behavior, clients use the upstream dns settings, however pihole itself does not seem to be using the upstream settings, it uses the resolv.conf file. I've confirmed this by clearing resolv.conf, dns resolution for pihole stops working (clients continue to work). If I add an upstream dns server back to resolv.conf, pihole works as expected.
That should not happen, maybe dnsmasq is not running at all? If so, that would explain the behavior (it can only resolve if resolv.conf is populated)
Could you generate a debug log pihole -d, upload it and provide the token? It contains the running status of your dnsmasq among other critical things concerning its configuration.
So you have your true static configured via /etc/network/interfaces, and during the installation, we add dhcpcd5 per the Raspberry Pi Raspbian way of setting static IP's which is via /etc/dchcpcd.conf. The static that you have accounted for is in interfaces, but the dhcpcd hook overwrites /etc/resolv.conf via resovlconf on every boot.
This is an ongoing issue, where to set the static IP, and since we started with Raspberry Pi's, we have continued to use dhcpcd as the location to set, and don't use interfaces, which is backwards to just about every distribution besides Raspbian. We're looking at how to do static IP addressing now that we have grown to other platforms, but it does appear that the resolvconf hooks are causing the issue.
Thanks for the update, that makes more sense now. Let me know if you need any help testing in the future, I've got a home lab setup to mess around with and know enough to be dangerous with linux.
Will do, there's a few ideas of how to tackle the problem, we're just gathering as much data as we can with the different distro's and how they work on a Pi. Once we have a good sample size, then we'll have a better idea how to eliminate the need to use dhcpcd on non-berry installs.