Giter Site home page Giter Site logo

zerodns's Introduction

logo

ZeroDNS

GitHub Actions Workflow Status Codecov Crates.io Version Crates.io Total Downloads GitHub Tag GitHub License

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
[server]
# will listen on tcp+udp
listen = "0.0.0.0:5454"
# use LRU cache with 1000 capacity
cache_size = 1000

##### FILTERS BEGIN #####

# alidns over udp
[filters.alidns]
kind = "proxyby"
props = { servers = ["223.5.5.5", "223.6.6.6"] }

# opendns over tcp
[filters.opendns]
kind = "proxyby"
props = { servers = ["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
[filters.chinadns]
kind = "chinadns"
props = { trusted = ["tcp://208.67.222.222:443", "tcp://208.67.220.220:443"], mistrusted = ["223.5.5.5", "223.6.6.6"], geoip_database = "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
[[rules]]
domain = "*.cn"
filter = "alidns"

# for domain of '*apple.com', use alidns filter
[[rules]]
domain = "*.apple.com"
filter = "alidns"

# for domain of '*google*', use opendns filter
[[rules]]
domain = "*google*"
filter = "opendns"

# FINAL: use chinadns for others
[[rules]]
domain = "*"
filter = "chinadns"

##### RULES END #####

zerodns's People

Contributors

jjeffcaii avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.