Pi-hole unable to connect to dns server but dns server is pingable

Expected Behaviour:

I have pi.hole linked with my wireguard VPN and usually everything will connect to the internet and pi.hole has no trouble blocking ads.

docker-compose:

version: '3.8'

networks:
  homelab:
    driver: bridge
    ipam:
      config:
        - subnet: 172.20.0.0/16

services:
  # ---------- WireGuard ----------
  wireguard:
    image: linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
      - SERVERURL=23.242.59.185
      - SERVERPORT=51820
      - PEERS=Pixel7
      - PEERDNS=192.168.0.196
      - INTERNAL_SUBNET=10.13.13.0
      - ALLOWEDIPS=0.0.0.0/0
    volumes:
      - ./wireguard/config:/config
      - /lib/modules:/lib/modules:ro
    ports:
      - "51820:51820/udp"
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
      - net.ipv4.ip_forward=1
    restart: unless-stopped
    networks:
      - homelab

  # ---------- Pi-hole ----------
  pihole:
    image: pihole/pihole:latest
    container_name: pihole
    cap_add:
      - NET_ADMIN
      - NET_BIND_SERVICE
    environment:
      TZ: 'America/Los_Angeles'
      PIHOLE_DNS_: '149.112.112.112'
    volumes:
      - './pihole/etc-pihole:/etc/pihole'
      - './pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "8080:80/tcp"
    restart: unless-stopped
    networks:
      - homelab

  # ---------- Portainer ----------
  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    command: -H unix:///var/run/docker.sock
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - './portainer/data:/data'
    ports:
      - "9000:9000"
    restart: unless-stopped

Actual Behaviour:

Right now if I connect to my VPN and I try to use my browser a search query will just hang and it doesn’t allow me to search or use the internet. When I check pi-hole diagnosis page it says connection error failed to send udp request but its doing that with all DNS options. I just tried to ping opendns servers from my Raspberry Pi and I got a reply.

Debug Token:

https://tricorder.pi-hole.net/E59JfFtt/

Please post the compose file (or docker run command) used to start the container.

I’m sorry I fixed it thank you