I've set up a both pihole and unbound running in Docker using a macvlan network, and have found that the Docker host machine is unable to resolve domains as a result (e.g. apt update
fails). Here's the compose file:
version: '1.0'
volumes:
pihole:
dnsmasq:
networks:
macvlan_network:
driver: macvlan
driver_opts:
parent: end0
ipam:
driver: default
config:
- subnet: 192.168.50.0/24
gateway: 192.168.50.1
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
restart: unless-stopped
hostname: pihole
dns:
- 127.0.0.1
cap_add:
- NET_ADMIN
environment:
FTLCONF_LOCAL_IPV4: 192.168.50.54
WEB_PORT: ${WEB_PORT}
TZ: ${TZ}
WEBPASSWORD: ${WEBPASSWORD}
WEBTHEME: ${WEBTHEME:-default-light}
REV_SERVER: ${REV_SERVER:-false}
PIHOLE_DNS_: 192.168.50.53
DNSSEC: "false"
DNSMASQ_LISTENING: local
env_file:
- stack.env
volumes:
- '/pihole:/etc/pihole'
- '/pihole/dnsmasq:/etc/dnsmasq.d'
- '/pihole/resolv.conf:/etc/resolv.conf'
networks:
macvlan_network:
ipv4_address: 192.168.50.54
unbound:
image: klutchell/unbound:latest
container_name: unbound
restart: unless-stopped
ports:
- '5053:5053/tcp'
- '5053:5053/udp'
networks:
macvlan_network:
ipv4_address: 192.168.50.53
I set up the bind mount to the custom resolv.conf to allow the pihole container to update gravity. The resolv.conf of the host machine appropriately shoes the pihole container IP, but for some reason fails to resolve domains.
I don't think I've attempted anything crazy in my set up, so there must be something simple/common that I'm overlooking. Thank you in advance for any help.