Cfdns Save Abandoned

A local DNS server, used to test Cloudflare CDN latency and speed, get the fastest IP (IPv4).一个本地DNS服务器, 用于测试 Cloudflare CDN 延迟和速度,获取最快 IP (IPv4 )。支持docker一键部署。

Project README

cfdns

简介

测试Cloudflare CDN 延迟,获取最快的IPV4。

内置DNS服务, 无需手动改Hosts文件。

安装

使用docker

  • 创建映射目录: cd ~/;mkdir -p cfdns/conf && cd cfdns
  • 下载配置文件: wget https://raw.githubusercontent.com/ClassmateLin/cfdns/main/conf/config.toml -O ./conf/config.toml
  • 下载ip地址文件: wget https://raw.githubusercontent.com/ClassmateLin/cfdns/main/conf/ip.txt -O ./conf/ip.txt
  • 运行容器: docker run -itd -e RUST_LOG=info -v ~/cfdns/conf:/usr/local/cfdns/conf -p 9053:53/udp --name cfdns classmatelin/cfdns
  • 查看运行日志: docker logs cfdns
  • 测试服务是否正常解析: dig @127.0.0.1 -p 9053 www.cloudflare.com

使用docker-compose

见: [lazy-docker](https://github.com/ClassmateLin/lazy-docker/blob/main/docker-compose.dns.yml

使用二进制

  • 下载release
  • RUST_LOG=info ./cfdns

自行编译

请确保您已正确安装了Rust.

  • git clone https://github.com/ClassmateLin/cfdns.git && cd cfdns

  • cargo build --release, 编译结果在./target/release目录下。

使用

配置说明

├── cfdns
└── conf
    ├── config.toml
    └── ip.txt
  • ip.txt的内容是Cloudflare的地址范围, 可自行精简。
  • domain.txt的内容是需要经过cfdns返回最快的IP的域名, 一行一个。
  • config.toml是配置文件, 详细内容请自行看配置文件。

运行程序

  • 使用命令RUST_LOG=info ./cfdns运行:

runing

  • 使用dig测试:

dig

  • 将设备的DNS配置改为cfdns绑定的地址。

setting

result

其他项目

Open Source Agenda is not affiliated with "Cfdns" Project. README Source: ClassmateLin/cfdns
Stars
39
Open Issues
0
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating