这是一个高性能、支持多协议接入、自动根据Geo分流国内外的 DNS 代理服务,使用 Go 语言编写。
GeoIP.dat 和 GeoSite.dat 自动区分中国大陆和海外域名。hosts.txt)。rule.txt)。GeoIP.dat 和 GeoSite.dat。使用 root 用户运行以下命令:
bash <(curl -sL https://raw.githubusercontent.com/Hamster-Prime/DNS_automatic_traffic_splitting/main/install.sh)
该脚本会自动:
前往 Releases 页面下载对应架构的二进制文件。
在程序运行目录下,确保有以下文件(首次运行会自动下载 Geo 数据):
config.yaml: 配置文件 (参考 config.yaml.example)hosts.txt: (可选) 自定义 Hostsrule.txt: (可选) 自定义分流规则# 赋予执行权限
chmod +x doh-autoproxy-linux-amd64
# 运行
./doh-autoproxy-linux-amd64
镜像托管在 Docker Hub: weijiaqaq/dns_automatic_traffic_splitting
docker run -d \
--name dns-proxy \
--restart always \
--network host \
-v $(pwd)/config.yaml:/app/config.yaml \
-v $(pwd)/certs:/app/certs \
-v $(pwd)/hosts.txt:/app/hosts.txt \
-v $(pwd)/rule.txt:/app/rule.txt \
weijiaqaq/dns_automatic_traffic_splitting
注意:建议使用 --network host 模式以获得最佳网络性能,特别是对于 UDP 服务。
version: '3'
services:
dns:
image: weijiaqaq/dns_automatic_traffic_splitting:latest
container_name: dns-proxy
restart: always
network_mode: "host"
volumes:
- ./config.yaml:/app/config.yaml
- ./certs:/app/certs
- ./hosts.txt:/app/hosts.txt
- ./rule.txt:/app/rule.txt
config.yaml)listen:
dns_udp: ":53"
doh: ":443"
upstreams:
overseas:
- address: "https://1.1.1.1/dns-query"
protocol: "doh"
http3: true
hosts.txt:
192.168.1.1 myrouter.lan
0.0.0.0 ads.badsite.com
rule.txt:
google.com overseas
baidu.com cn
本项目采用 MIT 许可协议
Content type
Image
Digest
sha256:0a24aea9c…
Size
8.8 MB
Last updated
2 months ago
docker pull weijiaqaq/dns_automatic_traffic_splitting