I have had this same issue, it seems to me to be related to ipv6 , as i do not have ipv6, the options are greyed out to select on the dns page of pihole. I have confirmed my current ISP is not providing me ipv6 connectivity.
That being said, the error occurs on line 276, which seems to be looping through the predefined servers and appending to the dnsserverslist, as they are greyed out , i suspect the keys 'v6-1' and 'v6-2' does not exist. Please correct me if i am wrong.
case "DNS":
$DNSservers = [];
// Add selected predefined servers to list
foreach ($DNSserverslist as $key => $value)
{
foreach(["v4_1", "v4_2", "v6_1", "v6_2"] as $type)
{
if(@array_key_exists("DNSserver".str_replace(".","_",$value[$type]),$_POST))
{
array_push($DNSservers,$value[$type]);
}
}
}
Initially i edited savesettings.php:276, removing "v6_2: from the loop, this proceeded to change the error to "v6_1" not found, which lead me to remove that too.
Currently my edited file looks like and the error is not occuring anymore
$DNSservers = [];
// Add selected predefined servers to list
foreach ($DNSserverslist as $key => $value)
{
foreach(["v4_1", "v4_2"] as $type)
{
if(@array_key_exists("DNSserver".str_replace(".","_",$value[$type]),$_POST))
{
array_push($DNSservers,$value[$type]);
}
}
}
some furrther info i used to assist me:
https://www.reddit.com/r/pihole/comments/dtzhil/problem_with_ipv6_upstream_dns/