A modern, secure, and feature-rich Dynamic DNS management panel for Cloudflare. Automatically update your DNS records when your IP address changes, with a beautiful web interface and powerful automation features.
- Secure password hashing with PHP's
password_hash() - CSRF protection on all forms
- Session-based authentication
- API token validation
- XSS protection with input sanitization
- Multiple domains support
- Individual proxy settings per domain
- Enable/disable domains without deletion
- Bulk operations for all domains
- Automatic domain browser - no manual ID lookup needed
- One-click domain addition from Cloudflare API
- Real-time A-record display
- Proxy status detection
- Configurable update intervals:
- Manual only
- Every 5, 15, 30 minutes
- Every 1, 6, 12 hours
- Daily updates
- Automatic cron job generation
- IP change detection (only updates when needed)
- Comprehensive logging
- Detailed update logs with pagination
- Success/failure statistics
- Automatic vs manual update tracking
- Error reporting with detailed messages
- Responsive design for all devices
- Clean, intuitive UI
- Real-time status updates
- Copy-to-clipboard functionality
You can run the Cloudflare DynDNS Panel directly from the published GitHub Container Registry image. No local build is required.
docker pull ghcr.io/ilovekohl/cloudflare-dyndns-panel:latestdocker run -d \
--name cloudflare-dyndns-panel \
-p 8080:80 \
ghcr.io/ilovekohl/cloudflare-dyndns-panel:latest- The panel will be available at http://localhost:8080
- Adjust the port (
8080:80) as needed. - If you want persistent data, mount volumes for the configuration and log files.
You can run the auto-update script inside the container using cron. The container already starts cron automatically.
To add a cron job, you can either:
- Use the web panel to generate the cron command and add it to the container's crontab, or
- Exec into the container and edit the crontab manually:
docker exec -it cloudflare-dyndns-panel bash
crontab -e
# Paste the cron command from the panel (e.g. */15 * * * * php /var/www/html/auto_update.php)- All configuration and logs are stored in the container or in mounted volumes if you add them.
- To update the panel, pull the latest image tag again and restart the container.
-
Download and extract the files to your web directory:
git clone https://github.com/IloveKOHL/cloudflare-dyndns-panel.git cd cloudflare-dyndns-panel -
Set proper permissions:
chmod 755 *.php sudo chown -R www-data:www-data /var/www/html sudo chmod -R 755 /var/www/html chmod 666 config.json # Will be created automatically
-
Access the panel in your web browser:
https://yourdomain.com/path/to/panel/ -
First login:
- Default password:
changeme - Change the password immediately after first login!
- Default password:
- Go to Cloudflare Dashboard
- Click your profile β "My Profile"
- Go to "API Tokens" tab
- Click "Create Token"
- Choose "Create Custom Token"
Permissions:
- Zone:Zone:Read
- Zone:DNS:Edit
Zone Resources:
- Include:All zones (or specific zones)
Client IP Address Filtering:
- (Optional) Your server's IP
- Zone:Read - List your domains and find Zone IDs
- DNS:Edit - Update A records with new IP addresses
- No other permissions needed - Maximum security!
- Login with default password
changeme - Change password immediately
- Add your Cloudflare API token
- Choose update interval (or keep manual)
- Click "Load My Domains"
- Select your domain
- Click "Show A Records"
- Click "Add" next to the record you want to manage
- Find your Zone ID in Cloudflare Dashboard
- Find your Record ID using browser dev tools or API
- Enter the IDs manually in the form
- Choose an interval in the panel
- Copy the generated cron command
- Add to your crontab:
crontab -e # Paste the copied command
Example cron command for 15-minute updates:
*/15 * * * * /usr/bin/php /path/to/your/panel/auto_update.phpcloudflare-dyndns-panel/
βββ index.php # Main panel interface
βββ update.php # Manual update script
βββ auto_update.php # Automatic update script (for cron)
βββ change_password.php # Password change interface
βββ logs.php # Update logs viewer
βββ api_helper.php # API communication helper
βββ config.json # Configuration file (auto-created)
βββ update_log.json # Update logs (auto-created)
βββ last_ip.txt # Last known IP (auto-created)
βββ README.md # This file
The config.json file stores all settings:
{
"password": "$2y$10$...", // Hashed password
"api_token": "your_api_token", // Cloudflare API token
"update_interval": "15min", // Update frequency
"domains": [ // Managed domains
{
"id": "unique_id",
"zone_id": "cloudflare_zone_id",
"record_id": "dns_record_id",
"name": "dyn.example.com",
"proxied": true,
"enabled": true
}
]
}If PHP is not in /usr/bin/php, edit the cron command:
*/15 * * * * /custom/path/to/php /path/to/auto_update.php- Update logs: Stored in
update_log.json - Last 100 entries kept automatically
- View in panel: Go to "View Update Logs"
The system only updates DNS when your IP actually changes:
- Current IP stored in
last_ip.txt - Saves API calls and reduces logs
- Can be disabled by deleting the file
- Cause: Session expired or cookies disabled
- Solution: Clear browser cache and login again
- Cause: API token not saved or invalid
- Solution: Re-enter your API token in the panel
- Cause: Invalid API token or network issues
- Solution: Check token permissions and internet connection
- Check cron logs:
grep CRON /var/log/syslog - Test manually:
php auto_update.php - Check PHP path:
which php
Run the auto-update script manually to see detailed output:
php auto_update.php- Change default password immediately
- Use strong passwords (8+ characters, mixed case, numbers, symbols)
- Restrict file permissions:
chmod 600 config.json - Use HTTPS for the web interface
- Regular token rotation (every 6-12 months)
chmod 755 *.php # PHP files
chmod 600 config.json # Configuration (sensitive)
chmod 644 *.json # Other JSON files
chmod 644 *.txt # Text files- Access: Click "View Update Logs" in the panel
- Information: Timestamp, domain, IP, status, type (auto/manual)
- Statistics: Success rate, error count, update frequency
- Automatic: Keeps last 100 entries
- Manual cleanup: Delete
update_log.jsonto reset
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Cloudflare for their excellent API
- PHP community for security best practices
- Contributors who help improve this project
- Issues: GitHub Issues
- Documentation: This README and inline comments
- Community: Discussions
Made with β€οΈ for the self-hosting community
Keep your dynamic DNS records updated automatically and securely!