@bowser1701 #19
@zhangsanfeng2012 #20
# ping z.cn -c 4
PING z.cn (54.222.60.252): 56 data bytes
64 bytes from 54.222.60.252: seq=0 ttl=229 time=30.494 ms
64 bytes from 54.222.60.252: seq=1 ttl=229 time=30.804 ms
64 bytes from 54.222.60.252: seq=2 ttl=229 time=30.618 ms
64 bytes from 54.222.60.252: seq=3 ttl=229 time=30.987 ms
— z.cn ping statistics —
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 30.494/30.725/30.987 ms
# dig z.cn
; <<>> DiG 9.17.11 <<>> z.cn
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21711
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;z.cn. IN A
;; ANSWER SECTION:
z.cn. 599 IN A 54.222.60.252
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Mon Apr 12 11:19:33 CST 2021
;; MSG SIZE rcvd: 49
本地搭建了 dnsmasq 任何局域网的 dns 请求都请求 10.10.10.1:53
@cpstar #17 不好意思 造成理解上困难了
房东的路由器(我不能乱动)是 192.168.1.1
我的路由器是 10.10.10.1 (然后我的其他设备都是 10.10.10.x )
docker 创建的虚拟网卡 是这个网段 192.168.20.0/23
docker0 自身的 ip 地址是 192.168.20.1
docker 中使用 bridge 网络的容器默认网关都是 192.168.20.1 这些容器的 ip 地址是 192.168.20.x