Actions

Right In The Pi-hole: Difference between revisions

From Mike Beane's Blog

Line 2: Line 2:


=Pi-hole=
=Pi-hole=
==Ubuntu 25.04 to 26.04==
==Lets Make A ProxMox Template==
===Ubuntu 25.04 to 26.04===
Takes about 10 minutes
Takes about 10 minutes
<pre>
<pre>
Line 11: Line 12:
dpkg -l | grep '^rc' | awk '{print $2}' | xargs -r sudo dpkg --purge
dpkg -l | grep '^rc' | awk '{print $2}' | xargs -r sudo dpkg --purge
</pre>
</pre>
===Clean It Up===
# Snapshot it just in case
# Clear machine-id so new containers generate their own unique ID on boot
#* sudo truncate -s 0 /etc/machine-id
#* sudo rm -f /var/lib/dbus/machine-id
# Delete SSH host keys (they will regenerate on first boot)
#* sudo rm -f /etc/ssh/ssh_host_*
# Clear temporary files and command histories
#* sudo apt clean
#* sudo rm -rf /tmp/* /var/tmp/*
#* history -c
#* cat /dev/null > ~/.bash_history
# Shut down the container
#* sudo poweroff


==Setup==
==Setup==

Revision as of 22:00, 23 July 2026

Ran into issues with ubuntu-26.04-standard container in ProxMox in regards to dig: there was no output. Tested 22.04 and it worked. Resorted 25.04.

Pi-hole

Lets Make A ProxMox Template

Ubuntu 25.04 to 26.04

Takes about 10 minutes

sudo apt update && sudo apt install -y gnupg
sudo do-release-upgrade
sudo apt autoremove --purge
sudo apt clean
dpkg -l | grep '^rc' | awk '{print $2}' | xargs -r sudo dpkg --purge

Clean It Up

  1. Snapshot it just in case
  2. Clear machine-id so new containers generate their own unique ID on boot
    • sudo truncate -s 0 /etc/machine-id
    • sudo rm -f /var/lib/dbus/machine-id
  3. Delete SSH host keys (they will regenerate on first boot)
    • sudo rm -f /etc/ssh/ssh_host_*
  4. Clear temporary files and command histories
    • sudo apt clean
    • sudo rm -rf /tmp/* /var/tmp/*
    • history -c
    • cat /dev/null > ~/.bash_history
  5. Shut down the container
    • sudo poweroff

Setup

sudo apt update && sudo apt upgrade -y
sudo apt install curl -y
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
sudo rm /etc/resolv.conf
echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
curl -sSL https://install.pi-hole.net | sudo PIHOLE_SKIP_OS_CHECK=true bash

Selections

Do the setup questions...

Password

pihole setpassword

URL

Go to http://IP:80/admin and login

Unbound

jnTracks pointed me this way...

Setup

sudo apt update
sudo apt install unbound -y
sudo nano /etc/unbound/unbound.conf.d/pi-hole.conf

Get Root Hints

curl -o /var/lib/unbound/root.hints https://www.internic.net/domain/named.root

PreFlight Check

sudo systemctl restart unbound
sudo systemctl enable unbound

Test both a pass and a servfail

dig pi-hole.net @127.0.0.1 -p 5335

dig sigfail.attrib.org @127.0.0.1 -p 5335

Point Pi-Hole to Unbound

  1. Open your Pi-hole Admin Web Interface in a browser.
  2. Navigate to Settings > DNS.
  3. Uncheck any public Upstream DNS Servers you had enabled (e.g., Google, Cloudflare).
  4. Under the Custom DNS (IPv4) fields on the right, check the box and input:
    • 127.0.0.1#5335
  5. Click Save at the bottom of the page.