---
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
- "443:443/tcp"
# - "67:67/udp"
environment:
TZ: 'Europe/Dublin'
WEBPASSWORD: 'set a secure password here or it will be random'
volumes:
- ./etc-pihole/:/etc/pihole/
- ./etc-dnsmasq.d/:/etc/dnsmasq.d/
cap_add:
- NET_ADMIN
restart: unless-stopped
Some information here may be outdated!
https://www.reddit.com/r/pihole/comments/84luw8/blocking_youtube_ads/dvqq6ax/
https://docs.pi-hole.net/guides/dns-over-https/
If you have multiple VLANs on your router, then you might want conditional forwarding of all your subnets back to your router.
- Create a new file:
sudo nano /etc/dnsmasq.d/02-custom.conf
- Then add, e.g.:
Which covers
server=/5.168.192.in-addr.arpa/192.168.1.1 server=/9.168.192.in-addr.arpa/192.168.1.1
192.168.5.0/24
and192.168.9.0/24
respectively. - Restart PiHole:
pihole restartdns