https://github.com/trapped/dynflare
Detect your external IP and update Cloudflare DNS records
https://github.com/trapped/dynflare
cloudflare dns dynamic-dns golang ip
Last synced: 7 months ago
JSON representation
Detect your external IP and update Cloudflare DNS records
- Host: GitHub
- URL: https://github.com/trapped/dynflare
- Owner: trapped
- License: mit
- Created: 2019-06-02T21:15:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-01T17:23:17.000Z (over 4 years ago)
- Last Synced: 2025-04-13T05:56:46.623Z (10 months ago)
- Topics: cloudflare, dns, dynamic-dns, golang, ip
- Language: Go
- Size: 11.7 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Dynflare
========
Detects your external IP address and updates a DNS record in Cloudflare.
## Install
From source: `go get -u github.com/trapped/dynflare`
Docker: `docker run trapped/dynflare --help`
## Setup
Both environment variables and CLI flags are supported.
- `CLOUDFLARE_EMAIL` or `-cloudflare-email`: Cloudflare email used for API authentication
- `CLOUDFLARE_API_KEY` or `-cloudflare-api-key`: Cloudflare API key
- `RECORDS` or `-r`: multiple values supported; DNS records in the `:::` format; if using the environment variable, join records with `,` (comma)
- `-p`: pretty-print all DNS records in a tab-separated table
- `-dry`: fake the actual DNS update
After setting everything up, you should be able to just run `./dynflare`; depending on your use-case, you might want to set up a cronjob or a Kubernetes CronJob.
## Supported IP detection mechanisms
- [x] [IPify](https://www.ipify.org)
- [x] [MyIP](https://www.myip.com)
- [ ] More public services (planned)
- [ ] Self-connect using [ngrok](https://ngrok.com) (planned)
- [x] Fetch from multiple sources and pick most seen
## Contributing
### Adding a new IP provider
IP providers must implement the `Provider` interface:
```go
type Provider interface {
Name() string
Fetch() (string, error)
}
```
Contributions are welcome! Just submit a pull request.