This is a small bash script, which works as a DynDNS updater. It works only with domains which are registered at inwx.de. It only updates the ip record, if the ip has changed.
This script does not require any additional tools. All tools should be available on a regular linux system:
- curl
- sed
- Create a new directory in your home folder. E.g. dyndns.
mkdir ~/dyndns
cd ~/dyndns
- Clone the files from github
git clone git@github.com:gehaxelt/Bash-INWX-DynDNS.git .
- Edit the dnsupdate.sh and fill in your login credentials.
nano dnsupdate.sh
- Get the wished dns entry ID from the inwx website and set it in the script. See below how to get the ID.
When you not have an ID (like IPv6) than useDNSIDsv6=()
, an empty array. When you have one ID (like 7654321), useDNSIDsv6=("7654321")
and if you have multiple IDs useDNSIDsv6=("7654321" "8901234")
, same usage for IPv4. - If desired, enter at
UPDATEURLv4=""
the URL from which the IPv4 address should be retrieved, same for IPv6. - Edit your crontab. For a 5-minutes update use:
*/5 * * * * cd /home/$USER/dyndns && bash dnsupdate.sh
crontab -e
First, login to the inwx website. Navigate to "Nameserver" section:
Then open the DNS entries for your domain and right-click on the entry you'd like to dynamically update. Choose the "inspect element" menue entry.
Now you should see the developer tools and a <div>
-element. The number in the id
-attribute's value after record_div_
is the wanted number.
Copy this ID (here: 206895961) into your script.
Alternatively you can use the INWX API to obtain the record id.