MatthewVance / unbound-docker

Unbound DNS Server Docker Image
MIT License
586 stars 142 forks source link

Problems when depolyed under Portainer 2.21.0 with bridge network #185

Open bmwhd123 opened 2 months ago

bmwhd123 commented 2 months ago

Describe the bug I have been running the latest image of unbound from here along with pihole in two docker containers connected with a user defined bridge network. This setup worked perfectly for a long time on two Raspberry Pi 4Bs.

When the latest LTS version of portainer was released, 2.21.0, something changed. Unbound, which is mapped to port 5053 in it's container, stopped responding to pihole even though the containers can see each other. Unbound also responds to a dig command direct to it's container IP address.

I've submitted an issue on the portainer gitub but wanted to list the issue here as well.

To Reproduce Steps to reproduce the behavior:

Here is the compose file for the stack in portainer:

Docker Compose version

version: "3-A"

networks: dns_net: driver: bridge ipam: config:

Define services (containers to be created)

services:

Service name: pihole

pihole:

Name of the container instance

container_name: pihole

# Image to use for this container
# Use the specified version of the pihole image
image: pihole/pihole:2024.07.0
networks:
  dns_net:
    ipv4_address: 172.18.0.7

# Expose and map ports (host:container)
ports:
  - "53:53/tcp" # DNS (TCP)
  - "53:53/udp" # DNS (UDP)
  - "7300:80/tcp" # Web UI HTTP

# Environment variables
environment:
  TZ: "America/Chicago" # Time Zone; Update this to your time zone
  WEBPASSWORD: "<PASSWORD HERE>" # Admin password for web UI; 
  PIHOLE_DNS_: '172.18.0.8#5053'

# Mount volumes for persistent data
volumes:
  - "/data/pihole/data/pihole:/etc/pihole" # Pi-hole data
  - "/data/pihole/data/dnsmasq:/etc/dnsmasq.d" # dnsmasq data

# Restart policy for the container when it exits
restart: unless-stopped

# DNS servers for this container to use
dns:
 - 127.0.0.1 # Localhost for internal resolution
 - 1.1.1.1 # Cloudflare DNS for external resolution

unbound: container_name: unbound image: alpinelinux/unbound:latest # remember to change this if you're not using rpi networks: dns_net: ipv4_address: 172.18.0.8 volumes:

Once started, the containers appear to be operating normally but pihole gets no response to queries to unbound.

Expected behavior Unbound should respond to pihole in its container.

Error messages No error message, just no response.

Additional context For reasons I can't understand, changing the address pihole is using for unbound in this example from 172.18.0.8#5053 to 172.18.0.8#53 seems to get things working again.

djrm05 commented 1 month ago

@bmwhd123 check the port you have set in your unbound.conf file in the line "interface:" . ...

bmwhd123 commented 1 month ago

That line reads: interface 0.0.0.0@5053