From 63a8f5e714357d445d54d89988aa184dca0dfc19 Mon Sep 17 00:00:00 2001
From: DL6ER
";
+ $error .= "Conditional forwarding subnet (\"".htmlspecialchars($_POST["rev_server_cidr"])."\") is invalid!
".
+ "This field requires CIDR notation for local subnets (e.g., 192.168.0.0/16).
".
+ "Please use only subnets /8, /16, /24, and /32.
";
}
- // Validate conditional forwarding domain name
- if(!validDomain($_POST["conditionalForwardingDomain"]))
+ // Validate target IP
+ if (!validIP($_POST["rev_server_target"]))
{
- $error .= "Conditional forwarding domain name (".htmlspecialchars($_POST["conditionalForwardingDomain"]).") is invalid!
";
+ $error .= "Conditional forwarding target IP (\"".htmlspecialchars($_POST["rev_server_target"])."\") is invalid!
";
}
+
+ // Validate conditional forwarding domain name (empty is okay)
+ if(strlen($_POST["rev_server_domain"]) > 0 && !validDomain($_POST["rev_server_domain"]))
+ {
+ $error .= "Conditional forwarding domain name (\"".htmlspecialchars($_POST["rev_server_domain"])."\") is invalid!
";
+ }
+
if(!$error)
{
- $addressArray = explode(".", $_POST["conditionalForwardingIP"]);
- $reverseAddress = $addressArray[2].".".$addressArray[1].".".$addressArray[0].".in-addr.arpa";
- $extra .= " conditional_forwarding ".$_POST["conditionalForwardingIP"]." ".$_POST["conditionalForwardingDomain"]." $reverseAddress";
+ $extra .= " rev-server ".$_POST["rev_server_cidr"]." ".$_POST["rev_server_target"]." ".$_POST["rev_server_domain"];
}
}
diff --git a/settings.php b/settings.php
index 18826b591..3de64c648 100644
--- a/settings.php
+++ b/settings.php
@@ -164,12 +164,13 @@
} else {
$DNSinterface = "single";
}
-if (isset($setupVars["CONDITIONAL_FORWARDING"]) && ($setupVars["CONDITIONAL_FORWARDING"] == 1)) {
- $conditionalForwarding = true;
- $conditionalForwardingDomain = $setupVars["CONDITIONAL_FORWARDING_DOMAIN"];
- $conditionalForwardingIP = $setupVars["CONDITIONAL_FORWARDING_IP"];
+if (isset($setupVars["REV_SERVER"]) && ($setupVars["REV_SERVER"] == 1)) {
+ $rev_server = true;
+ $rev_server_cidr = $setupVars["REV_SERVER_CIDR"];
+ $rev_server_target = $setupVars["REV_SERVER_TARGET"];
+ $rev_server_domain = $setupVars["REV_SERVER_DOMAIN"];
} else {
- $conditionalForwarding = false;
+ $rev_server = false;
}
?>
@@ -807,36 +808,54 @@ function convertseconds($argument)
the size of your log might increase significantly
when enabling DNSSEC. A DNSSEC resolver test can be found
here.
If not configured as your DHCP server, Pi-hole won't be able to + +
If not configured as your DHCP server, Pi-hole typically won't be able to determine the names of devices on your local network. As a result, tables such as Top Clients will only show IP addresses.
One solution for this is to configure Pi-hole to forward these - requests to your DHCP server (most likely your router), but only for devices on your - home network. To configure this we will need to know the IP - address of your DHCP server and the name of your local network.
-Note: The local domain name must match the domain name specified - in your DHCP server, likely found within the DHCP settings.
+ requests to your DHCP server (most likely your router), but only for devices on your + home network. To configure this we will need to know the IP + address of your DHCP server and which addresses belong to your local network. + Exemplary inout is given below as placeholder in the text boxes (if empty). +If your local network spans 192.168.0.1 - 192.168.0.255, then you will have to input
+ 192.168.0.0/24
. If your local network is 192.168.0.1 - 192.168.0.255, it will
+ be 192.168.47.0/24
and similar. If your network is larger, the CIDR has to be
+ different, for instance a range of 10.8.0.1 - 10.8.255.255 results in 10.8.0.0/16
,
+ whereas an even wider network of 10.0.0.1 - 10.255.255.255 results in 10.0.0.0/8
.
+ Feel free to reach out to us on our
+ Discourse forum
+ in case you need any assistance setting up local host name resolution for your particular system.
You can also specify a local domain name (like fritz.box
) to ensure queries to
+ devices ending in your local domain name will not leave your network, however, this is optional.
+ The local domain name must match the domain name specified
+ in your DHCP server for this to work. You can likely find it within the DHCP settings.
IP of your router | -Local domain name | +Local network in CIDR notation | +IP address of your DHCP server (router) | +Local domain name (optional) |
---|---|---|---|---|
- value=""> + value="" + disabled> | -value=""> + | + value="" + disabled> + | +value="" + disabled> |