Pihole
You first need to free port 53 on the Pi :
sudo nano /etc/systemd/resolved.conf
[Resolve]
DNS=1.1.1.1
FallbackDNS=1.0.0.1
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
DNSStubListener=no
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo reboot now
Then create ./Pihole/etc-pihole/ and ./Pihole/etc-dnsmasq.d/
Now you can Install Pi-hole
---
version: '3.3'
services:
  pihole:
    container_name: pihole
    hostname: piholehostname # the name you want in the GUI.
    image: pihole/pihole:latest
    ports:
      - 53:53/tcp #DNS Port
      - 53:53/udp #DNS Port
      #- 67:67/udp #DHCP Port
      - 83:80/tcp #Dashboard Port
      #- 443:443/tcp #Port 443 is to provide a sinkhole for ads that use SSL.
    environment:
      TZ: Europe/Paris
      WEBPASSWORD: xxxxxx
      DNS1: 1.1.1.1
      DNS2: 1.0.0.1
      DNSSEC: 'true'
    volumes:
      - /srv/path/Files/Pihole/etc-pihole/:/etc/pihole/
      - /srv/path/Files/Pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/
    cap_add:
      - NET_ADMIN
    restart: unless-stopped
Enter your modem settings and set your DNS to your pihole's host address.
You might want to restart your modem / router.
To undo the changes :
Edit /etc/systemd/resolved.conf 
sudo nano /etc/systemd/resolved.conf
Comment out DNS=, FallbackDNS= and DNSStubListener=no
Remove the /etc/resolv.conf symbolic link:
sudo rm /etc/resolv.conf
Reboot.
Script to add YouTube Ads DNS to Pi-hole black list
HOW TO UPDATE
Optional if previously installed with portainer.
Create a docker-compose file with the configuration above.
Starting your pihole is then just a matter of running the following in the directory of your docker-compose.yml...
docker-compose up -d
To update to a newer version, (when a new update/container is available):
docker pull pihole/pihole
docker-compose down
docker-compose up -d
Blocklists:
- https://firebog.net
- https://avoidthehack.com/best-pihole-blocklists
- https://github.com/topics/pihole-ads-list
See also : unbound + pihole : https://hub.docker.com/r/klutchell/unbound