hezhijie0327 / GFWList2AGH

Generate diversion list for AdGuard Home and other softwares
228 stars 70 forks source link

软路由adguardhome如何使用? #3

Closed ghost closed 3 years ago

ghost commented 3 years ago

安装在软路由上的 adguardhome 如何使用?

hezhijie0327 commented 3 years ago

可以尝试使用 WinSCP 将 gfwlist2agh_combine.txt 文件存放入相应文件夹,再编辑 adguardhome 根目录下的 AdGuardHome.yaml,将其中的 “upstream_dns_file” 键值更改为存放 gfwlist2agh_combine.txt 文件的路径,如“upstream_dns_file: /opt/adguardhome/conf/gfwlist2agh_combine.txt”。保存后重启 adguardhome 进程。

截图 2020-12-10 17 02 10
hezhijie0327 commented 3 years ago

如果此操作过于繁杂,我稍后可以将针对于 UI 界面版的规则输出到相应文件 (暂定 gfwlist2agh_cnacc_ui.txt / gfwlist2agh_combine_ui.txt / gfwlist2agh_gfwlist_ui.txt)

hezhijie0327 commented 3 years ago

如果此操作过于繁杂,我稍后可以将针对于 UI 界面版的规则输出到相应文件 (暂定 gfwlist2agh_cnacc_ui.txt / gfwlist2agh_combine_ui.txt / gfwlist2agh_gfwlist_ui.txt)

我忘了,当前版本的规则能直接适用于 UI 界面,您可以直接将其复制并粘贴进 “上游 DNS 服务器” 中

截图 2020-12-10 17 10 03
ghost commented 3 years ago

感谢,刚接触这个不太懂。

现在的问题是,我上游的dns是Google的,导致国内的域名很多都解析成了香港的IP,网页打开很慢,使用 gfwlist2agh_combine.txt 这个文件可以解决嘛?

ghost commented 3 years ago

如果此操作过于繁杂,我稍后可以将针对于 UI 界面版的规则输出到相应文件 (暂定 gfwlist2agh_cnacc_ui.txt / gfwlist2agh_combine_ui.txt / gfwlist2agh_gfwlist_ui.txt)

我忘了,当前版本的规则能直接适用于 UI 界面,您可以直接将其复制并粘贴进 “上游 DNS 服务器” 中

截图 2020-12-10 17 10 03

嗯嗯,刚刚看了您这个文章了 https://www.zhijie.online/resources/personal_projects/GFWList2AGH/page.html

hezhijie0327 commented 3 years ago

目前我用下来的体验来讲,能解决大部分问题,如果在体验中出现有什么网站误被判定使用 gfwlist_dns(Google / OpenDNS) 的话可以提出 issues,我可以将其添加进白名单。

ghost commented 3 years ago

image 这三个有啥区别?

hezhijie0327 commented 3 years ago

可以理解为 白名单模式 / 黑名单模式 / 混合模式(修正黑名单中可能存在的白名单规则,如:||googleapis.com 和 ||fonts.googleapis.com,fonts.googleapis.com 在国内有 CDN,则应走国内 DNS 而不是使用 国外 DNS 进行解析)

hezhijie0327 commented 3 years ago

combine 更适合日常使用,规则比较全面

ghost commented 3 years ago

可以理解为 白名单模式 / 黑名单模式 / 混合模式(修正黑名单中可能存在的白名单规则,如:||googleapis.com 和 ||fonts.googleapis.com,fonts.googleapis.com 在国内有 CDN,则应走国内 DNS 而不是使用 国外 DNS 进行解析)

那这个分流是怎么走的呢?

hezhijie0327 commented 3 years ago

a. 开启 “并行查询” 并以 gfwlist2agh_combine.txt 为例:

  1. 当域名规则在 gfwlist 但不在 cnacc 中时,则走 https://doh.opendns.com:443/dns-query 和 tls://dns.google:853 进行查询(如:googleapis.com)
  2. 当域名规则在 gfwlist 但其子域名在 cnacc 中时,则走 tls://dns.alidns.com:853 和 tls://dns.pub:853 进行查询(如:fonts.googleapis.com)
  3. 当域名规则不在 gfwlist 但在 cnacc 中时,则走 tls://dns.alidns.com:853 和 tls://dns.pub:853 进行查询(如:www.baidu.com)
  4. 当域名规则不在 gfwlist 也不在 cnacc 中时,则走 https://dns.alidns.com:443/dns-queryhttps://dns.pub:443/dns-query 进行查询(如:www.zhijie.online)

b. 开启 “并行查询” 并以 gfwlist2agh_cnacc.txt 为例:

  1. 当域名规则在 cnacc 中时,则走 tls://dns.alidns.com:853 和 tls://dns.pub:853 进行查询
  2. 当域名规则不在 cnacc 中时,则走 https://doh.opendns.com:443/dns-query 和 tls://dns.google:853 进行查询

c. 开启 “并行查询” 并以 gfwlist2agh_gfwlist.txt 为例:

  1. 当域名规则在 gfwlist 中时,则走 https://doh.opendns.com:443/dns-query 和 tls://dns.google:853 进行查询
  2. 当域名规则不在 gfwlist 中时,则走 tls://dns.alidns.com:853 和 tls://dns.pub:853 进行查询
ghost commented 3 years ago

@hezhijie0327 imagezhe那这两个是干啥的

hezhijie0327 commented 3 years ago
  1. 当域名规则不在 gfwlist 也不在 cnacc 中时,则走 https://dns.alidns.com:443/dns-queryhttps://dns.pub:443/dns-query 进行查询(如:www.zhijie.online)
ghost commented 3 years ago

腾讯的 dot 官网 改了

hezhijie0327 commented 3 years ago

虽然目前看来 dns.pub 和 doh.pub 指向的服务器地址为同一个,但现本项目中 DoH 及 DoT 地址均已更改为 doh.pub

截图 2020-12-10 22 27 51 截图 2020-12-10 22 28 25
ghost commented 3 years ago

issue 其实可以不用关,也许有人跟我一样呢,不懂用。这个还是挺好的,用了这几天下来,体验挺好👍

hezhijie0327 commented 3 years ago

好,我将此 issue 置顶😊

1379 commented 3 years ago

@hezhijie0327 感谢作者的贡献!使用体验非常nice👍。不过现在的目录和文件命名好像变了, image 这些都是什么意思,我应该使用哪个呢🤣

hezhijie0327 commented 3 years ago
  1. 通常来讲非特殊需求,使用 blacklist_full.txt 即可
  2. *_lite.txt 仅精确到二级域名(example.org
tty228 commented 2 years ago

做了一个简陋的分流管理 luci 上传格式限制,请解压

luci-app-adguardhome_1.91-11_all.zip

4thanks commented 2 years ago

做了一个简陋的分流管理 luci 上传格式限制,请解压 luci-app-adguardhome_1.9-11_all.zip

@tty228 可以考虑一下smartdns分流管理 luci?直接套用一下这个简陋模块也就够了