Comments (8)
IP地址列表体积会不小的,占用空间会很多,对于CGN网络下,IP地址列表可能无效,没有判断的途径。
这样做的原因是什么?检测耗时,耗CPU?
from smartdns.
IP地址列表也可以在程序安装的时候或者运行的时候动态下载。只是觉得本地判断下总应该比实际测速要来得快,SmartDNS的目的不就是为了极致的速度么。这功能可以在配置文件里加开关的,由用户自己决定是否开启。CGN网络如果不适用就在配置文件里禁用就好了。
from smartdns.
我想了一下,对于你说的这个方案,没有特别好的办法。
IP地址库不容易处理,并且后面IPV6的话,基本就不可行了。即使下载也会占用很大的存储空间。
还有,现在大部分用户其实都是CGN网络了,如果大部分用户都不用这功能的话,价值就不是很大了。
所以,目前暂不考虑你的这个建议。
如果是为了DNS解析速度的话,可以强制将TTL调大,这样smartdns就会一直缓存。查询的时候,直接内存返回结果了。
from smartdns.
好吧,我也只是个脑洞给个建议,不好使就算了吧
from smartdns.
#!/bin/sh
#借用koolshare的国内IP库
curl 'https://raw.githubusercontent.com/koolshare/ledesoft/master/policy/policy/policy/telecom.txt' |grep -v "routes" > /etc/routeIP/telecom.txt
curl 'https://raw.githubusercontent.com/koolshare/ledesoft/master/policy/policy/policy/unicom.txt' |grep -v "routes" > /etc/routeIP/unicom.txt
curl 'https://raw.githubusercontent.com/koolshare/ledesoft/master/policy/policy/policy/mobile.txt' |grep -v "routes" > /etc/routeIP/mobile.txt
curl 'https://raw.githubusercontent.com/koolshare/ledesoft/master/policy/policy/policy/chnroute.txt' |grep -v "routes" > /etc/routeIP/chnroute.txt
#以下分别把下载好的运营商IP集写入到ipset,对应ipset名称为 chnroute/telecom/mobile和unicom,可自行修改
##电信IP
ROUTES=/etc/routeIP/telecom.txt
ipset flush telecom
ipset -N telecom nethash
for network in cat $ROUTES
; do
ipset -A telecom $network
done
##移动IP
ROUTES=/etc/routeIP/mobile.txt
ipset flush mobile
ipset -N mobile nethash
for network in cat $ROUTES
; do
ipset -A mobile $network
done
##联通IP
ROUTES=/etc/routeIP/unicom.txt
ipset flush unicom
ipset -N unicom nethash
for network in cat $ROUTES
; do
ipset -A unicom $network
done
##国内IP
ROUTES=/etc/routeIP/chnroute.txt
ipset flush chnroute
ipset -N chnroute nethash
for network in cat $ROUTES
; do
ipset -A chnroute $network
done
from smartdns.
得到的ipset可以用到负载均衡插件的规则里
from smartdns.
@fonlan
Release 18优化了响应时间,在测速的情况下也能保证响应时效。
可以获取验证。
Release 18也新增了ipset的支持,有需要可以使用。
from smartdns.
好的,已更新
from smartdns.
Related Issues (20)
- 文件权限被改变 HOT 8
- ttl 的默认值不正常 HOT 19
- 测试发现强解析存在bug HOT 3
- 无法获取新域名的 HOT 18
- 【正则匹配】域名规则有没有可能支持正则配置?
- doh支持使用特定token限制访问
- 用户日志能否支持功能调用IP识别运营商接口nali或者纯真qqwry.dat库支持日志展示
- 定义了组名的服务器没有从默认组中排除 HOT 1
- 使用代理地址报错 HOT 4
- domain-set 能否增加实时监听 -file 文件变动,实现不需要重启服务即可添加新的域名?
- 给上游服务器组设置备用上游
- nameserver 规则对私有IPv4地址的PTR记录无效
- 能做到根据ipv4返回的地址,选择上游服务器并返回结果么(即根据ip分流) HOT 15
- SmartDNS是否可以支持多节点之间的配置同步?或者提供对应API&Cli? HOT 2
- `sendto fdbd:dc01:fe:1009::1, id 217, Permission denied` HOT 18
- 广告屏蔽 HOT 9
- 关于DNS缓存的一些问题 HOT 9
- 能否提供单独关闭DNS64的按钮或者指令,仅限制v6访问v6,v4访问v4,部分程序不支持转换访问 HOT 1
- 目前看文档提供给用户侧支持DoT、DoH还有H3 和 DoQ目前暂不支持,想咨询一下如何验证 HOT 1
- multiple server entries, what order? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartdns.