Skip to content
swoiows edited this page Oct 26, 2022 · 2 revisions
(global_cache) {
    cache {
        # [5, 60]
        success 35536 43200 21600
        # [1, 10]
        denial 4192 3600 1800
        prefetch 512 5m 15%
    }
}


.:53 {
    import global_cache

#    bind 127.0.0.1
    prometheus 0.0.0.0:9153

    cancel 5s
    bufsize 1232
    errors
#    reload
#    loop
#    health

    log . {
        class all
    }

#    log . "{remote} | {type} | {name} | {rcode} | {duration} {>opcode}" {
#        class success error
#    }

    acl {
        filter type PTR net *
    }

    blocked {
        bootstrap_resolvers 

#        reload 30s
        intercept A AAAA HTTPS CNAME
        log
        wildcard
        hostname_query REFUSED

        resp_type NX {
            NX AAAA NS
            REFUSED ANY 
            SOA HTTPS
        }

#        cache_data https://github.com/swoiow/blocked/releases/download/updated/rules.dat
        cache_data /opt/dns/rules.dat

        white_list local+/opt/dns/white.lst.conf

        black_list local+/opt/dns/black.lst.conf
        black_list local+/opt/dns/lol.conf
        black_list local+/opt/dns/ali.conf
        black_list local+/opt/dns/Complete.conf
        black_list local+/opt/dns/privacy.conf
        black_list local+/opt/dns/coredns-block-list.txt
        black_list local+/opt/dns/AdListLite
        black_list local+/home/ubuntu/coredns/rules/v2fly-ads.txt
#        black_list https://github.com/notracking/hosts-blocklists/raw/master/dnscrypt-proxy/dnscrypt-proxy.blacklist.txt

    }

    turned ntp {
        from time.cloudflare.com *.ntp.org time.asia.apple.com time.apple.com time.euro.apple.com time.google.com time.windows.com
        to 223.5.5.5:53 101.101.101.101:53 94.140.14.14:53 119.29.29.29:53

        expire 3s
        # don't health_check
        max_fails 0
        max_concurrent 2
        policy round_robin
    }

    turned apple {
        rules local+/opt/dns/apple.txt
        to 127.0.0.1:5302

        max_fails 0
        prefer_udp
        policy sequential
    }

    turned push {
        from xxx.lan
        to 127.0.0.1:5301 101.101.101.101:53 94.140.14.14:53

        expire 3s
        max_fails 15
        max_concurrent 2
        prefer_udp
        policy sequential
        health_check 900s
    }

    turned inside {
        bootstrap_resolvers

        rules cache+/opt/dns/inside.dat
#        rules cache+https://github.com/swoiow/blocked/releases/download/updated/inside.dat
        rules inside.raw

        to 127.0.0.1:5301
        max_fails 0
        prefer_udp
        max_concurrent 20
        policy sequential
        except google.com
    }

    turned final {
        from .

        to 127.0.0.1:5302
        max_fails 0
        prefer_udp
        max_concurrent 20
        policy sequential
    }
}

Clone this wiki locally

⌂ 换网址