Skip to content

Instantly share code, notes, and snippets.

@webdevsuperfast
Forked from Lillecarl/doh.rsc
Created June 3, 2021 01:33
Show Gist options
  • Save webdevsuperfast/f19add7c7e7626dbaeacdba70b383f60 to your computer and use it in GitHub Desktop.
Save webdevsuperfast/f19add7c7e7626dbaeacdba70b383f60 to your computer and use it in GitHub Desktop.
MikroTik Cloudflare anti phising DOH
{
/tool fetch url=https://curl.haxx.se/ca/cacert.pem
/certificate import file-name=cacert.pem passphrase=””
/ip firewall layer7-protocol
add name=security.cloudflare-dns.com regexp=security.cloudflare-dns.com
/ip dns
set allow-remote-requests=yes cache-max-ttl=1h servers=1.1.1.2,1.0.0.2,2606:4700:4700::1112,2606:4700:4700::1002 use-doh-server=https://security.cloudflare-dns.com/dns-query verify-doh-cert=yes
/ip firewall filter
add action=drop chain=output comment="drop dns output if not looking for cloudflare DOH servers." dst-port=53 layer7-protocol=!security.cloudflare-dns.com out-interface-list=WAN protocol=tcp
add action=drop chain=output comment="drop dns output if not looking for cloudflare DOH servers." dst-port=53 layer7-protocol=!security.cloudflare-dns.com out-interface-list=WAN protocol=udp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment