装了个 unbound 来转发延迟很高怎么破

2017-07-16 21:25:44 +08:00
 q0000x
下面这个是 unbound-control lookup www.baidu.com 的结果
rto 35799 msec, ttl 709, ping 7239 var 7140 rtt 35799, tA 0, tAAAA 0, tother 0, EDNS 0 assumed.

如果直接 dig 到远程服务器只有 1700msec

以下是 unbound 的配置

server:
verbosity: 1
num-threads: 1
interface: 127.0.0.1
port: 1053
outgoing-range: 60
outgoing-num-tcp: 1
incoming-num-tcp: 1
msg-buffer-size: 8192
msg-cache-size: 100k
msg-cache-slabs: 1
num-queries-per-thread: 30
rrset-cache-size: 100k
rrset-cache-slabs: 1
infra-cache-slabs: 1
infra-cache-numhosts: 10000
do-ip4: yes
do-ip6: no
do-udp: yes
do-tcp: yes
tcp-upstream: yes
access-control: 0.0.0.0/0 allow_snoop
chroot: "/etc/unbound"
username: "root"
directory: "/etc/unbound"
pidfile: "/var/run/unbound.pid"
root-hints: "/etc/unbound/named.cache"
hide-identity: yes
hide-version: yes
target-fetch-policy: "2 1 0 0 0 0"
harden-short-bufsize: yes
harden-large-queries: yes
harden-glue: yes
private-address: 10.0.0.0/8
private-address: 172.16.0.0/12
private-address: 192.168.0.0/16
private-address: 169.254.0.0/16
private-address: fd00::/8
private-address: fe80::/10
do-not-query-localhost: yes
prefetch: yes
module-config: "iterator"
key-cache-size: 100k
key-cache-slabs: 1
neg-cache-size: 10k
ssl-upstream: no
python:
# Script file to load
# python-script: "/etc/unbound/ubmodule-tst.py"

# Remote control config section.
remote-control:
control-enable: yes
control-use-cert: no
forward-zone:
name: "."
forward-addr: *.*.*.*@3535
# forward-addr: 114.114.114.114
forward-first: yes
6590 次点击
所在节点    DNS
8 条回复
JackyBao
2017-07-16 23:22:56 +08:00
要不来试试我的方案?
https://github.com/aa65535/hev-dns-forwarder
q0000x
2017-07-16 23:33:45 +08:00
@JackyBao 3Q 不过我是在 openwrt 上用,原先一直用 pdnsd 很稳定但是鉴于包太旧了也没更新,15.05 的 op 现在不提供 pdnsd 只有 unbound,虽然 pdnsd 也能运行在 15.05 的 op 上,但是折腾一下更精彩嘛
JackyBao
2017-07-16 23:46:25 +08:00
q0000x
2017-07-17 23:12:26 +08:00
@JackyBao 哈哈,看来你也是个爱折腾的人,这个也玩过了,这个我记得好像没有缓存,每次查询都得和服务器通信,配合 DNSMASQ 的话是可以了
addidd
2017-07-19 17:10:58 +08:00
a86913179
2017-07-20 20:48:55 +08:00
你确定你 dig 加了 TCP ?
a86913179
2017-07-20 20:50:11 +08:00
非 53 端口就没必要强制 TCP 了
hugo007y
2017-07-24 21:35:34 +08:00
我是 dns-forwarder 加 chinadns 加 Dnsmasq

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/375761

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX