[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 如何配置bind转发查询时使用tcp而不是udp



2013/1/4 周威 <zhouwei@choury.com>:
>       大家都知道的,在tc有些网站是没法上的,但是其中有的网站还不得不上,因为
> 我现在在学校,有ipv6,所以暂时只要知道ip地址还是可以上大部分网站 的。可是现
> 在问题是dns被污染,使用udp查询总是得不到正确的ip地址,而用tcp的话得到的结
> 果就是对的,所以我想给我们小组服务器上的 bind配置一下,让它转发查询的时候
> 强制使用tcp而不是udp,请问大家怎么配置,或者有什么好的解决方案?

unbound 可以使用"tcp-upstream: yes":

# The server clause sets the main parameters.
server:
        # verbosity number, 0 is least verbose. 1 is default.
        verbosity: 1
        use-syslog: yes

        # /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key
        # dig netbsd.org. SOA +dnssec @8.8.8.8
        auto-trust-anchor-file: "/var/lib/unbound/root.key"

        interface: 0.0.0.0
        #interface: ::0

        outgoing-interface: 0.0.0.0
        #outgoing-interface: ::0

        # number of outgoing simultaneous tcp buffers to hold per thread.
        outgoing-num-tcp: 10

        do-ip6: yes
        do-ip4: yes
        do-udp: yes
        do-tcp: yes

        tcp-upstream: yes

        access-control: 127.0.0.0/8 allow
        access-control: 10.0.0.0/8 allow
        access-control: 172.16.0.0/12 allow
        access-control: 192.168.0.0/16 allow
forward-zone:
        name: "."
        forward-addr: 8.8.8.8          # Google Public DNS
        forward-addr: 8.8.4.4          # Google Public DNS
        #forward-addr: 208.67.222.222   # OpenDNS.com
        #forward-addr: 208.67.220.220   # OpenDNS.com
        #forward-addr: 199.91.73.222    # V2EX DNS
        #forward-addr: 178.79.131.110   # V2EX DNS

remote-control:
        control-enable: no

Reply to: