V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
q0000x
V2EX  ›  DNS

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

  •  
  •   q0000x · 2017-07-16 21:25:44 +08:00 · 6574 次点击
    这是一个创建于 2466 天前的主题,其中的信息可能已经有所发展或是发生改变。
    下面这个是 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
    8 条回复    2017-07-24 21:35:34 +08:00
    JackyBao
        1
    JackyBao  
       2017-07-16 23:22:56 +08:00
    要不来试试我的方案?
    https://github.com/aa65535/hev-dns-forwarder
    q0000x
        2
    q0000x  
    OP
       2017-07-16 23:33:45 +08:00
    @JackyBao 3Q 不过我是在 openwrt 上用,原先一直用 pdnsd 很稳定但是鉴于包太旧了也没更新,15.05 的 op 现在不提供 pdnsd 只有 unbound,虽然 pdnsd 也能运行在 15.05 的 op 上,但是折腾一下更精彩嘛
    JackyBao
        3
    JackyBao  
       2017-07-16 23:46:25 +08:00 via Android
    q0000x
        4
    q0000x  
    OP
       2017-07-17 23:12:26 +08:00
    @JackyBao 哈哈,看来你也是个爱折腾的人,这个也玩过了,这个我记得好像没有缓存,每次查询都得和服务器通信,配合 DNSMASQ 的话是可以了
    addidd
        5
    addidd  
       2017-07-19 17:10:58 +08:00 via Android
    a86913179
        6
    a86913179  
       2017-07-20 20:48:55 +08:00
    你确定你 dig 加了 TCP ?
    a86913179
        7
    a86913179  
       2017-07-20 20:50:11 +08:00
    非 53 端口就没必要强制 TCP 了
    hugo007y
        8
    hugo007y  
       2017-07-24 21:35:34 +08:00
    我是 dns-forwarder 加 chinadns 加 Dnsmasq
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1317 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:30 · PVG 07:30 · LAX 16:30 · JFK 19:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.