Table of Contents |
---|
...
Pre-Requisits
Disable Systemd-Resolved
In order to free up port 53, you may need to disable systemd-resolved on the docker host machine.
sudo su
systemctl stop systemd-resolved
systemctl disable systemd-resolved
...
Code Block |
---|
nameserver 127.0.0.1 options edns0 search home |
Install Docker and Docker-Compose
sudo apt-get install docker
sudo apt-get install docker-compose
Installation
Create Docker-Compose Yaml
vi docker-compose.yaml
Code Block |
---|
version: '2' services: pihole: container_name: pihole image: pihole/pihole:latest hostname: pihole domainname: xxx.com # <-- Update mac_address: d0:ca:ab:cd:ef:01 cap_add: - NET_ADMIN networks: pihole_network: ipv4_address: 192.168.1.51 # <-- Update dns: - 127.0.0.1 - 8.8.8.8 ports: - 443/tcp - 53/tcp - 53/udp - 67/udp - 80/tcp environment: ServerIP: 192.168.1.51 # <-- Update (match ipv4_address) VIRTUAL_HOST: pihole.xxx.com # <-- Update (match hostname + domainname) WEBPASSWORD: "xxx" # <-- Add password (if required) restart: unless-stopped volumes: - ./data/pihole:/etc/pihole:rw - ./data/dnsmasq.d:/etc/dnsmasq.d:rw networks: pihole_network: driver: macvlan driver_opts: parent: enp0s25 # <-- Update ipam: config: - subnet: 192.168.1.0/24 # <-- Update gateway: 192.168.1.1 # <-- Update ip_range: 192.168.1.51/32 # <-- Update |
...
View Logs
docker-compose logs -f
...
Router Configuration
Configure Router to use pi-hole DNS server
...
(If not using DHCP)
If we were not using the DHCP option, we would specify Specify the pi-hole IP address in the list of DNS servers on your router.
...
Management User Interface
Connecting to the Web UI:
...
Setup DHCP
Enable DHCP
Go to Settings → DHCP
Here you can enable DHCP and specify static leases.
Disable DHCP on your Router
If you are going to use pi-hole's DHCP service, you will need to turn off DHCP on the router.
Testing DHCP Service
...