dnsmasq在docker中无应答


问题描述

制作了一个docker镜像,运行dnsmasq。域名解析竟然无应答, no servers cloud be reached

  • 发送请求解析域名
dig www.google.com @192.168.0.111 -p 53

; <<>> DiG 9.11.3-RedHat-9.11.3-4.fc27 <<>> www.google.com @192.168.0.111 -p 53
;; global options: +cmd
;; connection timed out; no servers could be reached
  • dnsmasq打印日志。从日志中发现缺少reply
[root@bogon ss]# docker-compose -f chinadns.yml up dns-dnsmasq

Starting ss_dns-dnsmasq_1 ... done
Attaching to ss_dns-dnsmasq_1
dns-dnsmasq_1   | dnsmasq: started, version 2.79 cachesize 150
dns-dnsmasq_1   | dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify
dns-dnsmasq_1   | dnsmasq: using nameserver 192.168.0.111#5354
dns-dnsmasq_1   | dnsmasq: read /etc/hosts - 7 addresses
dns-dnsmasq_1   | dnsmasq: query[A] www.google.com from 192.168.0.111
#请求发送上游dns服务器,无后续reply。再去看上游dns服务器,发现已经解析出了ip
# 而dnsmasq还是无应答
dns-dnsmasq_1   | dnsmasq: forwarded www.google.com to 192.168.0.111
dns-dnsmasq_1   | dnsmasq: query[A] www.google.com from 192.168.0.111
dns-dnsmasq_1   | dnsmasq: forwarded www.google.com to 192.168.0.111

解决办法。

尝试了很多办法,很奇怪为什么应答不了。dnsmasq也不大,放到宿主机器上运行吧



上篇: 清静心:人以恶心对我 下篇: pyinstaller编译出的exe被杀毒软件认为是木马