暴露53端口/或者–net host
1 2 3 4 5
| docker run \ --name dns \ -d \ --publish 53:53/udp \ v2ray/official v2ray
|
1 2 3 4 5
| docker run \ --name dns \ -d \ --net host \ v2ray/official v2ray
|
Container
1 2
| # dig blog.newnius.com ;; reply from unexpected source: 172.18.0.1#53, expected 192.168.1.9#53
|
Host
1 2
| $ dig blog.newnius.com @172.18.0.1 ;; reply from unexpected source: 192.168.1.9#53, expected 172.18.0.1#53
|
Column 1 |
Column 2 |
Column 3 |
Text |
Text |
Text |
指定监听ip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
; <<>> DiG 9.12.4-P2 <<>> blog.newnius.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42684 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION: ;blog.newnius.com. IN A
;; ANSWER SECTION: blog.newnius.com. 600 IN A 120.27.103.118
;; Query time: 2 msec ;; SERVER: 127.0.0.11#53(127.0.0.11) ;; WHEN: Fri Jul 10 16:33:21 CST 2020 ;; MSG SIZE rcvd: 50
|
参考:https://github.com/moby/moby/issues/15127#issuecomment-323663787