mirror of
				https://github.com/tborychowski/self-hosted-cookbook.git
				synced 2025-11-03 23:37:32 +00:00 
			
		
		
		
	
		
			
				
	
	
	
		
			1.6 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.6 KiB
		
	
	
	
	
	
	
	
PiHole
Overview
docker-compose.yml
---
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
Tips & Tricks
Some information here may be outdated!
Force DNS to PiHole with Unifi Secure Gateway
Pihole block youtube ads
https://www.reddit.com/r/pihole/comments/84luw8/blocking_youtube_ads/dvqq6ax/
DNS over HTTPS
https://docs.pi-hole.net/guides/dns-over-https/
PiHole Conditional forwarding for multiple VLANs
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 coversserver=/5.168.192.in-addr.arpa/192.168.1.1 server=/9.168.192.in-addr.arpa/192.168.1.1192.168.5.0/24and192.168.9.0/24respectively. - Restart PiHole:
pihole restartdns