updns
v0.1.7
updns 是一个使用Rust开发的简单 DNS 代理服务器。可以拦截任意域名并返回你需要的ip
从发布页面下载二进制文件
或者使用cargo来安装
cargo install updnsupdns
# or
updns -c /your/hosts您可以使用sudo来运行此命令,因为您将使用53端口
构建docker镜像
docker build -t updns .启动
docker run -d --name updns -p 53:53/udp -v /root/updns/:/root/.updns/ --restart always updns您可以使用updns config命令,然后调用vim edit,或者找到~/.updns/config edit
您可以指定标准域,或利用正则表达式进行动态匹配
正则表达式以
~开头
bind 0.0.0.0:53 # Binding address
proxy 8.8.8.8:53 # Proxy address
timeout 2s # Proxy timeout (format: 1ms, 1s, 1m, 1h, 1d)
# Domain matching
example.com 1.1.1.1
*.example.com 2.2.2.2
~^w+.example.[a-z]+$ 3.3.3.3
# IPv6
test.com ::
# Import from other file
import /other/hosts用 Rust 构建 DNS 服务器
麻省理工学院许可证