{"id":13579037,"url":"https://github.com/mokeyish/smartdns-rs","last_synced_at":"2025-05-14T17:02:31.104Z","repository":{"id":62740813,"uuid":"559591126","full_name":"mokeyish/smartdns-rs","owner":"mokeyish","description":"A cross platform local DNS server (Dnsmasq like) written in rust to obtain the fastest website IP for the best Internet experience, supports DoT, DoQ, DoH, DoH3.","archived":false,"fork":false,"pushed_at":"2025-05-10T09:01:24.000Z","size":1067,"stargazers_count":687,"open_issues_count":39,"forks_count":51,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-10T10:18:59.538Z","etag":null,"topics":["dns","dns-over-h3","dns-over-https","dns-over-quic","dns-over-tls","dns-server","dnsmasq","doh","dot","linux","macos","pi-hole","rust","smartdns","smartdns-rs","trust-dns","trustdns","windows"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mokeyish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-30T15:36:44.000Z","updated_at":"2025-05-10T09:01:24.000Z","dependencies_parsed_at":"2023-11-19T10:21:27.764Z","dependency_job_id":"0fcc431c-bef2-4656-bdbb-75ac8b7fc0ea","html_url":"https://github.com/mokeyish/smartdns-rs","commit_stats":{"total_commits":331,"total_committers":11,"mean_commits":30.09090909090909,"dds":"0.22356495468277948","last_synced_commit":"70162f907b00fdb299f78f3a95bcd94d1b0f615f"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mokeyish%2Fsmartdns-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mokeyish%2Fsmartdns-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mokeyish%2Fsmartdns-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mokeyish%2Fsmartdns-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mokeyish","download_url":"https://codeload.github.com/mokeyish/smartdns-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190366,"owners_count":22029629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","dns-over-h3","dns-over-https","dns-over-quic","dns-over-tls","dns-server","dnsmasq","doh","dot","linux","macos","pi-hole","rust","smartdns","smartdns-rs","trust-dns","trustdns","windows"],"created_at":"2024-08-01T15:01:35.977Z","updated_at":"2025-05-14T17:02:31.036Z","avatar_url":"https://github.com/mokeyish.png","language":"Rust","funding_links":[],"categories":["Rust","macos"],"sub_categories":[],"readme":"# SmartDNS-rs\n\n![Test](https://github.com/mokeyish/smartdns-rs/actions/workflows/test.yml/badge.svg?branch=main)\n[![Crates.io Version](https://img.shields.io/crates/v/smartdns.svg)](https://crates.io/crates/smartdns)\n[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/mokeyish/smartdns-rs?display_name=tag\u0026include_prereleases)](https://github.com/mokeyish/smartdns-rs/releases)\n[![homebrew version](https://img.shields.io/homebrew/v/smartdns)](https://formulae.brew.sh/formula/smartdns)\n![OS](https://img.shields.io/badge/os-Windows%20%7C%20MacOS%20%7C%20Linux-blue)\n\n[Docs](https://pymumu.github.io/smartdns/en/) •\n\nEnglish | [中文](https://github.com/mokeyish/smartdns-rs/blob/main/README_zh-CN.md)\n\nSmartDNS-rs 🐋 is a local DNS server imspired by [C SmartDNS](https://github.com/pymumu/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.\n\n\n\n## Features\n\n- **Multiple upstream DNS servers**\n\n  Supports configuring multiple upstream DNS servers and query at the same  time.the query will not be affected, Even if there is a DNS server  exception.\n\n- **Return the fastest IP address**\n\n  Supports finding the fastest access IP address from the IP address list  of the domain name and returning it to the client to avoid DNS pollution and improve network access speed.\n\n- **Support for multiple query protocols**\n\n  Supports UDP, TCP, DoT, DoQ, DoH, DoH3 queries and  service, and non-53 port queries, effectively avoiding DNS pollution and protect privacy, and support query DNS over socks5, http proxy.\n\n- **Domain IP address specification**\n\n  Supports configuring IP address of specific domain to achieve the effect of advertising filtering, and avoid malicious websites.\n\n- **DNS domain forwarding**\n\n  Supports DNS forwarding, ipset and nftables. Support setting the domain result to ipset and nftset set when speed check fails.\n\n- **Windows / MacOS / Linux multi-platform support**\n\n  Supports installing as a service and running it at startup.\n\n- **Support IPV4, IPV6 dual stack**\n\n  Supports IPV4, IPV6 network, support query A, AAAA record, dual-stack IP selection, and filter IPV6 AAAA record.\n\n- **DNS64**\n\n  Supports DNS64 translation.\n\n- **High performance, low resource consumption**\n\n  Tokio-based multi-threaded asynchronous I/O model; caches query  results; supports most-used domain name expired prefetching, query **'0'**  milliseconds, without eliminating the impact of DoH and DoT encryption.\n\nNote: 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.\n\n---\n\n**It is still under development, please do not use it in production environment, welcome to try and provide feedback.**\n\nPlease refer to [TODO](https://github.com/mokeyish/smartdns-rs/blob/main/TODO.md) for the function coverage\n\n\n\n## Installing\n\n*Nightly builds can be found [here](https://github.com/mokeyish/smartdns-rs/actions/workflows/nightly.yml).*\n\n- MacOS\n\n  If you have installed [brew](https://brew.sh/), you can directly use the following command to install.\n\n  ```shell\n  brew update\n  brew install smartdns\n  ```\n\n  Note: Listening on port 53 requires root permission, so `sudo` is required.\n\n  The command `sudo smartdns service start` for `brew` installed `smartdns` is the same as `sudo brew services start smartdns`.\n\n  If you don't have `brew` installed, just download the compiled program compression package and install it as below.\n\n- Windows / Linux\n\n  Go to [here](https://github.com/mokeyish/smartdns-rs/releases) to download the package and decompress it.\n\n  1. Get help\n\n     ```shell\n     ./smartdns help\n     ```\n\n  2. Run as foreground, easy to check the running status\n\n     ```shell\n     ./smartdns run -c ./smartdns.conf -v\n     ```\n\n     - `-v` is enabled to print debug logs.\n\n  3. Run as background service, run automatically at startup\n\n     Get help of service management commands.\n\n     ```shell\n     ./smartdns service help\n     ```\n\n     *Note: Installed as a system service, administrator / root permissions are required.*\n\n     *Service management is compatible with all systems, call [sc](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc754599(v=ws.11)) on Windows; call `launchctl` or `brew` on MacOS; call `Systemd` or `OpenRc` on Linux.*\n\n## Configuration\n\nThe following is the simplest example configuration\n\n```conf\n# Listen on local port 53\nbind 127.0.0.1:53  \n\n# Configure bootstrap-dns, if not configured, call the system_conf, \n# it is recommended to configure, so that it will be encrypted.\nserver https://1.1.1.1/dns-query  -bootstrap-dns -exclude-default-group\nserver https://8.8.8.8/dns-query  -bootstrap-dns -exclude-default-group\n\n# Configure default upstream server\nserver https://cloudflare-dns.com/dns-query\nserver https://dns.quad9.net/dns-query\nserver https://dns.google/dns-query\n\n# Configure the Office(Home) upstream server\nserver 192.168.1.1 -exclude-default-group -group office\n\n# Domain names ending with ofc are forwarded to the office group for resolution\nnameserver /ofc/office\n\n# Set static IP for domain name\naddress /test.example.com/1.2.3.5\n\n# Block Domains (Ad Blocking)\naddress /ads.example.com/#\n\n# The following features are not yet supported in the [C SmartDNS](https://github.com/pymumu/smartdns) and are only applicable to SmartDNS-rs.\n# Configure DoH3\nserver-h3 1.1.1.1\n\n# Configure DoQ\nserver-quic unfiltered.adguard-dns.com\n```\n\nFor more advanced configurations, please refer to [here](https://github.com/pymumu/smartdns/blob/doc/en/docs/configuration.md) , and refer to [TODO](https://github.com/mokeyish/smartdns-rs/blob/main/TODO.md) for the function coverage.\n\n## Building\n\nAssuming you have installed [Rust](https://www.rust-lang.org/learn/get-started), then you can open the terminal and execute these commands:\n\n```shell\ngit clone https://github.com/mokeyish/smartdns-rs.git\ncd smartdns-rs\n\n# install https://github.com/casey/just\ncargo install just\n\n# build\njust build --release\n\n# print help\n./target/release/smartdns --help\n\n# run\nsudo ./target/release/smartdns run -c ./etc/smartdns/smartdns.conf\n```\n\nFor cross-compilation, it is recommended to use [cross](https://github.com/cross-rs/cross) (requires Docker).\n\n## Acknowledgments !!!\n\nThis software wouldn't have been possible without:\n\n- [Hickory DNS](https://github.com/hickory-dns/hickory-dns)\n- [SmartDNS](https://github.com/pymumu/smartdns)\n\n## License\n\nThis software contains codes from [https://github.com/hickory-dns/hickory-dns](https://github.com/hickory-dns/hickory-dns), which is licensed under either of\n\n- Apache License, Version 2.0, (LICENSE-APACHE or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))\n- MIT license (LICENSE-MIT or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))\n\nAnd other codes is licensed under\n\n- GPL-3.0 license (LICENSE-GPL-3.0 or [https://opensource.org/licenses/GPL-3.0](https://opensource.org/licenses/GPL-3.0))\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the GPL-3.0 license, shall be licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmokeyish%2Fsmartdns-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmokeyish%2Fsmartdns-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmokeyish%2Fsmartdns-rs/lists"}