
文件•
英語| 中文
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許可證中定義的您的工作)均應如上所述,沒有任何其他條款或條件。