nsupdate_for_fritz gets the current IPv4 address of your AVM FRITZ!Box and then uses BIND's nsupdate to update one or more A records with it. It can also do the same for IPv6 addresses (AAAA records) of hosts on your network.
Additionally, sending TXT records, i.e. for Let's Encrypt, is possible.
nsupdate_for_fritz requires Python 3.9 or later, the requests library (which will be auto-installed if you proceed as below) and nsupdate.
- Debian/Ubuntu:
apt install dnsutils - Red Hat/Fedora:
dnf install bind-utils - FreeBSD:
pkg install bind-tools python3
cd to this directory and
either
pip install .for a global install or- Previously, you might want to create and activate a virtual environment
(
python -m venv venv,source venv/bin/activate).
- Previously, you might want to create and activate a virtual environment
(
pip install --user .for a user-only install- Add
~/.local/binto yourPATHenvironment variable if you have never used this before
- Add
Run docker build . --tag nsupdate_for_fritz
tsig-keygen -a HMAC-SHA512 KEY_NAME_HERE
(Skip this step if you want to use some existing key.)
Copy config.ini.example to config.ini, edit and replace all the all-caps
placeholders with your nameserver, the zone name, the key from the step above etc.
Adjust the [hosts] and [txt] sections for your network, you can delete
the latter section if you do not need to update any TXT records.
If you are running your own nameserver, the configuration for it should be similar
to this one (the key section is the output of tsig-keygen step above):
key "KEYNAME" {
algorithm hmac-sha512;
secret "SOME_SECRET_HERE";
};
zone "test.example.com" {
type master;
allow-update {
key "KEYNAME";
};
allow-query { any; };
file "/usr/local/etc/namedb/dynamic/test.example.com";
};
Run nsupdate_for_fritz --dry-run config.ini to test your configuration, then run
nsupdate_for_fritz config.ini and add it to your crontab or any other task runner.
If nsupdate_for_fritz cannot be found, either try fixing your PATH environment
variable or running via python -m nsupdate_for_fritz instead.
docker run -i localhost/nsupdate_for_fritz --dry-run - < config.ini
docker run -i localhost/nsupdate_for_fritz - < config.ini