All in all, i get it working with a macvlan. This is my docker-compose.yml file:
version: '2'
volumes:
pihole:
dnsmasq:
networks:
macvlan_network:
driver: macvlan
driver_opts:
parent: enp1s0
ipam:
driver: default
config:
- subnet: 192.168.178.0/24
gateway: 192.168.178.1
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
hostname: ${HOSTNAME}
cap_add:
- NET_ADMIN
environment:
ServerIP: ${ServerIP}
WEB_PORT: 81
WEBPASSWORD: ${WEBPASSWORD}
TZ: ${TZ}
DNS1: 192.168.178.253 # Hardcoded to our Unbound server
DNSSEC: "true" # Enable DNSSEC
DNSMASQ_LISTENING: local
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
networks:
macvlan_network:
ipv4_address: 192.168.178.254
restart: always
unbound:
image: klutchell/unbound:latest
ports:
- '5053:5053/tcp'
- '5053:5053/udp'
networks:
macvlan_network:
ipv4_address: 192.168.178.253
restart: always
I can reach pihole web interface under 192.168.178.254:81. To be honest, unbound is still not working (if i add 127.0.0.1#5335 as my custom 1 (IPv4) nothing is working anymore, but i.e. Cloudflare as upstream dns server is working), but this is a different issue. DHCP is working.
Edit: Updated my docker-compose file in this post. This is the solution to get unbound working. Just add 192.168.178.253 into custom 1 (IPv4), thats it.