この紹介文は現在英語版のみです。
cf2dns is a powerful tool that helps optimize website performance by selecting the best Cloudflare IPs and automatically updating DNS records across different network providers. It includes features for fake wall defense and supports both IPv4 and IPv6 optimization.
Key Features
- IP Optimization: Automatically selects optimal Cloudflare IPs for different network providers
- Multi-DNS Support: Compatible with DNSPod and Alibaba Cloud DNS
- IPv6 Support: Includes IPv6 optimization capabilities
- Fake Wall Defense: Implements protection against fake wall attacks
- Multiple Deployment Options: Supports both VPS deployment and GitHub Actions
- Docker Support: Available as a Docker container for easy deployment
Deployment Methods
1. VPS Deployment (Recommended)
- Install dependencies:
pip install -r requirements.txt
-
Configure credentials:
- Get SecretId and SecretKey from Tencent Cloud or Alibaba Cloud
- For Alibaba Cloud DNS, add DNS control permission
AliyunDNSFullAccess
-
Configure domains and subdomains in the script
-
Run the script:
python cf2dns.py
2. Docker Deployment
- Pull the Docker image:
docker pull dddb/cf2dns
- Set up configuration:
mkdir -p ~/cf2dns_docker/logs
cd ~/cf2dns_docker
wget --no-check-certificate -qO ./config.ini https://raw.githubusercontent.com/ddgth/cf2dns/master/docker/src/config.ini
- Run the container:
docker run -d -v ~/cf2dns_docker/config.ini:/cf2dns/src/config.ini -v ~/cf2dns_docker/logs:/cf2dns/logs dddb/cf2dns
3. GitHub Actions Deployment
- Fork the repository
- Configure secrets:
DOMAINS: Domain configurationKEY: API keySECRETID: Cloud provider secret IDSECRETKEY: Cloud provider secret key
- Modify workflow settings in
.github/workflows/run.yml
Important Notes
-
Security Warning:
- Cloudflare explicitly prohibits IP optimization and proxy nodes
- Using this service may result in account suspension
- Use at your own risk
-
Configuration Options:
- Default line: DEF
- Overseas line: AB
- Custom lines can be configured for different network providers
-
Fake Wall Defense:
- Implements IP pool optimization
- Provides dedicated IP selection
- Reduces risk of shared IP issues