Skip to content

支持指定协议 upstream 和 listen #6

@huihuimoe

Description

@huihuimoe

现在在部分运营商可能会封锁 TCP 53 的 DNS 请求,也有部分 DNS 提供商不支持 TCP Request,比如使用

λ .\freedns-go.exe -f 1.2.4.8:53 -c 127.0.0.1:10053 -l 0.0.0.0:53
λ dig baidu.com @127.0.0.1 +tcp

的时候就会出现 fast dns timeout 的现象,详细 log

time="2020-04-14T18:10:22+08:00" level=info domain=baidu.com. op=update_cache type=A upstream="127.0.0.1:10053"
time="2020-04-14T18:10:22+08:00" level=info domain=baidu.com. op=handle status=NOERROR type=A upstream="127.0.0.1:10053"
time="2020-04-14T18:10:22+08:00" level=error msg="dial tcp 1.2.4.8:53: i/o timeout" domain=baidu.com. op=naive_resolve upstream="1.2.4.8:53"

建议可以指定 upstream 和 listen 的协议类型,譬如指定监听 udp://0.0.0.0:53 ,作为 upstream 的 server 也可以指定譬如 tcp://114.114.114.114:53 和 tcp://8.8.8.8:53

建议调整为

λ .\freedns-go.exe -f udp://1.2.4.8:53 -c tcp://8.8.8.8:53 -l udp://0.0.0.0:53
λ # 监听 udp+tcp
λ .\freedns-go.exe -f udp://1.2.4.8:53 -c tcp://8.8.8.8:53 -l udp+tcp://0.0.0.0:53

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions