mosdns和tpclash实现DNS防泄露和DNS防污染,如果要实现上述两种效果
请使用nameserver修改版
请使用
本地配置版
,想要什么配置只需要修改
/data/clash_config/default_config.yaml
,本人使用为Debian10.
优点:没有openclash和openwrt花里胡哨,省心
缺点:规则需要放在github上,稍微有点麻烦
使用方法:1. 开系统代理,mixed端口7890,socks端口7891。
2. 改路由IP为这个IP,但是
DNS要胡填一个
,否则分流会失败。
2. Web-ui的密码是
tpclash
。
mega
1 2
|
chmod u+x tpclash ./tpclash install
|
1 2
|
systemctl stop tpclash tpclash uninstall
|
1 2 3 4 5 6 7 8
|
重载配置 systemctl daemon-reload 启动 systemctl start tpclash 重启 systemctl restart tpclash 开机自启 systemctl enable tpclash
|
https://github.com/IrineSistiana/mosdns/releases
wiki:
https://irine-sistiana.gitbook.io/mosdns-wiki/mosdns-v5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
cp mosdns /usr/local/bin/
mkdir -p /etc/mosdns/rules touch config.yaml mv config.yaml /etc/mosdns/
touch /etc/mosdns/rules/anti-ad-domains.txt touch /etc/mosdns/rules/cn.txt touch /etc/mosdns/rules/direct-list.txt touch /etc/mosdns/rules/hosts touch /etc/mosdns/rules/custom_for_cndns.txt touch /etc/mosdns/rules/custom_for_worlddns.txt touch /etc/mosdns/rules/ddnslist.txt touch /etc/mosdns/rules/custom_black_list.txt touch /etc/mosdns/rules/custom_for_jp_edns.txt touch /etc/mosdns/rules/custom_for_us_edns.txt
|
1 2 3 4 5 6 7 8
|
sudo tee > /etc/mosdns/rules/update_rules <<'EOF'
mirror_proxy="" mosdns_working_dir="/etc/mosdns" mkdir -p /tmp/mosdns && curl ${mirror_proxy}https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt > /tmp/mosdns/direct-list.txt && curl ${mirror_proxy}https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt > /tmp/mosdns/anti-ad-domains.txt && curl ${mirror_proxy}https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/cn.txt > /tmp/mosdns/cn.txt && \cp -rf /tmp/mosdns/*.txt ${mosdns_working_dir}/rules && rm -rf /tmp/mosdns/* && echo 'update successful' mosdns service restart EOF
|
1 2 3 4 5 6 7
|
systemctl daemon-reload systemctl enable mosdns systemctl start mosdns systemctl restart mosdns systemctl status mosdns journalctl -fu mosdns tail -f /etc/mosdns/mosdns.log
|
Golang 标准
)。e.g:
regexp:.+\.google\.com$
。
匹配方式按如下顺序生效:
full
>
domain
>
regexp
>
keyword
。
domain
和
full
匹配使用 HashMap,复杂度 O(1)。每 1w 域名约占用 1M 内存。
keyword
和
regexp
匹配需遍历,复杂度 O(n)。
PS. tun模式tpclash会自动开启转发
1
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
https://browserleaks.com/dns
https://www.dnsleaktest.com/
https://ipleak.net/
https://www.onedns.net/personal
1 2 3 4 5 6 7
|
IPv4: 52.80.66.66 IPv4: 52.80.66.66 IPv4: 117.50.11.11 (不稳定) DoT: tls: DoT: tls: DoH: https: DoH: https:
|
https://apad.pro/dns-doh/
【境内域名】使用AliDNS本地查询,部分域名使用DNSPod补充查询
【境外域名】使用GoogleDNS与CloudflareDNS通过加密隧道远程查询
无污染、支持EDNS,解析精准度极高,IP分流远程加密查询上游DNS,保护隐私,境外域名拦截垃圾广告,境内域名无拦截,多级DNS缓存,加速全球域名查询响应。
1 2 3 4 5 6 7 8 9 10
|
IPv4: 1.0.0.1 IPv4: 1.1.1.1 DoH: https: DoH: https: DoH: https: DoH: https: DoT: tls: DoT: tls: DoT: tls: DoT: tls:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#推荐:Malware Blocking、DNSSEC Validation(这是最典型的配置) IPv4: 9.9.9.9 IPv4: 149.112.112.112 DoH: https: DoT: tls: DoT: tls:
#使用 ECS 保护:恶意软件阻止、DNSSEC 验证、启用 ECS IPv4: 9.9.9.11 IPv4: 149.112.112.11 DoH: https: DoT: tls: DoT: tls:
#不安全:没有恶意软件阻止,没有 DNSSEC 验证(仅限专家!) IPv4: 9.9.9.10 IPv4: 149.112.112.10 DoH: https: DoT: tls: DoT: tls:
|
1 2 3 4 5
|
IPv4: 208.67.222.222 IPv4: 208.67.220.220 DoH: https: DoH: https: DoT: tls:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#无过滤,不拦截 IPv4: 94.140.14.140 IPv4: 94.140.15.15 DoH: https: DoT: tls: DoQ: quic: #过滤广告和跟踪 IPv4: 94.140.14.14 IPv4: 94.140.15.15 DoH: https: DoT: tls: DoQ: quic: #家庭过滤:开启安全搜索和安全模式选项、拦截成人内容,并且屏蔽广告和跟踪器 IPv4: 94.140.14.15 IPv4: 94.140.15.16 DoH: https: DoT: tls: DoQ: quic:
|
https://irine-sistiana.gitbook.io/mosdns-wiki/mosdns-v5
https://blog.0ne.day/i/mosdns-dns-c-0KfHuTo35/
https://hgl2.com/2023/install-mosdns-in-macos/
https://github.com/Loyalsoldier/v2ray-rules-dat/tree/release
https://github.com/privacy-protection-tools/anti-AD
https://github.com/Loyalsoldier/geoip/tree/release/text
https://github.com/pmkol/easymosdns
https://ip.cn/dns.html
https://www.cccitu.com/2205354.html