swordspoet

可防止 DNS 泄露的覆写脚本

  •  1
     
  •   swordspoet · Feb 19, 2025 · 1654 views
    This topic created in 534 days ago, the information mentioned may be changed or developed.

    yyhhyy 大佬的基础上新增了 DNS 分流的策略,自测可防止 DNS 泄露。

    覆写脚本: https://pastebin.com/raw/75gppEaa

    // 覆写 DNS
    function overwriteDns (params) {
        const proxyDnsList = [
            "https://1.1.1.1/dns-query",
            "https://doh.dns.sb/dns-query"
        ];
    
        const dnsList = [
            "https://dns.alidns.com/dns-query",
            "https://doh.pub/dns-query"
        ];
    
        const dnsOptions = {
            enable: true,
            ipv6: true,
            "prefer-h3": true, // 如果 DNS 服务器支持 DoH3 会优先使用 h3
            "respect-rules": true, // 仅对符合规则的请求使用 DNS
            "enhanced-mode": "fake-ip", // 伪装 IP
            "fake-ip-range": "28.0.0.1/8",
            "direct-nameserver": dnsList,  // 直连策略的 DNS
            nameserver: proxyDnsList, // 其余请求都走海外 DNS ,避免 DNS 泄露
            "proxy-server-nameserver": dnsList, // 代理服务器的 DNS
        };
        params.dns = { ...dnsOptions };
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2935 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 06:27 · PVG 14:27 · LAX 23:27 · JFK 02:27
    ♥ Do have faith in what you're doing.