Skip to content

Commit 42ef1c7

Browse files
committed
Pi-hole: link with Unbound by default, change default port, bugfixes
- change Unbound external port - fix password set on Pi-hole - ask for password after installation - install and use Unbound with Pi-hole by default - improve Pi-hole documentation - purge of Unbound and Pi-hole were not removing folders - set link to webadmin from armbian-config - move default web port of Pi-hole from 80 to 8011
1 parent 1f58601 commit 42ef1c7

File tree

7 files changed

+42
-20
lines changed

7 files changed

+42
-20
lines changed

tools/include/markdown/PIH001-footer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The web interface of Pi-hole can be accessed via:
44

55
- URL = `http://<your.IP>/admin`
6-
- Password is set and adjust from `armbian-config`
6+
- Password is set on install and can be adjusted from `armbian-config`
77

88
=== "Documentation"
99

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
Pi-hole is a network-wide ad blocker that acts as a DNS (Domain Name System) sinkhole. It works by blocking requests to known ad servers, trackers, and malicious websites across all devices connected to your home network. Here's how it works:
1+
**Pi-hole** is a network-wide ad blocker that acts as a DNS (Domain Name System) sinkhole. It blocks connections to known ad servers, trackers, and malicious domains across all devices in your network, without requiring any browser extensions or client-side software.
22

3-
- DNS-Based Filtering: Pi-hole intercepts DNS requests from devices on your network. When a device tries to connect to a website, Pi-hole checks if the website's domain is on a blocklist. If it is, Pi-hole prevents the connection from being made, effectively blocking ads, trackers, and potentially harmful sites.
3+
## How Pi-hole Works
44

5-
- Customizable Blocklists: Pi-hole allows you to choose from a variety of community-maintained blocklists or even add your own. These blocklists contain domains known to serve ads, trackers, and other unwanted content.
5+
- **DNS-Based Filtering**
6+
Pi-hole intercepts DNS queries made by devices on your network. When a domain is requested, Pi-hole checks it against a set of blocklists. If the domain is known to serve ads or track user activity, Pi-hole blocks the request, preventing unwanted content from loading.
67

7-
- Device and Network-Level Protection: Once set up, Pi-hole works across your entire network. This means all devices (smartphones, tablets, computers, smart TVs, etc.) that use your Pi-hole as their DNS server automatically benefit from ad-blocking without needing individual apps or browser extensions.
8+
- **Customizable Blocklists**
9+
You can choose from various community-maintained blocklists or add your own. These lists contain domains associated with ads, trackers, malware, or other undesirable content.
810

9-
- Web Interface: Pi-hole offers an intuitive web interface where you can monitor statistics, review blocked domains, and tweak settings like adding custom blocklists or whitelisting certain sites.
11+
- **Whole-Network Protection**
12+
Once Pi-hole is configured as your network’s DNS server, all devices - smartphones, laptops, smart TVs, and IoT devices - are automatically protected. No additional configuration or software is required on the individual devices.
1013

11-
- Privacy and Speed: By blocking unwanted content at the DNS level, Pi-hole not only improves browsing speed (since ads are not loaded), but also enhances privacy by preventing tracking scripts from running in the background.
14+
- **Built-in Recursive DNS with Unbound**
15+
For added privacy and full DNS resolution control, **Unbound** is installed and enabled by default during Pi-hole installation. Unbound functions as a local recursive DNS resolver, fetching responses directly from authoritative DNS servers rather than relying on upstream providers. This minimizes third-party exposure and can improve query performance.
1216

13-
Pi-hole is typically installed on a Armbian minimal, but it can also run on other systems. It's a great way to have ad-blocking and privacy protection across your entire network without needing to install anything on individual devices.
17+
- **Web Interface**
18+
Pi-hole includes a web-based dashboard that provides real-time visibility into DNS activity. The interface allows you to view statistics, manage blocklists, whitelist domains, and configure settings with ease.
19+
20+
- **Privacy and Performance Benefits**
21+
By blocking unwanted domains at the DNS level, Pi-hole reduces page load times, lowers bandwidth usage, and enhances user privacy by preventing tracking scripts and ads from reaching client devices.
22+
23+
- **Platform Compatibility**
24+
Pi-hole can be installed on a variety of platforms. It runs well on lightweight systems such as **Armbian Minimal**, but is also available as a Docker container and supports deployment on most Linux-based environments.
25+
26+
Pi-hole offers an effective and centralized way to enhance privacy and reduce unwanted content across your entire network.

tools/include/markdown/UNB001-footer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== "Default DNS port"
22

3-
- Default DNS port: 53
3+
- Default DNS port: 8053
44

55
=== "Directories"
66

