Skip to content
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

规则中使用 GEOSITE:google-cn 报错 #689

Closed
pounod opened this issue Aug 12, 2023 · 8 comments
Closed

规则中使用 GEOSITE:google-cn 报错 #689

pounod opened this issue Aug 12, 2023 · 8 comments

Comments

@pounod
Copy link

pounod commented Aug 12, 2023

rules:
...
  - GEOSITE:google-cn,DIRECT
...

配置文件中包含"GEOSITE:google-cn"规则时,加载配置文件报错,提示不支持。

geosite-ymal-clash

检查 geosite.dat 文件,发现包含 google-cn 域名列表。

这个问题该如何解决?

@pounod pounod changed the title 规则中使用 GEOSITE:google-cn 无法使用 规则中使用 GEOSITE:google-cn 报错 Aug 12, 2023
@13wenwen
Copy link

单独弄一个google中国的rule-set不就完事了。

@QIN2DIM
Copy link

QIN2DIM commented Aug 12, 2023

多了一个冒号,改成:

rules:
  - GEOSITE,google-cn,DIRECT

@pounod
Copy link
Author

pounod commented Aug 12, 2023

多了一个冒号,改成:

rules:
  - GEOSITE,google-cn,DIRECT

感谢,确实我语法有问题,冒号改成逗号,加载不再报错了。不过有新错误日志:

127.0.0.1:59087 --> fonts.googleapis.com:443 error: dns resolve failed: couldn't find ip
2023/08/12 09:55:34.584 [info] [TCP] 127.0.0.1:59121 --> fonts.gstatic.com:443 match GeoSite(google-cn) using DIRECT

我用的这个配置模版:https://clash-meta.wiki/example/#_2
是不是配置文件还要修改完善?

@pounod
Copy link
Author

pounod commented Aug 12, 2023

自己尝试了下不再报错了,把 google-cn 加入下面的规则中:
就是不知道会不会有其它的问题。

nameserver-policy:
"geosite:cn,google-cn,private":

@Skyxim
Copy link
Collaborator

Skyxim commented Aug 12, 2023

@pounod 一切以文档为准,没写就是不能这样做

@pounod
Copy link
Author

pounod commented Aug 12, 2023

自己尝试了下不再报错了,把 google-cn 加入下面的规则中: 就是不知道会不会有其它的问题。

nameserver-policy: "geosite:cn,google-cn,private":

@Skyxim 不能这样添加是吧?那要放弃 google-cn 规则?你是如何处理的?用2楼的 rule-set ?
google-cn 列表中的域名走代理,页面加载速度明显慢很多,例如 fonts.gstatic.com、fonts.googleapis.com 这些。

@QIN2DIM
Copy link

QIN2DIM commented Aug 12, 2023

@pounod 访问这些资源全走代理就好,速度慢是你的代理不行……

其次,在正确配置 DNS 的前提下,直连访问不会报错。你没有找到 IP 可能的原因是 DNS 污染,建议使用 DOH(或h3) 或 QUIC 解析域名。

23-08-12 21:22:03[ info ][TCP] 127.0.0.1:11835(msedge.exe) --> fonts.gstatic.com:443 match GeoSite(google-cn) using DIRECT
23-08-12 21:22:03[ info ][TCP] 127.0.0.1:11836(msedge.exe) --> fonts.gstatic.com:443 match GeoSite(google-cn) using DIRECT
23-08-12 21:22:03[ debug ][DNS] fonts.gstatic.com --> [203.208.41.34], from https://223.5.5.5:443/dns-query
23-08-12 21:22:03[ debug ][DNS] resolve fonts.gstatic.com from https://223.5.5.5:443/dns-query

如果你决定要直连访问,推荐使用如下配置:
在这个策略流向中,最终使用 阿里的 DOH 解析 geosite:google-cn 域名,可以有效避免裸连的污染和劫持。

dns:
  enable: true
  prefer-h3: true
  nameserver:
    - https://dns.google/dns-query#PROXY
    - https://security.cloudflare-dns.com/dns-query#PROXY
    - quic://dns.adguard-dns.com
  proxy-server-nameserver:
    - https://223.5.5.5/dns-query
  nameserver-policy:
    geosite:cn:
      - https://223.5.5.5/dns-query#h3=true
rules:
  - GEOSITE,google-cn,DIRECT # For your demand
  - GEOSITE,category-scholar-!cn,PROXY
  - GEOSITE,category-ads-all,REJECT
  - GEOSITE,youtube,PROXY
  - GEOSITE,google,PROXY
  - GEOSITE,cn,DIRECT
  - GEOSITE,private,DIRECT
  - GEOSITE,steam@cn,DIRECT
  - GEOSITE,category-games@cn,DIRECT
  - GEOSITE,geolocation-!cn,PROXY
  - GEOIP,private,DIRECT,no-resolve
  - GEOIP,telegram,PROXY
  - GEOIP,CN,DIRECT
  - DST-PORT,80/8080/443/8443,PROXY
  - MATCH,DIRECT

@pounod
Copy link
Author

pounod commented Aug 12, 2023

@QIN2DIM 非常感谢大佬的耐心指导,我将配置文件按照上面做了修改,目前没有报错信息了。

@pounod pounod closed this as completed Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants