首页 > 解决方案 > 在 Docker Swarm 上看不到 PiHole 客户端

问题描述

亲爱的

我在 Docker Swarm 上运行 PiHole,但我只看到 2 个客户端:10.0.0.3 和 localhost。如果我从网络上的各种讨论中正确理解,如果我以主机模式(pihole 被迫在单个 swarm 节点上运行)公开 DNS 端口,我应该能够看到 PiHole 中的所有客户端:

 ports:
      - published: 53
        target: 53
        protocol: tcp
        mode: host
      - published: 53
        target: 53
        protocol: udp
        mode: host
      - published: 67
        target: 67
        protocol: udp
        mode: ingress
      - published: 8053
        target: 80
        protocol: tcp
        mode: ingress

不幸的是,如果我以这种方式暴露端口,dns 服务将不再工作:我可以看到容器上暴露的端口:

pi@raspy3:~ $ docker port 3be0321961a6
53/tcp -> 0.0.0.0:53
53/udp -> 0.0.0.0:53

但我无法通过 NETSTAT 看到它们:

pi@raspy3:~ $ netstat -atu | grep LISTEN
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp6       0      0 [::]:8053               [::]:*                  LISTEN
tcp6       0      0 [::]:domain             [::]:*                  LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
tcp6       0      0 [::]:https              [::]:*                  LISTEN
tcp6       0      0 [::]:8000               [::]:*                  LISTEN
tcp6       0      0 [::]:9000               [::]:*                  LISTEN
tcp6       0      0 [::]:2377               [::]:*                  LISTEN
tcp6       0      0 [::]:7946               [::]:*                  LISTEN
tcp6       0      0 [::]:http               [::]:*                  LISTEN

并且 nslookup 不起作用:

pi@raspy4:~ $ nslookup google.com 192.168.32.2
;; connection timed out; no servers could be reached

你能帮我理解我失去了什么吗?

谢谢 :)

标签: dockerdocker-swarmswarm

解决方案


解决了将接口侦听行为更改为侦听所有接口,允许所有来源

显然,一定要遵循 PiHole 团队的所有安全要点;)


推荐阅读