tools/json/config.software.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
},
253253
{
254254
"id": "PIH001",
255-
"description": "Pi-hole DNS ad blocker",
255+
"description": "Pi-hole DNS ad blocker with Unbound support",
256256
"short": "Pi-hole",
257257
"module": "module_pi_hole",
258258
"command": [
@@ -286,7 +286,7 @@
286286
"id": "PIH004",
287287
"description": "Pi-hole purge with data folder",
288288
"command": [
289-
"module_pi_hole remove"
289+
"module_pi_hole purge"
290290
],
291291
"status": "Stable",
292292
"author": "@armbian",
@@ -318,7 +318,7 @@
318318
"id": "UNB003",
319319
"description": "Unbound purge with data folder",
320320
"command": [
321-
"module_unbound remove"
321+
"module_unbound purge"
322322
],
323323
"status": "Stable",
324324
"author": "@armbian",

tools/modules/runtime/config.runtime.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ update_sub_submenu_data "Software" "HomeAutomation" "DOM002" "http://$LOCALIPADD
140140
update_sub_submenu_data "Software" "HomeAutomation" "EVCC02" "http://$LOCALIPADD:${module_options["module_evcc,port"]}"
141141

142142
# DNS
143-
update_sub_submenu_data "Software" "DNS" "PIH003" "http://$LOCALIPADD:${module_options["module_pi_hole,port"]%% *}" # removing second port from url
143+
update_sub_submenu_data "Software" "DNS" "PIH003" "http://$LOCALIPADD:${module_options["module_pi_hole,port"]%% *}/admin" # removing second port from url
144144
update_sub_submenu_data "Software" "DNS" "ADG002" "http://$LOCALIPADD:${module_options["module_adguardhome,port"]%% *}" # removing second port from url
145145

146146
# Monitoring

tools/modules/software/module_pi-hole.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module_options+=(
77
["module_pi_hole,status"]="Active"
88
["module_pi_hole,doc_link"]="https://docs.pi-hole.net/"
99
["module_pi_hole,group"]="DNS"
10-
["module_pi_hole,port"]="80 53"
10+
["module_pi_hole,port"]="8811"
1111
["module_pi_hole,arch"]=""
1212
)
1313
#
@@ -29,14 +29,19 @@ function module_pi_hole () {
2929
case "$1" in
3030
"${commands[0]}")
3131
pkg_installed docker-ce || module_docker install
32+
if ! docker container ls -a --format '{{.Names}}' | grep -q '^unbound$'; then module_unbound install; fi
33+
local unbound_ip=$(docker inspect --format '{{ .NetworkSettings.Networks.lsio.IPAddress }}' unbound)
3234
[[ -d "$PIHOLE_BASE" ]] || mkdir -p "$PIHOLE_BASE" || { echo "Couldn't create storage directory: $PIHOLE_BASE"; exit 1; }
3335
[[ ! -f "/etc/systemd/resolved.conf.d/armbian-defaults.conf" ]] && ${module_options["module_pi_hole,feature"]} ${commands[1]}
3436
docker run -d \
3537
--name pihole \
3638
--net=lsio \
37-
-p 53:53/tcp -p 53:53/udp \
38-
-p 80:80 \
39+
-p 53:53/tcp \
40+
-p 53:53/udp \
41+
-p ${module_options["module_pi_hole,port"]}:80 \
3942
-e TZ="$(cat /etc/timezone)" \
43+
-e PIHOLE_UID=1000 \
44+
-e PIHOLE_GID=1000 \
4045
-v "${PIHOLE_BASE}/etc-pihole:/etc/pihole" \
4146
-v "${PIHOLE_BASE}/etc-dnsmasq.d:/etc/dnsmasq.d" \
4247
--dns=9.9.9.9 \
@@ -45,6 +50,7 @@ function module_pi_hole () {
4550
-e VIRTUAL_HOST="pi.hole" \
4651
-e PROXY_LOCATION="pi.hole" \
4752
-e FTLCONF_LOCAL_IPV4="${LOCALIPADD}" \
53+
-e FTLCONF_dns_upstreams="${unbound_ip}" \
4854
pihole/pihole:latest
4955
for i in $(seq 1 20); do
5056
if docker inspect -f '{{ index .Config.Labels "build_version" }}' pihole >/dev/null 2>&1 ; then
@@ -68,6 +74,7 @@ function module_pi_hole () {
6874
srv_restart systemd-resolved
6975
sleep 2
7076
fi
77+
${module_options["module_pi_hole,feature"]} ${commands[3]}
7178
;;
7279
"${commands[1]}")
7380
[[ "${container}" ]] && docker container rm -f "$container" >/dev/null
@@ -90,7 +97,7 @@ function module_pi_hole () {
9097
"${commands[3]}")
9198
SELECTED_PASSWORD=$($DIALOG --title "Enter new password for Pi-hole admin" --passwordbox "" 7 50 3>&1 1>&2 2>&3)
9299
if [[ -n $SELECTED_PASSWORD ]]; then
93-
docker exec -it "${container}" sh -c "sudo pihole -a -p ${SELECTED_PASSWORD}" >/dev/null
100+
docker exec -it "${container}" sh -c "pihole setpassword ${SELECTED_PASSWORD}"
94101
fi
95102
;;
96103
"${commands[4]}")

tools/modules/software/module_unbound.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module_options+=(
77
["module_unbound,status"]="Active"
88
["module_unbound,doc_link"]="https://unbound.docs.nlnetlabs.nl/en/latest/"
99
["module_unbound,group"]="DNS"
10-
["module_unbound,port"]=""
10+
["module_unbound,port"]="8053"
1111
["module_unbound,arch"]="x86-64"
1212
)
1313
#
@@ -33,8 +33,10 @@ function module_unbound () {
3333
[[ -d "$UNBOUND_BASE" ]] || mkdir -p "$UNBOUND_BASE" || { echo "Couldn't create storage directory: $UNBOUND_BASE"; exit 1; }
3434
docker run -d \
3535
--net=lsio \
36-
-p 53:53 \
37-
-v "${UNBOUND_BASE}:/opt/unbound/etc/unbound/" \
36+
-e PUID=1000 \
37+
-e PGID=1000 \
38+
-p ${module_options["module_unbound,port"]}:53/tcp \
39+
-p ${module_options["module_unbound,port"]}:53/udp \
3840
--name unbound \
3941
--restart=unless-stopped \
4042
mvance/unbound:latest

0 commit comments

Comments
 (0)