-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
希望增加gfw模式,也就是通过geosite_gfw.txt判断使用国内dns还是国外dns #245
Comments
Jio0oiJ
changed the title
希望增加gfw模式,也是是通过geosite_gfw.txt判断使用国内dns还是国外dns
希望增加gfw模式,也就是通过geosite_gfw.txt判断使用国内dns还是国外dns
Aug 27, 2024
你的意图和目的是什么?是否符合 #184
发自我的iPhone
… 在 2024年8月27日,23:00,Jason ***@***.***> 写道:
希望增加gfw模式,也就是通过geosite_gfw.txt判断使用国内dns还是国外dns。
在gfw列表内的使用 fakeip 的dns,其余的使用默认dns,这样能完美的对非gfw域名零干扰。
自己跟着模板改了一个,但是还是希望能由大佬集成进去
log:
level: info
file: "/var/log/mosdns.log"
API 入口设置
api:
http: "0.0.0.0:9091"
include: []
plugins:
GFW
tag: gfw
type: domain_set
args:
files:
- "/var/mosdns/geosite_gfw.txt"
Greylist
tag: greylist
type: domain_set
args:
files:
- "/etc/mosdns/rule/greylist.txt"
缓存
tag: lazy_cache
type: cache
args:
size: 20000
lazy_cache_ttl: 86400
dump_file: "/etc/mosdns/cache.dump"
dump_interval: 600
转发至本地服务器
tag: forward_local
type: forward
args:
upstreams:
- addr: 127.0.0.1:3053
转发至远程服务器
tag: forward_remote
type: forward
args:
upstreams:
- addr: 127.0.0.1:7874
国内解析
tag: local_sequence
type: sequence
args:
exec: $forward_local
国外解析
tag: remote_sequence
type: sequence
args:
exec: prefer_ipv4
exec: $forward_remote
有响应终止返回
tag: has_resp_sequence
type: sequence
args:
matches: has_resp
exec: accept
查询国内域名
tag: query_is_local_domain
type: sequence
args:
exec: $local_sequence
gfw
tag: query_is_gfw
type: sequence
args:
matches: qname $gfw
exec: $remote_sequence
tag: query_is_greylist
type: sequence
args:
matches: qname $greylist
exec: $remote_sequence
主要的运行逻辑插件
sequence 插件中调用的插件 tag 必须在 sequence 前定义,
否则 sequence 找不到对应插件。
tag: main_sequence
type: sequence
args:
- exec: $lazy_cache
- exec: $query_is_gfw
- exec: jump has_resp_sequence
- exec: $query_is_greylist
- exec: jump has_resp_sequence
- exec: $query_is_local_domain
- exec: jump has_resp_sequence
启动 udp 服务器。
tag: udp_server
type: udp_server
args:
entry: main_sequence
listen: ":5335"
启动 tcp 服务器。
tag: tcp_server
type: tcp_server
args:
entry: main_sequence
listen: ":5335"
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
通过gfw列表处理的肯定是和科学相关的,但只是把mosdns当做一个dns分流器,在gfw列表里的用dns1, 其余的用dns2。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
希望增加gfw模式,也就是通过geosite_gfw.txt判断使用国内dns还是国外dns。
在gfw列表内的使用 fakeip 的dns,其余的使用默认dns,这样能完美的对非gfw域名零干扰。
自己跟着模板改了一个,但是还是希望能由大佬集成进去
log:
level: info
file: "/var/log/mosdns.log"
API 入口设置
api:
http: "0.0.0.0:9091"
include: []
plugins:
GFW
type: domain_set
args:
files:
- "/var/mosdns/geosite_gfw.txt"
Greylist
type: domain_set
args:
files:
- "/etc/mosdns/rule/greylist.txt"
缓存
type: cache
args:
size: 20000
lazy_cache_ttl: 86400
dump_file: "/etc/mosdns/cache.dump"
dump_interval: 600
转发至本地服务器
type: forward
args:
upstreams:
- addr: 127.0.0.1:3053
转发至远程服务器
type: forward
args:
upstreams:
- addr: 127.0.0.1:7874
国内解析
type: sequence
args:
国外解析
type: sequence
args:
有响应终止返回
type: sequence
args:
exec: accept
查询国内域名
type: sequence
args:
exec: $local_sequence
gfw
tag: query_is_gfw
type: sequence
args:
exec: $remote_sequence
tag: query_is_greylist
type: sequence
args:
exec: $remote_sequence
主要的运行逻辑插件
sequence 插件中调用的插件 tag 必须在 sequence 前定义,
否则 sequence 找不到对应插件。
type: sequence
args:
- exec: $lazy_cache
启动 udp 服务器。
type: udp_server
args:
entry: main_sequence
listen: ":5335"
启动 tcp 服务器。
type: tcp_server
args:
entry: main_sequence
listen: ":5335"
The text was updated successfully, but these errors were encountered: