Small tool that uses Netlink to detect IP address changes on specified interfaces and update a DNS entry using RFC 2136.
- meson
- libldns
- libinih
- libnl
- libcriterion (testing only)
These should be easily installable using your system's package manager. Note that on some distributions you may have to install libnl and libnl-route separately.
Simply clone the repository:
$ git clone https://github.com/goll72/ipupand run
$ meson setup build
$ meson compile -C buildNote that you may want to set the sysconfdir option to /etc on Linux,
otherwise ipup will look for the systemwide configuration file in
$(prefix)/$(sysconfdir), which is /usr/local/etc by default. You can set
it by adding -Dsysconfdir=/etc to the meson setup invocation.
To install, run
$ meson install -C buildIpup's configuration file uses a syntax similar to INI. For instance:
[server/example]
fqdn = example.com
# default
port = 53
key-name = example
key-secret = ...
# or, alternatively:
key-file = /etc/ipup/key
key-algo = HMAC-SHA512
max-retry = 10
[iface/wlan0]
server = example
zone = example.com
record = foo
# default: no
delete-existing = yes
# mutually exclusive
ttl = 86400s
# default: no
respect-ttl = yes- There are two types of sections. Those starting with
server/denote a DNS server, that may be reused. Those starting withiface/denote network interfaces. - Boolen options can take a value of
yes,true,1orno,falseand0. - If the record isn't a valid subdomain of the zone, it will be concatenated with it.
- Time durations can take the following specifiers:
seconds,minutes,hours ordays. Multiple specifiers are allowed, e.g.1d 2h 10m.
fqdnis the FQDN (fully qualified domain name) of the DNS server.portis the port used for the DNS connection (53 by default).key-secretis the Base64-encoded key secret.key-fileis a file containing only the Base64-encoded key secret.key-algois the encryption algorithm used. Possible values can be listed withldns-keygen -a list.max-retrysets the maximum number of times ipup will retry to send a request to the server before giving up.
serveris the name of the server used for the given interface as specified in its section (not the FQDN).ttlspecifies the TTL to be used for the records. The default TTL used if it isn't specified, and neither isrespect-ttl, is 1 hour.respect-ttlmakes the TTL of the DNS record match the TTL of the given address (valid lifetime). You should only enable it if you know your leases are consistently short enough.delete-existingwill delete any DNS records not present in the kernel address table on startup.
These options can be placed in either the server or the interface section, but they must be fully specified in only one or the other.
zoneis the DNS zone for the record.recordis the DNS record that will be updated.
Specify a configuration file with the -c option, otherwise it will
look for a configuration file in:
$(sysconfdir)/ipup/conf$XDG_CONFIG_HOME/ipup/conf~/.ipup.conf
Ipup can be run in oneshot with the -o option. When in oneshot mode, it
will only synchronize the DNS records with the host addresses and exit.
Only IPv6 is supported, as IPv4 needs an external host to be able to tell your public IPv4 address. That much is manageable, however, polling for address changes is not. Also, most commonly, IPv4 networks have NATs in place, which makes keeping track of an external IPv4 address pretty much useless.
Yes, but in some badly configured IPv6 setups (like mine), spurious router advertisements can flood the Netlink queue with duplicate addresses, so it's more ergonomic and more efficient to figure out if an address really has changed in C than in a shell script, for instance.