AdguardTeam/AdGuardHome

Docker Containers can connect to AdGuard GUI but Unable to Resolve via host IP

Open

#6,442 opened on 2023年11月19日

GitHub で見る
 (9 comments) (0 reactions) (0 assignees)Go (34,000 stars) (2,333 forks)batch import
dockerhelp wantedwaiting for data

説明

Prerequisites

Platform (OS and CPU architecture)

Linux, AMD64 (aka x86_64)

Installation

Docker

Setup

On one machine

AdGuard Home version

v0.107.41

Action

Please bear with me on this. It's a confusing issue.

First of all, adguard docker-compose.yml:

version: "3.9"
services:
  adguardhome:
    image: adguard/adguardhome
    container_name: adguardhome
    ports:
      - 53:53/tcp
      - 53:53/udp
      - 3000:3000/tcp
      - 3001:80/tcp
      - 3002:8902/tcp
    volumes:
      - ./conf:/opt/adguardhome/conf
      - ./data:/opt/adguardhome/work
    restart: always
    network_mode: bridge

Pretty vanilla setup.

The host IP here is 192.168.25.81.

user@192.168.25.81$ nslookup google.com 192.168.25.81
<success>

# now try to resolve from another docker container:
user@192.168.25.81:~/docker-configs/mosquitto$ docker compose exec mosquitto nslookup google.com 192.168.25.81
;; connection timed out; no servers could be reached

# however, the adguard container can still be reached on different ports.. why is that??
user@192.168.25.81:~/docker-configs/mosquitto$ docker compose exec mosquitto wget 192.168.25.81:3001 -O -
Connecting to 192.168.25.81:3001 (192.168.25.81:3001)
writing to stdout
<!doctype html><html lang="en"><head><meta charset="utf-8"><me.... (snip)

### Expected result

I should be able to use the host IP to resolve from other containers. Since it can connect to the GUI, why can't it connect to the DNS server on port 53?

### Actual result

See above. Thank you!

### Additional information and/or screenshots

_No response_

コントリビューターガイド