When I set an upstream DNS Server in the webinterface, I expect to have more than "0 custom servers enabled" and can ping a website like www.google.de
Actual Behaviour:
Until a resent restart everything was working as expected. Then after switching my Pi off and on, the dns resolution was (and still is) not working. I have one IPv4 and one IPv6 Upstream DNS.WATCH Server enabled.
For a test, I changed the "Upstream DNS Servers". Whatever selection I made, after "Save & Apply", the list was and remained empty. Also restarting the Pi did not help.
After some more digging I found out that my disk was full (a gravity update log with used 21GB). I manually deleted the file, and since then I again can choose DNS servers that remain checked after a restart. But on the bottom of the DNS Settings page of the admin interface, where the list of the "Custom DNS Servers" are, it tells me "Custom DNS Servers (0 custom servers enabled).
I manually changed /etc/resolv.confg in order to succesfully run "pihole -r" and "pihole -up" as these otherwise fail when dns is not working. But that didn't solve my problem.
Not sure if this is important, but reading through several posts I saw that there normally are files like /etc/dnsmasq.d/01-pihole.conf and /etc/pihole/setupVars.conf that contain the dns servers. I have none of them.
You need to understand what the web interface considers a "custom" server and how they are counted.
When you enter a "Custom" DNS Server, this server is added to the list of upstream servers. There is no real difference between "Custom" and "Normal" upstream servers.
There is only one list of servers, but we show some common upstream servers using the checkboxes:
Thank you so much for our answers! OK, then I really had wrong expectations regarding this number of custom servers.
But regarding the behaviour when my disk was full: The text field was updated by checking and unchecking servers, but as soon I clicked "Save & Apply", the field was empty again. Now, after deleting the log file, the fields contain the expected values.
But my problem still remains. After a restart, my resolv.conf contains some IPv6 address but none of the DNS servers I selected. And pinging some server, I get "Temporary failure in name resolution". Where does this entry in resolv.conf come from? And how do I fix it?
I think the issue was the disk was completely full and there was no space to save the new settings. After cleaning the logs, the disk was finally able to save the changes.
Probably from your OS configuration.
Usually if you are manually editing this file, it will revert after restart.
Check if there is a comment in the file explaining how the file is created/managed.
Something like this:
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
resolvconf.conf was updating my resolv.conf. After some more digging, I found out that the the domain_name_servers entry in /etc/dhcpcd.conf was wrong. After changing it to 127.0.0.1, everything was finally working.