2021-04-14 22:40:09 +00:00
2021-04-14 22:40:09 +00:00
2021-04-14 22:40:09 +00:00
2021-04-14 15:52:40 +00:00
2021-04-15 06:30:38 +00:00

Pi-hole deployment

Requirements

  • Ubuntu Server 20.04 LTS

Quick Start

  1. 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
    
  2. Setup a password for the web admnistration interface

    echo "MyAwesomePassword" > conf/webpassword
    
  3. Copy env.example to .env

  4. Edit .env to adapt the Fully Qualified Domain Name (FQDN) of the Pi-hole container.

    This is used by Traefik to redirect requests to the web interface.

  5. docker-compose up -d

  6. 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.

  7. Configure the host server to use Pi-hole as well:

    Edit /etc/netplan/00-installer-config.yaml with:

    network:
     ethernets:
         ens160:
             dhcp4: true
             dhcp4-overrides:
                 use-dns: false
             nameservers:
                 addresses: [127.0.0.1]
     version: 2
    
  8. Apply the network configuration with:

    sudo netplan apply
    
Description