Hello, if anyone can help me with this it would be much appreciated - I've been bashing my head against this and no amount of Googling or experimentation is helping.
The issue I am facing:
I have a Windows 10 machine on my network which is up 24/7, which I would like to run pi-hole on.
I can run a simple pi-hole setup in Docker just fine - it starts and I can access the UI. However, my router (Virgin Super Hub 3), does not allow a custom DNS server to be configured - so I'm trying to also use pi-hole as the DHCP server, but with the default settings the DHCP broadcasts don't get propagated on my physical network.
To enable this, from what I understand, there are three options:
- Keep the Docker network in bridge mode, and run a DHCP relay on the host machine
- Run the Docker network in host mode
- Use a macvlan network
According to the Docker docs, host mode is only supported on Linux, and I haven't tried option 1 because I'm not certain where to find a suitable DHCP relay for Windows, so I'm trying to get option 3 working - the macvlan network.
I've tried to configure pi-hole to start in Docker with a macvlan network but no matter what I try, pi-hole fails to start properly, and displays the error:
DNS resolution is currently unavailable
See below for the full details of my setup.
Details about my system:
Operating system: Windows 10
Pi-hole: running in Docker
My network info:
The host machine's IP address: 192.168.0.10
The router's IP address: 192.168.0.1
Result of running ipconfig command on the host machine:
ipconfig
Windows IP Configuration
Unknown adapter Local Area Connection:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::98a2:79eb:d879:b46e%16
IPv4 Address. . . . . . . . . . . : 192.168.0.10
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
Ethernet adapter Ethernet 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter vEthernet (Default Switch):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::2989:48a0:26:5edf%22
IPv4 Address. . . . . . . . . . . : 172.17.23.49
Subnet Mask . . . . . . . . . . . : 255.255.255.240
Default Gateway . . . . . . . . . :
My docker-compose.yml:
docker-compose.yml
version: '2'
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
hostname: pihole
mac_address: d0:ca:ab:cd:ef:02
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
cap_add:
- NET_ADMIN
networks:
pihole_network:
ipv4_address: 192.168.0.199
dns:
- 127.0.0.1
- 1.1.1.1
ports:
- 443:443/tcp
- 53:53/tcp
- 53:53/udp
- 67:67/udp
- 80:80/tcp
environment:
ServerIP: 192.168.0.199
DNS1: 127.0.0.1
DNS2: 1.1.1.1
restart: unless-stopped
networks:
pihole_network:
driver: macvlan
driver_opts:
parent: eth0.10
ipam:
config:
- subnet: 192.168.0.0/24
gateway: 192.168.0.1
ip_range: 192.168.0.192/28
Here are some commands I ran to get the pihole network details:
docker exec pihole ip addr show eth0
10: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether d0:ca:ab:cd:ef:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.0.199/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
docker exec pihole ip route
default via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.199