Skip to content

w0330t/cloudflare-auto-dns

Repository files navigation

Cloudflare Auto DNS

使用 Adguard Home 对 Cloudflare 的站点网络优化。

本程序将调用 CloudflareSpeedTest 自动解析 Cloudflare 针对当前用户网络的优化IP解析并将其写入 Adguard Home 的 DNS 覆写,以便在访问指定网站或者服务的时候获得更加良好的体验。

我在本地部署了一堆cloudflare隧道的服务,但是体验太差,动辄延迟就到200了。遂造了个轮子,没啥技术含量。

相关项目

使用指南

项目使用条件

本项目可以直接运行Python文件或者使用docker部署。

虽然理论上是全平台。但本项目仅在Linux上调试运行。

使用docker-compose部署

  1. 克隆本项目
git clone https://github.com/w0330t/cloudflare-auto-dns.git
  1. 进入克隆的目录中,将config-example.toml文件复制然后重命名为config.toml,根据自己的需求修改内容。

  2. 安装好docker-compose后,直接执行下面的命令即可。

docker-compose up -d

手动运行

  1. 克隆本项目
git clone https://github.com/w0330t/cloudflare-auto-dns.git
  1. 进入克隆的目录中,将config-example.toml文件复制然后重命名为config.toml,根据自己的需求修改内容。

  2. 下载 CloudflareSpeedTest 的最新版本并解压缩到CloudflareSpeedTest文件夹中,此时大概目录长这样

.
├── CloudflareSpeedTest
│   ├── 使用+错误+反馈说明.txt
│   ├── cfst_hosts.sh
│   ├── CloudflareST
│   ├── ip.txt
│   └── ipv6.txt
├── config-example.toml
├── config.toml
├── docker-compose.yml
├── Dockerfile
├── main.py
├── readme.md
└── requirements.txt
  1. 使用pip安装依赖
pip install --no-cache-dir -r requirements.txt
  1. 直接开始运行
python main.py

授权协议

The GPL-3.0 License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published