c2go is a secure, lightweight Cloudflare Dynamic DNS (DDNS) client written in Go. It keeps your domain A/AAAA records updated with your dynamic public IP address automatically.
- OS Keyring Security: Uses your operating system's native secure keyring (
go-keyring) to store your Cloudflare API token. The token is never saved in plaintext on disk. - Interactive Setup Wizard: Run
./c2go --setupfor a terminal-based onboarding flow to select zones, manage records, and configure update intervals. - Multi-Domain & Multi-Record Support: Select multiple Cloudflare zones and specify exactly which A or AAAA records to keep updated.
- On-the-Fly DNS Record Creation: Create new A or AAAA records directly within the setup wizard using your current public IP.
- Smart IP Checking with Fallbacks: Retrieves your public IP via multiple services (
ipify.org,ifconfig.me,icanhazip.com) for maximum availability. - Concurrent DNS Updates: DNS records across zones are updated concurrently for minimal update latency.
- Resilient Error Handling: If updating a specific record fails, the program logs the failure and continues processing all other records.
- IP Change History: Optional local change history (up to 50 entries) stored in a readable JSON file.
- ANSI Terminal UI: Clean logging with color-coded output (cyan for info, green for success, red for errors).
c2go/
├── config/ # Configuration parsing and OS keyring integration
├── console/ # ANSI terminal utilities and logging
├── dns/ # Cloudflare API integration (raw HTTP, no SDK)
├── history/ # JSON IP history manager
├── ipcheck/ # Public IP checker with HTTP fallbacks
├── main.go # Entry point (setup wizard + service loop)
├── go.mod # Go module definition
└── .gitignore
- Go: 1.20 or newer.
- OS Keyring: A running OS-level credential storage service.
- macOS: Keychain (native).
- Linux:
dbus,gnome-keyring, orksecretservice. - Windows: Windows Credential Manager.
git clone https://github.com/InferPort/c2go.git
cd c2go
go build -o c2go .Configure the application for the first time:
./c2go --setupThe wizard guides you through:
- API Token: Enter your Cloudflare API Token (input is masked). If a token exists in your keyring, press Enter to keep it.
- Domain Selection: Select one or more domains to manage.
- Record Configuration: Select which A/AAAA records to update, or create new ones on the fly.
- Parameters: Set the update interval (minimum 60s, default 300s) and toggle IP history.
- Saving: The token is stored in your OS keyring; non-sensitive config is saved to a JSON file in your user config directory.
Run without flags to start the monitoring service:
./c2goThe service will periodically check your public IP and update Cloudflare records when a change is detected. Stop gracefully with Ctrl+C.
Files are stored in the OS user config directory:
- macOS:
~/Library/Application Support/c2go/config.json - Linux:
~/.config/c2go/config.json - Windows:
%APPDATA%\c2go\config.json
The JSON config file contains only non-sensitive settings:
{
"managed_zones": [
{
"domain": "example.com",
"records": ["@", "vpn"]
}
],
"history_enabled": true,
"update_interval": 300
}The Cloudflare API token is stored securely in your OS keyring (service name: com.inferport.c2go). If the OS keyring is unavailable, it will safely fallback to local storage inside config.json with restricted permissions (0600).
You can specify a custom configuration file path using the -config flag:
./c2go -config /path/to/custom/config.jsonTo run c2go continuously in the background on Ubuntu Server, you can configure it as a systemd service:
-
Move Binary: Copy the compiled binary to a system-wide path:
sudo cp c2go /usr/local/bin/ sudo chmod +x /usr/local/bin/c2go
-
Configure Service: Copy the provided template service file:
sudo cp c2go.service /etc/systemd/system/
-
Edit Service Configuration: Open
/etc/systemd/system/c2go.serviceand set your username in theUser=directive (or configure option B to run globally with a custom config path):sudo nano /etc/systemd/system/c2go.service
-
Enable and Start: Reload the systemd daemon, enable the service to start on boot, and run it:
sudo systemctl daemon-reload sudo systemctl enable c2go sudo systemctl start c2go -
Manage Service:
- Check status:
sudo systemctl status c2go - View logs:
journalctl -u c2go -f
- Check status:
MIT