I’m trying to setup powerdns-recursor and pihole in docker.
I have the following docker-compose.yml and this recursor.conf
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
environment:
TZ: 'MyCity/MyCountry' # e.g., 'America/New_York'
WEBPASSWORD: '<PASSWORD>' # Set your web interface password
dns:
- 127.0.0.1
- 1.1.1.1
ports:
- '53:53/tcp'
- '53:53/udp'
- '80:80'
restart: unless-stopped
networks:
- my_custom_network
powerdns:
container_name: powerdns
image: powerdns/pdns-recursor-51
volumes:
- './recursor.conf:/etc/powerdns/recursor.conf'
ports:
- '5354:53/tcp'
- '5354:53/udp'
restart: unless-stopped
networks:
- my_custom_network
networks:
my_custom_network:
driver: bridge
local-address=0.0.0.0
local-address=[::]
include-dir=/etc/powerdns/recursor.d
forward-zones-recurse=.=1.1.1.1
allow-from=<my network's IP>/24
loglevel=9
Unfortunately, when i check docker logs pihole
I have this error message:
[✗] DNS resolution is currently unavailable
I can run dig @localhost example.com
but can’t run dig @localhost -p 5354 example.com
, which is also telling me the powerdns container isn’t working as a dns server because port 5354 isn’t mapping to 53 in the container.
The output I get for dig @localhost example.com“` is this:
;; communications error to ::1#5354: timed out
;; communications error to ::1#5354: timed out
;; communications error to ::1#5354: timed out
;; communications error to 127.0.0.1#5354: timed out
; <<>> DiG 9.18.24-1-Debian <<>> @localhost -p 5354 example.com
; (2 servers found)
;; global options: +cmd
;; no servers could be reached