/dynip-ng

Listens on your external interface and updates your files and Cloudflare DNS records

Primary LanguageGoGNU General Public License v3.0GPL-3.0

Dynamic IP Updater

Listens on your external interface and updates your files and Cloudflare DNS records

GoDoc Go Report Card Build Status

Overview

This tool was born out of a simple problem: not having access to a static IP address. Since configuration for some programs relies on the IP being explicitly specified, it's annoying to adapt configuration whenever the external IP changes.

The same goes for DNS records that are hosted on Cloudflare. If the external IP is listed in one of your zone's records, why log in every time and change it manually?

Cloudflare has an API and go provides a templating language. This small tool leverages the two.

How to install

The easiest way is to run

go get github.com/els0r/dynip-ng
cd $GOPATH/src/github.com/els0r/dynip-ng
go generate

This will fetch the source code, compile it (with the version baked into the binary) and provide a deployable archive with systemd files and an example configuration.

How to configure

Check the example configuration for how to configure the tool.

It can be verified with

dynip-ng config -c /path/to/config/file

How to run

To start the listener from the command line, run

dynip-ng run -c /path/to/config/file

If you are debian-based and want to run it as a daemon (recommended), copy the dynip.service file to your systemd files and run

systemctl enable dynip.service
systemctl start dynip.service

How to deploy

If you want to deploy the TAR archive with the pre-defined directory structure (see install.sh), run

tar xf dynip.tar.bz2 -C / --strip-components=2

Bug Reports

Please use the issue tracker for bugs and feature requests.

License

See the LICENSE file for usage conditions.