Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup interface listening behavior of dnsmasq #420

Merged
merged 1 commit into from Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions scripts/pi-hole/php/savesettings.php
Expand Up @@ -174,11 +174,35 @@ function readStaticLeasesFile()
$extra .= "no-dnssec";
}

// Check if DNSinterface is set
if(isset($_POST["DNSinterface"]))
{
if($_POST["DNSinterface"] === "single")
{
$DNSinterface = "single";
}
elseif($_POST["DNSinterface"] === "all")
{
$DNSinterface = "all";
}
else
{
$DNSinterface = "local";
}
}
else
{
// Fallback
$DNSinterface = "local";
}
$return .= exec("sudo pihole -a -i ".$DNSinterface." -web");

// If there has been no error we can save the new DNS server IPs
if(!strlen($error))
{
$IPs = implode (",", $DNSservers);
exec("sudo pihole -a setdns ".$IPs." ".$extra);
$success .= htmlspecialchars($return)."<br>";
$success .= "The DNS settings have been updated (using ".count($DNSservers)." DNS servers)";
}
else
Expand Down
31 changes: 31 additions & 0 deletions settings.php
Expand Up @@ -469,6 +469,23 @@ function convertseconds($argument) {
} else {
$DNSSEC = false;
}

if(isset($setupVars["DNSMASQ_LISTENING"])){
if($setupVars["DNSMASQ_LISTENING"] === "single")
{
$DNSinterface = "single";
}
elseif($setupVars["DNSMASQ_LISTENING"] === "all")
{
$DNSinterface = "all";
}
else
{
$DNSinterface = "local";
}
} else {
$DNSinterface = "local";
}
?>
<div class="box box-warning">
<div class="box-header with-border">
Expand Down Expand Up @@ -534,6 +551,20 @@ function convertseconds($argument) {
<div class="checkbox"><label><input type="checkbox" name="DNSSEC" <?php if($DNSSEC){ ?>checked<?php } ?>> Use DNSSEC</label></div>
</div>
<p>Validate DNS replies and cache DNSSEC data. When forwarding DNS queries, Pi-hole requests the DNSSEC records needed to validate the replies. Use Google or Norton DNS servers when activating DNSSEC. Note that the size of your log might increase significantly when enabling DNSSEC. A DNSSEC resolver test can be found <a href="http://dnssec.vs.uni-due.de/" target="_blank">here</a>.</p>

<div class="form-group">
<label>Interface listening behavior</label>
<div class="radio">
<label><input type="radio" name="DNSinterface" value="local" <?php if($DNSinterface == "local"){ ?>checked<?php } ?> >Listen on all interfaces, but allow only queries from devices that are at most one hop away (local devices)</label>
</div>
<div class="radio">
<label><input type="radio" name="DNSinterface" value="single" <?php if($DNSinterface == "single"){ ?>checked<?php } ?> >Listen only on interface <?php echo $piHoleInterface; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="DNSinterface" value="all" <?php if($DNSinterface == "all"){ ?>checked<?php } ?> >Listen on all interfaces, permit all origins (make sure your Pi-hole is firewalled!)</label>
</div>
</div>

</div>
</div>
</div>
Expand Down