AdguardTeam / dnsproxy

Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
Apache License 2.0
2.36k stars 245 forks source link

Feature request: Add white list, split upstream dns server in different route #195

Closed ghost closed 2 years ago

ghost commented 2 years ago

This is for CDN special usage.

For example, we know weibo and taobao and douyin is chinese primary hot website. we can put them in whitelist, then these domain can forward to chinese hot dns provider, like 114dns, aliyun dns, tencent dns. to gain better CDN response.

The other any domain , not in the whitelist, can be forward as usual.

ghost commented 2 years ago

example config file

domain_whitelist:
    - upstream: 114.114.114.114
       domain:  
           - taobao.com
           - alibaba.com
           - weibo.com
    - upstream:  208.67.222.222
      domain: 
           - google.com
           - twitter.com

image

Lanius-collaris commented 2 years ago

https://github.com/AdguardTeam/dnsproxy/blob/master/README.md#specifying-upstreams-for-domains 已经有这个功能了,上面的是设置方法。 另外,你说的几个网站用EDNS Client Subnet就能拿到离你比较近的服务器的IP,设置也更简单。可以用quad9,不过建议使用dnscrypt协议,因为中国很多地方路由很诡异,需要用离得比较近的Anonymized DNS relay来减小延迟(不过这不是原先的用途),推荐地点有中国香港、日本、新加坡。dnsproxy似乎不支持Anonymized DNS,dnscrypt-proxy支持Anonymized DNS和EDNS Client Subnet。

ameshkov commented 2 years ago

As @Lanius-collaris said, dnsproxy already provides such a feature.