Skip to content

Instantly share code, notes, and snippets.

@missdeer
Last active April 4, 2025 04:15
Show Gist options
  • Save missdeer/5c7c82b5b67f8afb41cfd43d51b82c2d to your computer and use it in GitHub Desktop.
Save missdeer/5c7c82b5b67f8afb41cfd43d51b82c2d to your computer and use it in GitHub Desktop.

Revisions

  1. missdeer revised this gist Feb 6, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ echo "remember to change 192.168.1.1 to your ISP's DNS server address or use pub
    china=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    bogus=`curl -sSL https://raw.githubusercontent.comm/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    bogus=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    cat>Corefile<<EOF
    . {
    # comment below lines to disable ads plugin
  2. missdeer revised this gist Aug 8, 2023. 1 changed file with 15 additions and 15 deletions.
    30 changes: 15 additions & 15 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,26 @@
    #!/bin/sh
    echo 'use "curl -sSL git.io/corefile | bash" to update Corefile'
    echo "remember to change 192.168.1.1 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly"
    china=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/google.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    bogus=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    china=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -sSL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    bogus=`curl -sSL https://raw.githubusercontent.comm/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    cat>Corefile<<EOF
    . {
    # comment below lines to disable ads plugin
    ads {
    blacklist https://anti-ad.net/domains.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardMobileAds.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardMobileSpyware.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardTracking.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAMEAds.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAMEClickthroughs.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAMEMicrosites.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAME.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardDNS.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/EasyPrivacyCNAME.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/EasyPrivacySpecific.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/EasyPrivacy3rdParty.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardMobileAds.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardMobileSpyware.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardTracking.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardCNAMEAds.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardCNAMEClickthroughs.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardCNAMEMicrosites.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardCNAME.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/AdguardDNS.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/EasyPrivacyCNAME.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/EasyPrivacySpecific.txt
    blacklist https://raw.githubusercontent.com/missdeer/blocklist/master/convert/EasyPrivacy3rdParty.txt
    nxdomain
    log
    auto-update-interval 24h
  3. missdeer revised this gist Aug 1, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ cat>Corefile<<EOF
    forward . 127.0.0.1:5300 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 127.0.0.1:5304 {
    except $china $apple $google dns.quad9.net cloudflare-dns.com dns.google dns.opendns.com
    }
    proxy . 192.168.1.1
    proxy . 119.29.29.29 223.5.5.5
    bogus $bogus
    log
    cache
  4. missdeer revised this gist Jul 27, 2023. 1 changed file with 19 additions and 9 deletions.
    28 changes: 19 additions & 9 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -7,15 +7,25 @@ google=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/g
    bogus=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    cat>Corefile<<EOF
    . {
    # uncomment below lines to enable ads plugin
    #ads {
    # default-lists
    # blacklist https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt
    # whitelist https://files.krnl.eu/whitelist.txt
    # log
    # auto-update-interval 24h
    # list-store ads-cache
    #}
    # comment below lines to disable ads plugin
    ads {
    blacklist https://anti-ad.net/domains.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardMobileAds.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardMobileSpyware.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardTracking.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAMEAds.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAMEClickthroughs.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAMEMicrosites.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardCNAME.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/AdguardDNS.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/EasyPrivacyCNAME.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/EasyPrivacySpecific.txt
    blacklist https://cdn.jsdelivr.net/gh/missdeer/blocklist@master/convert/EasyPrivacy3rdParty.txt
    nxdomain
    log
    auto-update-interval 24h
    list-store ads-cache
    }
    hosts {
    fallthrough
    }
  5. missdeer revised this gist Jul 8, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ cat>Corefile<<EOF
    }
    # choose your favourite DNS servers below
    forward . 127.0.0.1:5300 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 127.0.0.1:5304 {
    except $china $apple $google dns.quad9.net cloudflare-dns.com dns.google
    except $china $apple $google dns.quad9.net cloudflare-dns.com dns.google dns.opendns.com
    }
    proxy . 192.168.1.1
    bogus $bogus
  6. missdeer revised this gist Jul 8, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/bin/bash
    #!/bin/sh
    echo 'use "curl -sSL git.io/corefile | bash" to update Corefile'
    echo "remember to change 192.168.1.1 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly"
    china=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
  7. missdeer revised this gist Jun 17, 2022. 1 changed file with 0 additions and 8 deletions.
    8 changes: 0 additions & 8 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -66,12 +66,4 @@ cat>Corefile<<EOF
    }
    cache
    }
    .:5304 {
    bind 127.0.0.1
    forward . 4.2.2.1 4.2.2.2 {
    force_tcp
    health_check 60s
    }
    cache
    }
    EOF
  8. missdeer revised this gist Jun 17, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -36,8 +36,8 @@ cat>Corefile<<EOF
    }
    .:5300 {
    bind 127.0.0.1
    forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 {
    force_tcp
    forward . tls://208.67.222.222 tls://208.67.220.220 {
    tls_servername dns.opendns.com
    health_check 60s
    }
    cache
  9. missdeer revised this gist Jun 14, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ cat>Corefile<<EOF
    }
    # choose your favourite DNS servers below
    forward . 127.0.0.1:5300 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 127.0.0.1:5304 {
    except $china $apple $google cdn.jsdelivr.net dns.quad9.net cloudflare-dns.com dns.google
    except $china $apple $google dns.quad9.net cloudflare-dns.com dns.google
    }
    proxy . 192.168.1.1
    bogus $bogus
  10. missdeer revised this gist May 18, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    echo "use `curl -sSL git.io/corefile | bash` to update Corefile"
    echo 'use "curl -sSL git.io/corefile | bash" to update Corefile'
    echo "remember to change 192.168.1.1 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly"
    china=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
  11. missdeer revised this gist May 2, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    echo "use `curl -sSL https://gist.github.com/missdeer/5c7c82b5b67f8afb41cfd43d51b82c2d/raw/gen_Corefile.sh | bash` to update Corefile"
    echo "use `curl -sSL git.io/corefile | bash` to update Corefile"
    echo "remember to change 192.168.1.1 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly"
    china=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
  12. missdeer revised this gist Apr 28, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    #!/bin/bash
    echo "use `curl -sSL https://gist.github.com/missdeer/5c7c82b5b67f8afb41cfd43d51b82c2d/raw/gen_Corefile.sh | bash` to update Corefile"
    echo "remember to change 192.168.1.1 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly"
    china=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/google.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
  13. missdeer revised this gist Apr 28, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/bin/bash
    echo "use `curl -sSL https://gist.github.com/missdeer/5c7c82b5b67f8afb41cfd43d51b82c2d/raw/gen_Corefile.sh | bash` to update Corefile"
    china=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/google.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
  14. missdeer revised this gist Dec 31, 2020. 1 changed file with 18 additions and 3 deletions.
    21 changes: 18 additions & 3 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -17,8 +17,9 @@ cat>Corefile<<EOF
    hosts {
    fallthrough
    }
    forward . 127.0.0.1:5300 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {
    except $china $apple $google cdn.jsdelivr.net dns.quad9.net cloudflare-dns.com dns.google
    # choose your favourite DNS servers below
    forward . 127.0.0.1:5300 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 127.0.0.1:5304 {
    except $china $apple $google cdn.jsdelivr.net dns.quad9.net cloudflare-dns.com dns.google
    }
    proxy . 192.168.1.1
    bogus $bogus
    @@ -33,27 +34,41 @@ cat>Corefile<<EOF
    }
    .:5300 {
    bind 127.0.0.1
    forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353
    forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 {
    force_tcp
    health_check 60s
    }
    cache
    }
    .:5301 {
    bind 127.0.0.1
    forward . tls://9.9.9.9 tls://9.9.9.10 {
    tls_servername dns.quad9.net
    health_check 60s
    }
    cache
    }
    .:5302 {
    bind 127.0.0.1
    forward . tls://1.1.1.1 tls://1.0.0.1 {
    tls_servername cloudflare-dns.com
    health_check 60s
    }
    cache
    }
    .:5303 {
    bind 127.0.0.1
    forward . tls://8.8.8.8 tls://8.8.4.4 {
    tls_servername dns.google
    health_check 60s
    }
    cache
    }
    .:5304 {
    bind 127.0.0.1
    forward . 4.2.2.1 4.2.2.2 {
    force_tcp
    health_check 60s
    }
    cache
    }
  15. missdeer revised this gist Dec 31, 2020. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -5,14 +5,15 @@ google=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/g
    bogus=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    cat>Corefile<<EOF
    . {
    ads {
    default-lists
    blacklist https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt
    whitelist https://files.krnl.eu/whitelist.txt
    log
    auto-update-interval 24h
    list-store ads-cache
    }
    # uncomment below lines to enable ads plugin
    #ads {
    # default-lists
    # blacklist https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt
    # whitelist https://files.krnl.eu/whitelist.txt
    # log
    # auto-update-interval 24h
    # list-store ads-cache
    #}
    hosts {
    fallthrough
    }
    @@ -23,9 +24,10 @@ cat>Corefile<<EOF
    bogus $bogus
    log
    cache
    redisc {
    endpoint 127.0.0.1:6379
    }
    # uncomment lines below to enable redis plugin
    #redisc {
    # endpoint 127.0.0.1:6379
    #}
    health
    reload
    }
  16. missdeer revised this gist Dec 29, 2020. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ cat>Corefile<<EOF
    hosts {
    fallthrough
    }
    forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {
    forward . 127.0.0.1:5300 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {
    except $china $apple $google cdn.jsdelivr.net dns.quad9.net cloudflare-dns.com dns.google
    }
    proxy . 192.168.1.1
    @@ -29,6 +29,11 @@ cat>Corefile<<EOF
    health
    reload
    }
    .:5300 {
    bind 127.0.0.1
    forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353
    cache
    }
    .:5301 {
    bind 127.0.0.1
    forward . tls://9.9.9.9 tls://9.9.9.10 {
  17. missdeer revised this gist Dec 28, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ cat>Corefile<<EOF
    fallthrough
    }
    forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {
    except $china $apple $google cdn.jsdelivr.net
    except $china $apple $google cdn.jsdelivr.net dns.quad9.net cloudflare-dns.com dns.google
    }
    proxy . 192.168.1.1
    bogus $bogus
  18. missdeer revised this gist Mar 7, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,9 @@ bogus=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/bo
    cat>Corefile<<EOF
    . {
    ads {
    strict-default-lists
    default-lists
    blacklist https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt
    whitelist https://files.krnl.eu/whitelist.txt
    log
    auto-update-interval 24h
    list-store ads-cache
  19. missdeer revised this gist Mar 7, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    #!/bin/bash
    china=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/google.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    bogus=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf -s | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    china=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/google.china.conf | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    bogus=`curl -sSL https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    cat>Corefile<<EOF
    . {
    ads {
  20. missdeer revised this gist Mar 7, 2020. 1 changed file with 46 additions and 44 deletions.
    90 changes: 46 additions & 44 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,49 +1,51 @@
    #!/bin/bash
    echo ". {" > Corefile
    echo " ads {" >> Corefile
    echo " strict-default-lists" >> Corefile
    echo " log" >> Corefile
    echo " auto-update-interval 24h" >> Corefile
    echo " list-store ads-cache" >> Corefile
    echo " }" >> Corefile
    echo " hosts {" >> Corefile
    echo " fallthrough" >> Corefile
    echo " }" >> Corefile
    echo " forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {" >> Corefile
    china=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/google.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " except $china $apple $google cdn.jsdelivr.net" >> Corefile
    echo " }" >> Corefile
    echo " proxy . 192.168.1.1" >> Corefile
    bogus=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf -s | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " bogus $bogus" >> Corefile
    echo " log" >> Corefile
    echo " cache" >> Corefile
    echo " redisc {" >> Corefile
    echo " endpoint 127.0.0.1:6379" >> Corefile
    echo " }" >> Corefile
    echo " health" >> Corefile
    echo " reload" >> Corefile
    echo "}" >> Corefile
    echo ".:5301 {" >> Corefile
    echo " bind 127.0.0.1" >> Corefile
    echo " forward . tls://9.9.9.9 tls://9.9.9.10 {" >> Corefile
    echo " tls_servername dns.quad9.net" >> Corefile
    echo " }" >> Corefile
    echo " cache" >> Corefile
    echo "}" >> Corefile
    echo ".:5302 {" >> Corefile
    echo " bind 127.0.0.1" >> Corefile
    echo " forward . tls://1.1.1.1 tls://1.0.0.1 {" >> Corefile
    echo " tls_servername cloudflare-dns.com" >> Corefile
    echo " }" >> Corefile
    echo " cache" >> Corefile
    echo "}" >> Corefile
    echo ".:5303 {" >> Corefile
    echo " bind 127.0.0.1" >> Corefile
    echo " forward . tls://8.8.8.8 tls://8.8.4.4 {" >> Corefile
    echo " tls_servername dns.google" >> Corefile
    echo " }" >> Corefile
    echo " cache" >> Corefile
    echo "}" >> Corefile
    cat>Corefile<<EOF
    . {
    ads {
    strict-default-lists
    log
    auto-update-interval 24h
    list-store ads-cache
    }
    hosts {
    fallthrough
    }
    forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {
    except $china $apple $google cdn.jsdelivr.net
    }
    proxy . 192.168.1.1
    bogus $bogus
    log
    cache
    redisc {
    endpoint 127.0.0.1:6379
    }
    health
    reload
    }
    .:5301 {
    bind 127.0.0.1
    forward . tls://9.9.9.9 tls://9.9.9.10 {
    tls_servername dns.quad9.net
    }
    cache
    }
    .:5302 {
    bind 127.0.0.1
    forward . tls://1.1.1.1 tls://1.0.0.1 {
    tls_servername cloudflare-dns.com
    }
    cache
    }
    .:5303 {
    bind 127.0.0.1
    forward . tls://8.8.8.8 tls://8.8.4.4 {
    tls_servername dns.google
    }
    cache
    }
    EOF
  21. missdeer revised this gist Mar 3, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -27,18 +27,21 @@ echo " health" >> Corefile
    echo " reload" >> Corefile
    echo "}" >> Corefile
    echo ".:5301 {" >> Corefile
    echo " bind 127.0.0.1" >> Corefile
    echo " forward . tls://9.9.9.9 tls://9.9.9.10 {" >> Corefile
    echo " tls_servername dns.quad9.net" >> Corefile
    echo " }" >> Corefile
    echo " cache" >> Corefile
    echo "}" >> Corefile
    echo ".:5302 {" >> Corefile
    echo " bind 127.0.0.1" >> Corefile
    echo " forward . tls://1.1.1.1 tls://1.0.0.1 {" >> Corefile
    echo " tls_servername cloudflare-dns.com" >> Corefile
    echo " }" >> Corefile
    echo " cache" >> Corefile
    echo "}" >> Corefile
    echo ".:5303 {" >> Corefile
    echo " bind 127.0.0.1" >> Corefile
    echo " forward . tls://8.8.8.8 tls://8.8.4.4 {" >> Corefile
    echo " tls_servername dns.google" >> Corefile
    echo " }" >> Corefile
  22. missdeer revised this gist Feb 9, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ echo " except $china $apple $google cdn.jsdelivr.net" >> Corefile
    echo " }" >> Corefile
    echo " proxy . 192.168.1.1" >> Corefile
    bogus=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf -s | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " bogus $bogus" >> $1
    echo " bogus $bogus" >> Corefile
    echo " log" >> Corefile
    echo " cache" >> Corefile
    echo " redisc {" >> Corefile
  23. missdeer revised this gist Dec 21, 2019. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -10,12 +10,14 @@ echo " hosts {" >> Corefile
    echo " fallthrough" >> Corefile
    echo " }" >> Corefile
    echo " forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {" >> Corefile
    china=`curl -L -s https://git.io/chinadomainlist | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -L -s https://git.io/appledomainlist | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -L -s https://git.io/googledomainlist | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " except $china $apple $google" >> Corefile
    china=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/apple.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/google.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " except $china $apple $google cdn.jsdelivr.net" >> Corefile
    echo " }" >> Corefile
    echo " proxy . 192.168.1.1" >> Corefile
    bogus=`curl -L https://github.com/felixonmars/dnsmasq-china-list/raw/master/bogus-nxdomain.china.conf -s | grep "=" | while read line; do awk -F '=' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " bogus $bogus" >> $1
    echo " log" >> Corefile
    echo " cache" >> Corefile
    echo " redisc {" >> Corefile
  24. missdeer revised this gist Dec 18, 2019. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,9 @@ echo " }" >> Corefile
    echo " proxy . 192.168.1.1" >> Corefile
    echo " log" >> Corefile
    echo " cache" >> Corefile
    echo " redisc {" >> Corefile
    echo " endpoint 127.0.0.1:6379" >> Corefile
    echo " }" >> Corefile
    echo " health" >> Corefile
    echo " reload" >> Corefile
    echo "}" >> Corefile
  25. missdeer revised this gist Dec 17, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -10,9 +10,9 @@ echo " hosts {" >> Corefile
    echo " fallthrough" >> Corefile
    echo " }" >> Corefile
    echo " forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {" >> Corefile
    china=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    china=`curl -L -s https://git.io/chinadomainlist | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl -L -s https://git.io/appledomainlist | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl -L -s https://git.io/googledomainlist | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " except $china $apple $google" >> Corefile
    echo " }" >> Corefile
    echo " proxy . 192.168.1.1" >> Corefile
  26. missdeer revised this gist Dec 16, 2019. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,11 @@
    #!/bin/bash
    echo ". {" > Corefile
    echo " ads" >> Corefile
    echo " ads {" >> Corefile
    echo " strict-default-lists" >> Corefile
    echo " log" >> Corefile
    echo " auto-update-interval 24h" >> Corefile
    echo " list-store ads-cache" >> Corefile
    echo " }" >> Corefile
    echo " hosts {" >> Corefile
    echo " fallthrough" >> Corefile
    echo " }" >> Corefile
  27. missdeer revised this gist Dec 16, 2019. No changes.
  28. missdeer revised this gist Dec 16, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ apple=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.chi
    google=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " except $china $apple $google" >> Corefile
    echo " }" >> Corefile
    echo " proxy . 114.114.114.114 114.114.115.115" >> Corefile
    echo " proxy . 192.168.1.1" >> Corefile
    echo " log" >> Corefile
    echo " cache" >> Corefile
    echo " health" >> Corefile
  29. missdeer revised this gist Dec 16, 2019. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,20 @@
    #!/bin/bash
    echo ". {" > Corefile
    echo " ads" >> Corefile
    echo " hosts {" >> Corefile
    echo " fallthrough" >> Corefile
    echo " }" >> Corefile
    echo " forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 127.0.0.1:5301 127.0.0.1:5302 127.0.0.1:5303 {" >> Corefile
    china=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    apple=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    google=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
    echo " except $china $apple $google" >> Corefile
    echo " }" >> Corefile
    echo " proxy . 116.228.111.118 180.168.255.18" >> Corefile
    echo " proxy . 114.114.114.114 114.114.115.115" >> Corefile
    echo " log" >> Corefile
    echo " cache" >> Corefile
    echo " health" >> Corefile
    echo " reload" >> Corefile
    echo "}" >> Corefile
    echo ".:5301 {" >> Corefile
    echo " forward . tls://9.9.9.9 tls://9.9.9.10 {" >> Corefile
  30. missdeer revised this gist Aug 6, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gen_Corefile.sh
    Original file line number Diff line number Diff line change
    @@ -12,14 +12,14 @@ echo " cache" >> Corefile
    echo " health" >> Corefile
    echo "}" >> Corefile
    echo ".:5301 {" >> Corefile
    echo " forward . tls://9.9.9.9 {" >> Corefile
    echo " forward . tls://9.9.9.9 tls://9.9.9.10 {" >> Corefile
    echo " tls_servername dns.quad9.net" >> Corefile
    echo " }" >> Corefile
    echo " cache" >> Corefile
    echo "}" >> Corefile
    echo ".:5302 {" >> Corefile
    echo " forward . tls://1.1.1.1 tls://1.0.0.1 {" >> Corefile
    echo " tls_servername 1dot1dot1dot1.cloudflare-dns.com" >> Corefile
    echo " tls_servername cloudflare-dns.com" >> Corefile
    echo " }" >> Corefile
    echo " cache" >> Corefile
    echo "}" >> Corefile