Ya-DNS provides a binary for forwarding DNS.
It forwards DNS queries to multiple servers and decides which result to return by custom rules.
Prebuilt releases are available here.
- UDP
- TCP
- DNS over TLS (DoT)
- DNS over HTTPS (DoH) (mips not support)
- Rule based forwarding
- Rule based response filtering
- Parallel forwarding
- Regex matching
The path of the configuration file is passed using -c
:
$ ./yadns -c <CONFIG_FILE>
If you ignore -c
, it will load config.toml
.
Note: All non-absolute file paths (in the command line arguments and in the config file) are relative to the working directory instead of the location of the executable or the config file.
-
ChinaDNS (Users in China should prefer this.)
-
ChinaDNS domain (Use direct and proxy domain list for ChinaDns.)
-
OpenNIC (Use OpenNIC DNS for OpenNIC domains and Google DNS for the others.)
-
Template with all configurable settings (It is exhaustedly commented. Read it if you want to write your own config file.)
The current minimum rustc version for this project is 1.64
Install Rust: https://www.rust-lang.org/tools/install
Install GCC or Clang.
Clone & Build:
git clone --recursive https://github.com/zh-yjie/ya-dns.git
cd ya-dns
cargo build --release