From e1ca33cd0fa3071e26c8dc4eec71c69c6398b2d5 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 1 Dec 2023 12:46:28 +0100 Subject: [PATCH 1/3] Add support for adding multiple reverse servers Signed-off-by: DL6ER --- settings-dns.lp | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/settings-dns.lp b/settings-dns.lp index 5250df9e1..da85d16b2 100644 --- a/settings-dns.lp +++ b/settings-dns.lp @@ -59,7 +59,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
-

Conditional forwarding

+

Conditional forwarding

@@ -87,36 +87,8 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r') in your DHCP server for this to work. You can likely find it within the DHCP settings.

Enabling Conditional Forwarding will also forward all hostnames (i.e., non-FQDNs) to the router when "Never forward non-FQDNs" is not enabled.

-
-
- - -
-
- - - - - - - - - - - - - - - -
Local network in CIDR notationIP address of your DHCP server (router)Local domain name (optional)
- - - - - -
-
-
+

The following list contains all reverse servers you want to add. The expected format is one server per line in form of <enabled>,<ip-address>[/<prefix-len>],<server>[#<port>][,<domain>]. A valid config line could look like true,192.168.0.0/24,192.168.0.1,fritz.box

+
From 05ff5647bd920e7b5b0dd7957d390def99e8d193 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 1 Dec 2023 12:49:09 +0100 Subject: [PATCH 2/3] Rearrange items on Settings -> DNS page Signed-off-by: DL6ER --- settings-dns.lp | 132 ++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 65 deletions(-) diff --git a/settings-dns.lp b/settings-dns.lp index da85d16b2..98395af5b 100644 --- a/settings-dns.lp +++ b/settings-dns.lp @@ -57,38 +57,50 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r') -
+
-

Conditional forwarding

+

DNS domain settings

+
+
+
+
+ +
+
+
Domain
+ +
+
+

The DNS domains for your Pi-hole. If no domain is specified and you are using Pi-hole's DHCP server, then any hostnames with a domain part (i.e., with a period) will be disallowed. If a domain is specified, then hostnames with a domain parts matching the domain here are allowed. In addition, when a suffix is set then hostnames without a domain part have the suffix added as an optional domain part.

+
+ + +

If set, the domain is added to simple names (without a period) in /etc/hosts in the same way as for DHCP-derived names.

+
+
+
+
+
+
+
+

Rate-limiting

-

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 which addresses belong to your local network. - Exemplary input 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.47.1 - 192.168.47.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. - Setting up IPv6 ranges is exactly similar to setting up IPv4 here and fully supported. - 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.

-

Enabling Conditional Forwarding will also forward all hostnames (i.e., non-FQDNs) to the router - when "Never forward non-FQDNs" is not enabled.

-

The following list contains all reverse servers you want to add. The expected format is one server per line in form of <enabled>,<ip-address>[/<prefix-len>],<server>[#<port>][,<domain>]. A valid config line could look like true,192.168.0.0/24,192.168.0.1,fritz.box

- +

Block clients making more than queries within + seconds.

+

When a client makes too many queries in too short time, it + gets rate-limited. Rate-limited queries are answered with a + REFUSED reply and not further processed by FTL + and prevent Pi-holes getting overwhelmed by rogue clients. + It is important to note that rate-limiting is happening on a + per-client basis. Other clients can continue to use FTL while + rate-limited clients are short-circuited at the same time.

+

Rate-limiting may be disabled altogether by setting both + values to zero. See + our documentation + for further details.

@@ -136,30 +148,6 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
-
-
-

DNS domain settings

-
-
-
-
- -
-
-
Domain
- -
-
-

The DNS domains for your Pi-hole. If no domain is specified and you are using Pi-hole's DHCP server, then any hostnames with a domain part (i.e., with a period) will be disallowed. If a domain is specified, then hostnames with a domain parts matching the domain here are allowed. In addition, when a suffix is set then hostnames without a domain part have the suffix added as an optional domain part.

-
- - -

If set, the domain is added to simple names (without a period) in /etc/hosts in the same way as for DHCP-derived names.

-
-
-
-
-

Advanced DNS settings

@@ -205,26 +193,40 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
+ +
-

Rate-limiting

+

Conditional forwarding

-

Block clients making more than queries within - seconds.

-

When a client makes too many queries in too short time, it - gets rate-limited. Rate-limited queries are answered with a - REFUSED reply and not further processed by FTL - and prevent Pi-holes getting overwhelmed by rogue clients. - It is important to note that rate-limiting is happening on a - per-client basis. Other clients can continue to use FTL while - rate-limited clients are short-circuited at the same time.

-

Rate-limiting may be disabled altogether by setting both - values to zero. See - our documentation - for further details.

+

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 which addresses belong to your local network. + Exemplary input 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.47.1 - 192.168.47.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. + Setting up IPv6 ranges is exactly similar to setting up IPv4 here and fully supported. + 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.

+

Enabling Conditional Forwarding will also forward all hostnames (i.e., non-FQDNs) to the router + when "Never forward non-FQDNs" is not enabled.

+

The following list contains all reverse servers you want to add. The expected format is one server per line in form of <enabled>,<ip-address>[/<prefix-len>],<server>[#<port>][,<domain>]. A valid config line could look like true,192.168.0.0/24,192.168.0.1,fritz.box

+
From 06516fb5140ff73f3eb69cda6e6c704f2014c8bd Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 1 Dec 2023 12:57:52 +0100 Subject: [PATCH 3/3] Ensure we replace all "\n" by "
" when showing descriptions Signed-off-by: DL6ER --- scripts/pi-hole/js/settings-advanced.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/settings-advanced.js b/scripts/pi-hole/js/settings-advanced.js index 5aad6bb69..e44ac2562 100644 --- a/scripts/pi-hole/js/settings-advanced.js +++ b/scripts/pi-hole/js/settings-advanced.js @@ -54,7 +54,7 @@ function generateRow(topic, key, value) { : "") + "" + "

" + - utils.escapeHtml(value.description).replace("\n", "
") + + utils.escapeHtml(value.description).replaceAll("\n", "
") + "

" + "
" + '
' +