clash verge rev 防DNS泄露,个人使用文件

过程:
win11+clash verge rev 1.7.7版
1软件(以下指代clash verge rev 1.7版)中—订阅—全局扩展配置:

# Generated by Clash Verge
dns:
enable: true
ipv6: false
default-nameserver:
- 223.5.5.5
- 223.6.6.6
- 119.29.29.29
nameserver:
- 1.1.1.1
- 8.8.8.8
fallback:
- tls://1.1.1.1:853
- tls://8.8.8.8:853
- https://dns.cloudflare.com/dns-query
- https://dns.google/dns-query
fallback-filter:
 geoip: true
 geoip-code: CN
 ipcidr:
 - 240.0.0.0/4
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
fake-ip-filter:
- '*.lan'
- localhost.ptlogin2.qq.com
- dns.msftncsi.com
- www.msftncsi.com
- www.msftconnecttest.com
- '*.linksys.com'
- '*.linksyssmartwifi.com'
- swscan.apple.com
- mesu.apple.com
- '*.msftconnecttest.com'
- '*.msftncsi.com'
- time.*.com
- time.*.gov
- time.*.edu.cn
- time.*.apple.com
- time1.*.com
- time2.*.com
- time3.*.com
- time4.*.com
- time5.*.com
- time6.*.com
- time7.*.com
- ntp.*.com
- ntp.*.com
- ntp1.*.com
- ntp2.*.com
- ntp3.*.com
- ntp4.*.com
- ntp5.*.com
- ntp6.*.com
- ntp7.*.com
- '*.time.edu.cn'
- '*.ntp.org.cn'
- +.pool.ntp.org
- time1.cloud.tencent.com
- +.music.163.com
- '*.126.net'
- musicapi.taihe.com
- music.taihe.com
- songsearch.kugou.com
- trackercdn.kugou.com
- '*.kuwo.cn'
- api-jooxtt.sanook.com
- api.joox.com
- joox.com
- +.y.qq.com
- +.music.tc.qq.com
- aqqmusic.tc.qq.com
- +.stream.qqmusic.qq.com
- '*.xiami.com'
- +.music.migu.cn
- +.srv.nintendo.net
- +.stun.playstation.net
- xbox.*.microsoft.com
- +.xboxlive.com
- localhost.ptlogin2.qq.com
- proxy.golang.org
- stun.*.*
- stun.*.*.*
- '*.mcdn.bilivideo.cn'
ipv6: false

rule-providers:
googlecn:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/GoogleCNProxyIP.list"
 path: ./ruleset/googlecn.yaml
 interval: 86400
localarea:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/LocalAreaNetwork.list"
 path: ./ruleset/localarea.yaml
 interval:86400
ubans:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/UnBan.list"
 path: ./ruleset/ubans.yaml
 interval: 86400
chinadomains:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/ChinaDomain.list"
 path: ./ruleset/chinadomains.yaml
 interval: 86400
chinamedias:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/ChinaMedia.list"
 path: ./ruleset/chinamedias.yaml
 interval: 86400
banads:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/BanAD.list"
 path: ./ruleset/banads.yaml
 interval: 86400
banprogramads:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/BanProgramAD.list"
 path: ./ruleset/banprogramads.yaml
 interval: 259200
ChinaCompanyips:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/ChinaCompanyIp.list"
 path: ./ruleset/ChinaCompanyips.yaml
 interval: 86400
chinaips:
 type: http
 behavior: domain
 url: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/ChinaIp.list"
 path: ./ruleset/chinaips.yaml
 interval: 86400

第二步:
相关的订阅中右键 扩展脚本;因为每个订阅的分组不一样,所以要手动改,这些这些rules一直处于最顶端,先跑这些,找到了会把下面一些订阅自身带的屏掉

// Define main function (script entry)

const proxyName = "🚀 节点选择";

const directName = "🎯 全球直连";

const rejectName = "🛑 全球拦截";

const louwangName = "🐟 漏网之鱼";

// Define main function (script entry)

function main(config) {

// 读取现有的规则

let oldRules = config.rules;

// 定义新的规则

let newRules = [

"DOMAIN-SUFFIX,xn--ngstr-lra8j.com,"+proxyName,

"DOMAIN-SUFFIX,services.googleapis.cn,"+proxyName,

"DOMAIN,clash.razord.top,"+directName,

"DOMAIN,yacd.haishan.me,"+directName,

"RULE-SET,localarea,"+directName,

"RULE-SET,googlecn,"+proxyName,

"RULE-SET,ubans,"+directName,

"RULE-SET,chinadomains,"+directName,

"RULE-SET,chinamedias,"+directName,

"RULE-SET,banads,"+rejectName,

"RULE-SET,banprogramads,"+rejectName,

"RULE-SET,ChinaCompanyips,"+directName,

"RULE-SET,chinaips,"+directName,

"GEOIP,LAN,"+directName,

"GEOIP,CN,"+directName,

"MATCH,"+louwangName

];

// 将新的规则添加到现有的规则中

oldRules = newRules.concat(oldRules);

// 更新配置的规则

config.rules = oldRules;

// 返回修改后的配置

return config;

}

因为软件升级到1.7版以后, prepend-rules 不能用了,还可以在订阅规则右键—编辑规则----高级,修改后添加如下,跟上面的脚本二选一,因为有些订阅的确不规则,

prepend:
  - 'DOMAIN-SUFFIX,xn--ngstr-lra8j.com,🚀 节点选择'
  - 'DOMAIN-SUFFIX,services.googleapis.cn,🚀 节点选择'
  - 'DOMAIN,clash.razord.top,DIRECT'
  - 'DOMAIN,yacd.haishan.me,DIRECT'
  - 'RULE-SET,localarea,DIRECT'
  - 'RULE-SET,googlecn,🚀 节点选择'
  - 'RULE-SET,ubans,DIRECT'
  - 'RULE-SET,chinadomains,DIRECT'
  - 'RULE-SET,chinamedias,DIRECT'
  - 'RULE-SET,banads,REJECT'
  - 'RULE-SET,banprogramads,REJECT'
  - 'RULE-SET,ChinaCompanyips,DIRECT'
  - 'RULE-SET,chinaips,DIRECT'
  - 'GEOIP,LAN,DIRECT,no-resolve'
  - 'GEOIP,CN,DIRECT,no-resolve'
  - 'MATCH,🚀 节点选择'
append: []
delete:
  - 'RULE-SET,ChinaDomain,DIRECT,no-resolve'
  - 'RULE-SET,ChinaCompanyIp,DIRECT,no-resolve'

第三步:
软件开启TUN模式参考图片中的设置

我最大传输单元设了9000,win11下安装的虚拟网卡有时会经常联不上网,改了后正常了

第四步:

后在软件中 设置—外部控制—并设一个复杂密码

第五步:
windows组策略修改:

第五步:
CHROME要添加WebRTC Leak Shield 防IP泄露

至此,配置完成。

9 个赞

泄露测试

ipleak

dnsleaktest

4 个赞

感谢大佬的配置

感谢大佬的配置教程

佬感谢分享 很细很细 :hugs: :hugs:

macos 版不行吗

这个我不是太懂 :hugs: 不过我觉得毕竟都是基于clash内核,无论什么系统这些规则都适用吧 :grinning: