diff --git a/php/savesettings.php b/php/savesettings.php
index fddc8ca4..0795add9 100644
--- a/php/savesettings.php
+++ b/php/savesettings.php
@@ -265,8 +265,24 @@ function validDomain($domain_name)
break;
- default:
+ // Set DNS server domain name
+ case "domainname":
+ $domain = $_POST["domain"];
+ if(!validDomain($domain))
+ {
+ $error .= "Domain name ".$domain." is invalid!
The domain name has been reset to its previous value";
+ }
+ else
+ {
+ exec("sudo pihole -a domainname ".$domain);
+ }
+ break;
+
+
+ default:
+ // Option not found
+ $debug = true;
break;
}
}
diff --git a/settings.php b/settings.php
index e34962dc..02af8dfe 100644
--- a/settings.php
+++ b/settings.php
@@ -5,6 +5,14 @@
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
?>
+
+