设置起来似乎很简单,但我实际上无法让它工作..
设置:
$ docker run -it -p 53:5300/udp alpine /bin/sh
$ apk add bash nano wget ca-certificates bind-tools unbound
$ mkdir -p /var/log/unbound
$ touch /var/log/unbound/unbound.log
$ chown unbound /var/log/unbound/unbound.log
/etc/unbound/unbound.conf:
server:
verbosity: 2
interface: 0.0.0.0
port: 5300
logfile: "/var/log/unbound/unbound.log"
root-hints: /usr/share/dns-root-hints/named.root
trust-anchor-file: "/usr/share/dnssec-root/trusted-key.key"
python:
remote-control:
control-enable: yes
control-interface: /run/unbound.control.sock
测试:
$ unbound
$ dig google.com @127.0.0.1 -p 5300
; <<>> DiG 9.16.6 <<>> google.com @127.0.0.1 -p 5300
;; global options: +cmd
;; connection timed out; no servers could be reached
/var/log/unbound/unbound.log:
[1610066128] unbound[72:0] notice: init module 0: validator
[1610066128] unbound[72:0] notice: init module 1: iterator
[1610066128] unbound[72:0] info: start of service (unbound 1.10.1).
## dig
[1610066668] unbound[72:0] info: resolving google.com. A IN
[1610066668] unbound[72:0] info: priming . IN NS
[1610066669] unbound[72:0] notice: sendto failed: Address not available
[1610066669] unbound[72:0] notice: remote address is 2001:500:2f::f port 53
[1610066669] unbound[72:0] info: error sending query to auth server 2001:500:2f::f port 53
[1610066669] unbound[72:0] notice: sendto failed: Address not available
[1610066669] unbound[72:0] notice: remote address is 2001:500:2d::d port 53
[1610066669] unbound[72:0] info: error sending query to auth server 2001:500:2d::d port 53
[1610066670] unbound[72:0] notice: sendto failed: Address not available
[1610066670] unbound[72:0] notice: remote address is 2001:7fd::1 port 53
[1610066670] unbound[72:0] info: error sending query to auth server 2001:7fd::1 port 53
[1610066670] unbound[72:0] notice: sendto failed: Address not available
[1610066670] unbound[72:0] notice: remote address is 2001:500:a8::e port 53
[1610066670] unbound[72:0] info: error sending query to auth server 2001:500:a8::e port 53
[1610066670] unbound[72:0] notice: sendto failed: Address not available
[1610066670] unbound[72:0] notice: remote address is 2001:500:2d::d port 53
[1610066670] unbound[72:0] info: error sending query to auth server 2001:500:2d::d port 53
[1610066672] unbound[72:0] notice: sendto failed: Address not available
[1610066672] unbound[72:0] notice: remote address is 2001:7fe::53 port 53
[1610066672] unbound[72:0] info: error sending query to auth server 2001:7fe::53 port 53
[1610066672] unbound[72:0] notice: sendto failed: Address not available
[1610066672] unbound[72:0] notice: remote address is 2001:500:1::53 port 53
[1610066672] unbound[72:0] info: error sending query to auth server 2001:500:1::53 port 53
[1610066672] unbound[72:0] notice: sendto failed: Address not available
[1610066672] unbound[72:0] notice: remote address is 2001:500:a8::e port 53
[1610066672] unbound[72:0] info: error sending query to auth server 2001:500:a8::e port 53
[1610066672] unbound[72:0] notice: sendto failed: Address not available
[1610066672] unbound[72:0] notice: remote address is 2001:500:2d::d port 53
[1610066672] unbound[72:0] info: error sending query to auth server 2001:500:2d::d port 53
[1610066676] unbound[72:0] notice: sendto failed: Address not available
[1610066676] unbound[72:0] notice: remote address is 2001:500:2f::f port 53
[1610066676] unbound[72:0] info: error sending query to auth server 2001:500:2f::f port 53
[1610066676] unbound[72:0] notice: sendto failed: Address not available
[1610066676] unbound[72:0] notice: remote address is 2001:500:200::b port 53
[1610066676] unbound[72:0] info: error sending query to auth server 2001:500:200::b port 53
[1610066676] unbound[72:0] notice: sendto failed: Address not available
[1610066676] unbound[72:0] notice: remote address is 2001:500:1::53 port 53
[1610066676] unbound[72:0] info: error sending query to auth server 2001:500:1::53 port 53
[1610066677] unbound[72:0] notice: sendto failed: Address not available
[1610066677] unbound[72:0] notice: remote address is 2001:500:200::b port 53
[1610066677] unbound[72:0] info: error sending query to auth server 2001:500:200::b port 53
[1610066678] unbound[72:0] notice: sendto failed: Address not available
[1610066678] unbound[72:0] notice: remote address is 2001:503:ba3e::2:30 port 53
[1610066678] unbound[72:0] info: error sending query to auth server 2001:503:ba3e::2:30 port 53
[1610066678] unbound[72:0] notice: sendto failed: Address not available
[1610066678] unbound[72:0] notice: remote address is 2001:500:9f::42 port 53
[1610066678] unbound[72:0] info: error sending query to auth server 2001:500:9f::42 port 53
[1610066678] unbound[72:0] notice: sendto failed: Address not available
[1610066678] unbound[72:0] notice: remote address is 2001:500:12::d0d port 53
[1610066678] unbound[72:0] info: error sending query to auth server 2001:500:12::d0d port 53
[1610066679] unbound[72:0] notice: sendto failed: Address not available
[1610066679] unbound[72:0] notice: remote address is 2001:dc3::35 port 53
[1610066679] unbound[72:0] info: error sending query to auth server 2001:dc3::35 port 53
[1610066679] unbound[72:0] notice: sendto failed: Address not available
[1610066679] unbound[72:0] notice: remote address is 2001:500:9f::42 port 53
[1610066679] unbound[72:0] info: error sending query to auth server 2001:500:9f::42 port 53
[1610066680] unbound[72:0] notice: sendto failed: Address not available
[1610066680] unbound[72:0] notice: remote address is 2001:500:2::c port 53
[1610066680] unbound[72:0] info: error sending query to auth server 2001:500:2::c port 53
[1610066680] unbound[72:0] notice: sendto failed: Address not available
[1610066680] unbound[72:0] notice: remote address is 2001:dc3::35 port 53
[1610066680] unbound[72:0] info: error sending query to auth server 2001:dc3::35 port 53
[1610066682] unbound[72:0] notice: sendto failed: Address not available
[1610066682] unbound[72:0] notice: remote address is 2001:503:c27::2:30 port 53
[1610066682] unbound[72:0] info: error sending query to auth server 2001:503:c27::2:30 port 53
[1610066682] unbound[72:0] notice: sendto failed: Address not available
[1610066682] unbound[72:0] notice: remote address is 2001:dc3::35 port 53
[1610066682] unbound[72:0] info: error sending query to auth server 2001:dc3::35 port 53
[1610066683] unbound[72:0] notice: sendto failed: Address not available
[1610066683] unbound[72:0] notice: remote address is 2001:500:1::53 port 53
[1610066683] unbound[72:0] info: error sending query to auth server 2001:500:1::53 port 53
[1610066683] unbound[72:0] notice: sendto failed: Address not available
[1610066683] unbound[72:0] notice: remote address is 2001:500:1::53 port 53
[1610066683] unbound[72:0] info: error sending query to auth server 2001:500:1::53 port 53
[1610066683] unbound[72:0] notice: sendto failed: Address not available
[1610066683] unbound[72:0] notice: remote address is 2001:500:9f::42 port 53
[1610066683] unbound[72:0] info: error sending query to auth server 2001:500:9f::42 port 53
[1610066683] unbound[72:0] notice: sendto failed: Address not available
[1610066683] unbound[72:0] notice: remote address is 2001:7fd::1 port 53
[1610066683] unbound[72:0] info: error sending query to auth server 2001:7fd::1 port 53
[1610066683] unbound[72:0] notice: sendto failed: Address not available
[1610066683] unbound[72:0] notice: remote address is 2001:dc3::35 port 53
[1610066683] unbound[72:0] info: error sending query to auth server 2001:dc3::35 port 53
[1610066683] unbound[72:0] notice: sendto failed: Address not available
[1610066683] unbound[72:0] notice: remote address is 2001:dc3::35 port 53
[1610066683] unbound[72:0] info: error sending query to auth server 2001:dc3::35 port 53
[1610066683] unbound[72:0] notice: sendto failed: Address not available
[1610066683] unbound[72:0] notice: remote address is 2001:7fe::53 port 53
[1610066683] unbound[72:0] info: error sending query to auth server 2001:7fe::53 port 53
[1610066685] unbound[72:0] notice: sendto failed: Address not available
[1610066685] unbound[72:0] notice: remote address is 2001:500:2f::f port 53
[1610066685] unbound[72:0] info: error sending query to auth server 2001:500:2f::f port 53
[1610066688] unbound[72:0] notice: sendto failed: Address not available
[1610066688] unbound[72:0] notice: remote address is 2001:7fe::53 port 53
[1610066688] unbound[72:0] info: error sending query to auth server 2001:7fe::53 port 53
[1610066688] unbound[72:0] notice: sendto failed: Address not available
[1610066688] unbound[72:0] notice: remote address is 2001:500:12::d0d port 53
[1610066688] unbound[72:0] info: error sending query to auth server 2001:500:12::d0d port 53
[1610066688] unbound[72:0] notice: sendto failed: Address not available
[1610066688] unbound[72:0] notice: remote address is 2001:500:9f::42 port 53
[1610066688] unbound[72:0] info: error sending query to auth server 2001:500:9f::42 port 53
[1610066688] unbound[72:0] notice: sendto failed: Address not available
[1610066688] unbound[72:0] notice: remote address is 2001:500:12::d0d port 53
[1610066688] unbound[72:0] info: error sending query to auth server 2001:500:12::d0d port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:7fd::1 port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:7fd::1 port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:503:ba3e::2:30 port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:503:ba3e::2:30 port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:7fd::1 port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:7fd::1 port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:500:2f::f port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:500:2f::f port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:500:9f::42 port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:500:9f::42 port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:500:1::53 port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:500:1::53 port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:500:a8::e port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:500:a8::e port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:7fe::53 port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:7fe::53 port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:500:2f::f port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:500:2f::f port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:7fe::53 port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:7fe::53 port 53
[1610066691] unbound[72:0] notice: sendto failed: Address not available
[1610066691] unbound[72:0] notice: remote address is 2001:500:200::b port 53
[1610066691] unbound[72:0] info: error sending query to auth server 2001:500:200::b port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:503:c27::2:30 port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:503:c27::2:30 port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:500:12::d0d port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:500:12::d0d port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:503:c27::2:30 port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:503:c27::2:30 port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:500:a8::e port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:500:a8::e port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:7fd::1 port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:7fd::1 port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:503:ba3e::2:30 port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:503:ba3e::2:30 port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:503:c27::2:30 port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:503:c27::2:30 port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:503:ba3e::2:30 port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:503:ba3e::2:30 port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:500:12::d0d port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:500:12::d0d port 53
[1610066692] unbound[72:0] notice: sendto failed: Address not available
[1610066692] unbound[72:0] notice: remote address is 2001:500:2d::d port 53
[1610066692] unbound[72:0] info: error sending query to auth server 2001:500:2d::d port 53
[1610066694] unbound[72:0] notice: sendto failed: Address not available
[1610066694] unbound[72:0] notice: remote address is 2001:500:2d::d port 53
[1610066694] unbound[72:0] info: error sending query to auth server 2001:500:2d::d port 53
[1610066695] unbound[72:0] notice: sendto failed: Address not available
[1610066695] unbound[72:0] notice: remote address is 2001:500:2::c port 53
[1610066695] unbound[72:0] info: error sending query to auth server 2001:500:2::c port 53
[1610066695] unbound[72:0] notice: sendto failed: Address not available
[1610066695] unbound[72:0] notice: remote address is 2001:503:c27::2:30 port 53
[1610066695] unbound[72:0] info: error sending query to auth server 2001:503:c27::2:30 port 53
[1610066698] unbound[72:0] notice: sendto failed: Address not available
[1610066698] unbound[72:0] notice: remote address is 2001:500:200::b port 53
[1610066698] unbound[72:0] info: error sending query to auth server 2001:500:200::b port 53
[1610066698] unbound[72:0] notice: sendto failed: Address not available
[1610066698] unbound[72:0] notice: remote address is 2001:503:ba3e::2:30 port 53
[1610066698] unbound[72:0] info: error sending query to auth server 2001:503:ba3e::2:30 port 53
[1610066698] unbound[72:0] notice: sendto failed: Address not available
[1610066698] unbound[72:0] notice: remote address is 2001:500:a8::e port 53
[1610066698] unbound[72:0] info: error sending query to auth server 2001:500:a8::e port 53
[1610066698] unbound[72:0] notice: sendto failed: Address not available
[1610066698] unbound[72:0] notice: remote address is 2001:500:200::b port 53
[1610066698] unbound[72:0] info: error sending query to auth server 2001:500:200::b port 53
[1610066698] unbound[72:0] notice: sendto failed: Address not available
[1610066698] unbound[72:0] notice: remote address is 2001:500:2::c port 53
[1610066698] unbound[72:0] info: error sending query to auth server 2001:500:2::c port 53
[1610066698] unbound[72:0] notice: sendto failed: Address not available
[1610066698] unbound[72:0] notice: remote address is 2001:500:2::c port 53
[1610066698] unbound[72:0] info: error sending query to auth server 2001:500:2::c port 53
[1610066698] unbound[72:0] notice: sendto failed: Address not available
[1610066698] unbound[72:0] notice: remote address is 2001:500:2::c port 53
[1610066698] unbound[72:0] info: error sending query to auth server 2001:500:2::c port 53
是我糟糕的互联网提供商拦截和更改了我的 DNS 请求。这真的很不幸,但我还是打算使用 VPN。
只是出于好奇:有没有办法使用不同的端口,所以它们不能被改变?