小编sai*_*sai的帖子

Docker嵌入式DNS解析器如何工作?

我知道Docker有一个嵌入式Dns解析器.
当我在自己的桥上运行一个容器时:

$ docker run -it --rm --privileged --network=mybridge xxx bash

root@18243bfe6b50:/# cat /etc/resolv.conf  
nameserver 127.0.0.11  
options ndots:0  

root@18243bfe6b50:/# netstat -anop  
Active Internet connections (servers and established)  
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name Timer  
tcp        0      0 127.0.0.11:45997        0.0.0.0:*               LISTEN      -                off (0.00/0/0)  
udp        0      0 127.0.0.11:49614        0.0.0.0:*        

it shows there is a dns resolver, and iptables help do a port transfer.  

root@18243bfe6b50:/# iptables -nvL -t nat  
.....  
Chain DOCKER_OUTPUT (1 references)  
 pkts bytes target     prot …
Run Code Online (Sandbox Code Playgroud)

namespaces docker

21
推荐指数
1
解决办法
2378
查看次数

标签 统计

docker ×1

namespaces ×1