Add Edns client subnet
This commit is contained in:
41
docs/config/edns-client-subnet.md
Normal file
41
docs/config/edns-client-subnet.md
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# EDNS客户端子网
|
||||
|
||||
SmartDNS提供了设置`edns-client-subnet`的能力,edns-client-subnet原本功能是用于上游DNS服务器之间的一个扩展通信协议。一般情况下本地DNS无需配置。
|
||||
|
||||
但SmartDNS提供了测速和通过代理查询的能力,在下面的场景下,则可设置edns-client-subnet优化网络查询结果:
|
||||
|
||||
## 跨运营商的IP优化
|
||||
|
||||
运营商的DNS服务器都是将自己网络的网站或CDN服务器IP给客户端,比如qq.com,用联通的DNS,查询的就是联通网段的IP,你用电信的,查询的就是电信网段的IP。运营商一般不会给你跨网IP。除非某个网站就只有在某个运营商的网络。但某些网站,运营商自己网络的ip可能要跨好几个省,时延比较大,不如同省跨运营商去访问。这时可以通过edns-client-subnet能力,查询到一个异网的IP,然后再让smartdns测速后,返回时延较小的IP给客户端。
|
||||
|
||||
### 配置
|
||||
|
||||
假设你的宽带是广东联通。那么你可以配置如下:
|
||||
|
||||
```shell
|
||||
server 8.8.8.8 -subnet [广东电信IP]
|
||||
```
|
||||
|
||||
这样8.8.8.8就会返回网站为广东电信网段的IP地址,smartdns会根据测速结果返回IP给客户端。
|
||||
-subnet ipv4,和ipv6都配置。
|
||||
|
||||
网段信息[http://ipcn.chacuo.net/](http://ipcn.chacuo.net)
|
||||
|
||||
## 通过代理查询
|
||||
|
||||
当smartdns通过代理查询时,对应的查询结果是根据代理服务器出口优化的查询结果,如果想要通过代理查询的结果和本地运营商优化,则可以通过配置edns-client-subnet来优化。
|
||||
|
||||
### 配置
|
||||
|
||||
假设广东电信的用户通过北京的代理查询DNS,那么可以配置如下
|
||||
|
||||
```shell
|
||||
server 8.8.8.8 -proxy beijing -subnet [广东电信IP]
|
||||
```
|
||||
|
||||
这样即使通过北京代理到8.8.8.8查询结果,但因为指定了客户端子网为广东电信IP,那么8.8.8.8就会范围合适广东电信网络的IP地址。
|
||||
@@ -116,6 +116,14 @@ SmartDNS在早期版本,只会返回一个IP地址,这一个IP地址速度
|
||||
|
||||
值得注意的是,上述机制,是在开启了缓存的情况下,如果缓存未开启,则仍然返回最快的一个地址。
|
||||
|
||||
## DDNS处理
|
||||
|
||||
SMARTDNS默认启用了过期缓存,当使用DDNS时,有可能造成IP地址变化后,访问失败的情况下,可以通过如下方式,关闭对应DDNS域名的过期缓存。
|
||||
|
||||
```shell
|
||||
domain-rules /ddns.com/ --no-serve-expired
|
||||
```
|
||||
|
||||
## 更多问题
|
||||
|
||||
如有更多问题,请查阅或提交issue: [https://github.com/pymumu/smartdns/issues](https://github.com/pymumu/smartdns/issues)
|
||||
36
en/docs/config/edns-client-subnet.md
Normal file
36
en/docs/config/edns-client-subnet.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# EDNS Client Subnet
|
||||
|
||||
SmartDNS provides the ability to configure edns-client-subnet for speed testing and proxy queries. In the following scenarios, you can configure edns-client-subnet to optimize network query results:
|
||||
|
||||
## IP optimization across carriers
|
||||
|
||||
Carrier DNS servers typically provide the IP addresses of their own network or CDN servers to clients. For example, when querying example.com using the local carrier DNS, the result is the IP address of the local carrier network, Carriers typically do not provide IP addresses across carriers unless a website is only available on a specific carrier network. However, some websites may require IP addresses that cross multiple provinces, resulting in significant delay compared to accessing the same website across carriers within the same province. In this case, you can use the edns-client-subnet feature to query an IP address across an external network, and then configure SmartDNS to return a smaller, more efficient IP address to the client.
|
||||
|
||||
### Configuration
|
||||
|
||||
Assume your broadband is provided by China Unicom, You want query IP from China Telecom and test speed, You can configure edns-client-subnet as follows:
|
||||
|
||||
```shell
|
||||
server 8.8.8.8 -subnet [China Telecom IP]
|
||||
```
|
||||
|
||||
This will return the IP address of the China Telecom IP network to the client, and SmartDNS will return the IP address to the client based on the speed testing results. You can also configure the -subnet parameter to be an IPv4 or IPv6 address to configure the client subnet.
|
||||
|
||||
## Through the proxy query
|
||||
|
||||
When SmartDNS queries the proxy, the corresponding query results are optimized based on the proxy server's IP. If you want to optimize the results of the proxy query and the local carrier, you can configure edns-client-subnet to optimize the results.
|
||||
|
||||
### Configuration
|
||||
|
||||
Assume China Telecom users query DNS through a Beijing proxy. You can configure edns-client-subnet as follows:
|
||||
|
||||
```shell
|
||||
server 8.8.8.8 -proxy beijing -subnet [China Telecom IP]
|
||||
```
|
||||
|
||||
This will query the IP address of the China Telecom network through the Beijing proxy, but since the client subnet is configured as the China Telecom IP, the IP address returned by 8.8.8.8 will be the IP address of the China Telecom network.
|
||||
@@ -97,6 +97,7 @@ nav:
|
||||
- DNS64: 'config/dns64.md'
|
||||
- IP Rule: 'config/ip-rule.md'
|
||||
- Forwarding with IPSet: 'config/forwarding-with-ipset.md'
|
||||
- Edns Client Subnet: 'config/edns-client-subnet.md'
|
||||
- Configurations: 'configuration.md'
|
||||
- Compile: 'compile.md'
|
||||
- FAQ: 'faq.md'
|
||||
|
||||
@@ -97,6 +97,7 @@ nav:
|
||||
- DNS64: 'config/dns64.md'
|
||||
- IP规则: 'config/ip-rule.md'
|
||||
- 白名单分流请求: 'config/forwarding-with-ipset.md'
|
||||
- EDNS客户端子网: 'config/edns-client-subnet.md'
|
||||
- 配置选项: 'configuration.md'
|
||||
- 编译: 'compile.md'
|
||||
- 常见问题: 'faq.md'
|
||||
|
||||
Reference in New Issue
Block a user