mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
dnsmasq "domain-needed" property
This commit is contained in:
+11
-1
@@ -77,10 +77,20 @@ function validDomain($domain_name)
|
||||
$error .= "Secondary IP (".$secondaryIP.") is invalid!<br>";
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
?>
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
@@ -257,6 +270,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<div class="checkbox"><label><input type="checkbox" name="DNSrequiresFQDN" <?php if($DNSrequiresFQDN){ ?>checked<?php } ?>> never forward non-FQDNs to upstream servers (may prevent accessing local hostnames if the Pi-Hole is not used as DHCP server)</label></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="hidden" name="field" value="DNS">
|
||||
|
||||
Reference in New Issue
Block a user