
文档•
英语| 中文
smartdns-rs?是由C SMARTDNS IMSPER IMSPER的本地DNS服务器,可从本地客户端接受DNS查询请求,从多个上游DNS服务器获得DNS查询结果,并将最快的访问结果返回给客户端。避免DNS污染并提高网络访问速度,支持高性能广告过滤。
多个上游DNS服务器
支持配置多个上游DNS服务器并同时查询。即使存在DNS服务器异常,查询也不会受到影响。
返回最快的IP地址
支持从域名的IP地址列表中找到最快的访问IP地址,并将其返回给客户端,以避免DNS污染并提高网络访问速度。
支持多个查询协议
支持UDP,TCP,DOT,DOQ,DOH,DOH3查询和服务以及非53端口查询,有效地避免了DNS污染并保护隐私,并支持Socks5上的查询DNS,HTTP Proxy。
域IP地址规范
支持配置特定域的IP地址以实现广告过滤的效果,并避免恶意网站。
DNS域转发
支持DNS转发,IPSET和NFTABLES。支持将域结果设置为IPSET和NFTSET设置时,当速度检查失败时。
Windows / MacOS / Linux多平台支持
支持安装作为服务并在启动时运行它。
支持IPv4,IPv6双堆栈
支持IPv4,IPv6网络,支持查询A,AAAA记录,双堆IP选择和过滤器IPv6 AAAA记录。
DNS64
支持DNS64翻译。
高性能,资源消耗低
基于Tokio的多线程异步I/O模型; caches查询结果;支持大多数使用的域名过期的预取料,查询“ 0”毫秒,而不会消除DOH和DOT加密的影响。
注意:SmartDNS的C版本非常有用,但是由于它仅支持Linux ,而MacOS和Windows只能通过Docker或WSL支持。因此,我想开发一个SMARTDN的Rust版本,该版本支持汇编为Windows,MacOS,Linux和Android Termux环境运行,并且与其配置兼容。
它仍在开发中,请不要在生产环境中使用它,欢迎尝试提供反馈。
请参考托多以获取功能覆盖
夜间建造可以在这里找到。
macos
如果您已经安装了Brew,则可以直接使用以下命令安装。
brew update
brew install smartdns注意:在端口53上聆听需要根本许可,因此需要sudo 。
命令sudo smartdns service start brew的smartdns与sudo brew services start smartdns相同。
如果您没有安装brew ,只需下载编译的程序压缩软件包,然后按以下安装即可。
Windows / Linux
转到此处下载软件包并解压缩。
得到帮助
./smartdns help作为前景运行,易于检查运行状态
./smartdns run -c ./smartdns.conf -v-v启用可以打印调试日志。作为背景服务运行,在启动时自动运行
获得服务管理命令的帮助。
./smartdns service help注意:需要安装作为系统服务,需要管理员 /根本权限。
服务管理与所有系统兼容,请在Windows上致电SC;在MacOS上致电launchctl或brew ;在Linux上调用Systemd或OpenRc 。
以下是最简单的示例配置
# Listen on local port 53
bind 127.0.0.1:53
# Configure bootstrap-dns, if not configured, call the system_conf,
# it is recommended to configure, so that it will be encrypted.
server https://1.1.1.1/dns-query -bootstrap-dns -exclude-default-group
server https://8.8.8.8/dns-query -bootstrap-dns -exclude-default-group
# Configure default upstream server
server https://cloudflare-dns.com/dns-query
server https://dns.quad9.net/dns-query
server https://dns.google/dns-query
# Configure the Office(Home) upstream server
server 192.168.1.1 -exclude-default-group -group office
# Domain names ending with ofc are forwarded to the office group for resolution
nameserver /ofc/office
# Set static IP for domain name
address /test.example.com/1.2.3.5
# Block Domains (Ad Blocking)
address /ads.example.com/#
# The following features are not yet supported in the [C SmartDNS](https://github.com/pymumu/smartdns) and are only applicable to SmartDNS-rs.
# Configure DoH3
server-h3 1.1.1.1
# Configure DoQ
server-quic unfiltered.adguard-dns.com
有关更高级的配置,请参考此处,并参考todo以获取功能覆盖范围。
假设您已经安装了Rust,则可以打开终端并执行以下命令:
git clone https://github.com/mokeyish/smartdns-rs.git
cd smartdns-rs
# install https://github.com/casey/just
cargo install just
# build
just build --release
# print help
./target/release/smartdns --help
# run
sudo ./target/release/smartdns run -c ./etc/smartdns/smartdns.conf对于交叉补偿,建议使用交叉(需要Docker)。
没有这个软件是不可能的:
该软件包含来自https://github.com/hickory-dns/hickory-dns的代码
和其他代码已获得许可
除非您明确说明另有说明,否则任何有意提交的捐款(如GPL-3.0许可证中定义的您的工作)均应如上所述,没有任何其他条款或条件。