diff --git a/php/savesettings.php b/php/savesettings.php
index 745be218..a4693c33 100644
--- a/php/savesettings.php
+++ b/php/savesettings.php
@@ -77,10 +77,20 @@ function validDomain($domain_name)
$error .= "Secondary IP (".$secondaryIP.") is invalid!
";
}
+ // Check if domain-needed is requested
+ if(isset($_POST["DNSrequiresFQDN"]))
+ {
+ $extra = "domain-needed";
+ }
+ else
+ {
+ $extra = "domain-not-needed";
+ }
+
// If there has been no error we can save the new DNS server IPs
if(!strlen($error))
{
- exec("sudo pihole -a setdns ".$primaryIP." ".$secondaryIP);
+ exec("sudo pihole -a setdns ".$primaryIP." ".$secondaryIP." ".$extra);
$success .= "The DNS settings have been updated";
}
else
diff --git a/settings.php b/settings.php
index c1029040..8cc96291 100644
--- a/settings.php
+++ b/settings.php
@@ -224,6 +224,19 @@
} else {
$piHoleDNS2 = "unknown";
}
+
+ if(isset($setupVars["DNS_FQDN_REQUIRED"])){
+ if($setupVars["DNS_FQDN_REQUIRED"])
+ {
+ $DNSrequiresFQDN = true;
+ }
+ else
+ {
+ $DNSrequiresFQDN = false;
+ }
+ } else {
+ $DNSrequiresFQDN = true;
+ }
?>