Pi-hole deployment
Requirements
- Ubuntu Server 20.04 LTS
Quick Start
-
Disable systemd-resolved name server
sudo sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf sudo sh -c 'rm /etc/resolv.conf && ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf' sudo systemctl restart systemd-resolved -
Setup a password for the web admnistration interface
echo "MyAwesomePassword" > conf/webpassword -
Copy
env.exampleto.env -
Edit
.envto adapt the Fully Qualified Domain Name (FQDN) of the Pi-hole container.This is used by Traefik to redirect requests to the web interface.
-
docker-compose up -d -
Go to the Web interface at https://pi-hole.example.net, and adapt the settings as needed for your setup.
For example:
-
Settings -> DNS -> Upstream DNS Servers: Add at least one upstream server.
-
Settings -> DNS -> Upstream DNS Servers: Enable Use Conditional Forwarding and configure it.
-
Settings -> DHCP: Disable DHCP server enabled if you are using another DHCP server, which is assumed in this repository.
-
-
Configure the host server to use Pi-hole as well:
Edit
/etc/netplan/00-installer-config.yamlwith:network: ethernets: ens160: dhcp4: true dhcp4-overrides: use-dns: false nameservers: addresses: [127.0.0.1] version: 2 -
Apply the network configuration with:
sudo netplan apply