/smartdns-rs

A cross platform local DNS server (Dnsmasq like) written in rust to obtain the fastest website IP for the best Internet experience, supports DoT, DoH. 一个用 Rust 编写的跨平台本地DNS服务器,获取最快的网站IP,获得最佳上网体验,支持DoH,DoT。

Primary LanguageRustGNU General Public License v3.0GPL-3.0

SmartDNS-rs

Test GitHub release (latest by date including pre-releases) OS

DocsDiscord

English | 中文

SmartDNS-rs 🐋 is a local DNS server imspired by C smartdns to accepts DNS query requests from local clients, obtains DNS query results from multiple upstream DNS servers, and returns the fastest access results to clients. Avoiding DNS pollution and improving network access speed, supports high-performance ad filtering.

Note: The C version of smartdns is very functional, but because it only supports Linux, while MacOS and Windows can only be supported through Docker or WSL. Therefore, I want to develop a rust version of SmartDNS that supports compiling to Windows, MacOS, Linux and Android Termux environment to run, and is compatible with its configuration.


It is still under development, please do not use it in production environment, welcome to try and provide feedback.

Please refer to TODO for the function coverage

Building

Open your terminal and execute these commands:

git clone https://github.com/mokeyish/smartdns-rs.git
cd smartdns-rs

# build
cargo build --release

# print help
cargo build --release

# run
sudo ./target/release/smartdns run -c ./etc/smartdns/smartdns.conf

Installing

Building from source code might be troublesome, you can download the compiled package here and unzip it.

  • Run as foreground

    ./smartdns run -c ./smartdns.conf -d
    • -d or --debug is enabled to print debug logs
  • Install as a service and run automatically in the background at startup

    To install as a system service, you need administrator privileges. (MacOS users can use the Brew command to install, brew install smartdns)

    • Install service

      ./smartdns service install
    • Start service

      ./smartdns service start
    • Stop service

      ./smartdns service stop
    • Uninstall service

      ./smartdns service uninstall -p
      • -p or --purge will delete the configuration file along with it.

    You can use the following command to view the help of service management commands:

    ./smartdns service help
    

Configuration parameter

Please refer to here for configuration, and refer to TODO for the function coverage.

Acknowledgments !!!

This software wouldn't have been possible without:

License

This software contains codes from , which is licensed under either of

And other codes is licensed under