ZeroDNS
a DNS server in Rust, which is inspired from chinadns/dnsmasq.
WARNING: still in an active development!!!
Goals
- multiple protocols: UDP/TCP/DoT/DoT/DNSCrypt
- user-defined filters, includes lua or native rust codes
Quick Start
Notice: ensure you have just installed on your machine!
run an example:
$ just r
$ dig @127.0.0.1 -p5454 www.youtube.com
Configuration
Here's an example configuration file:
# The settings of server
[]
# will listen on tcp+udp
= "0.0.0.0:5454"
# use LRU cache with 1000 capacity
= 1000
##### FILTERS BEGIN #####
# alidns over udp
[]
= "proxyby"
= { = ["223.5.5.5", "223.6.6.6"] }
# opendns over tcp
[]
= "proxyby"
= { = ["tcp://208.67.222.222:443", "tcp://208.67.220.220:443"] }
# a chinadns filter:
# - use trusted dns servers for oversea domain
# - use mistrusted dns servers for Chinese domain
# NOTICE: require 'geoip_database', you can download from https://git.io/GeoLite2-Country.mmdb
[]
= "chinadns"
= { = ["tcp://208.67.222.222:443", "tcp://208.67.220.220:443"], = ["223.5.5.5", "223.6.6.6"], = "GeoLite2-Country.mmdb" }
##### FILTERS END #####
##### RULES BEGIN #####
# NOTICE:
# - will check rules below one by one
# - the 'domain' field follows the glob syntax
# for domain of '*.cn', use alidns filter
[[]]
= "*.cn"
= "alidns"
# for domain of '*apple.com', use alidns filter
[[]]
= "*.apple.com"
= "alidns"
# for domain of '*google*', use opendns filter
[[]]
= "*google*"
= "opendns"
# FINAL: use chinadns for others
[[]]
= "*"
= "chinadns"
##### RULES END #####