DSN Update for Ionos dns provider, looks like a DynDSN running in a docker container docker image.
1.7K
Update Ionos domain records to update the current public ip with cron delay that you can paramter
DSN Update for dns provider ionos, looks like a DynDSN This program aims is to update ip adresse for IONOS domains. It works for RECODD TYPE
running in a docker container or stand alone on linux system
docker image available :
Update IP of Ionos DNS records by taking into acount the -a 1.2.3.4 parameter if set
or if -a parameter is not set search actual external ip (ipv4 and ipv6) of the network
by asking to the Livebox from Orange or if Livebox is not present,
search external ip with service provider ifconfig.me for ipv4
or ipv4v6.lafibre.info for ipv6
if the record name in param DOMAIN and DNS_TYPE exist,
change the entire content of the record by the new ip, only if the content is different.
if the record do not exist, create it.
If the record type is SPF
then the program search for a TXT spf record and update it with
the new ip if the ip in the actual spf record has change ipv4 and ipv6.
If the record is not found do nothing
Prerequisites
Get an API Key at IONOS API Docs
https://developer.hosting.ionos.fr/docs/getstarted
the API key will be use in *API_KEY param
Syntax updateDns.sh [-a|-e|-f|-v|-s].
options:
| param | extention | effect |
|---|---|---|
| -a | 1.2.3.4 | change dns entry to given ip adress A, AAAA or SPF record type |
| -a | dmark=xxx or dns.domain.com | change CNAME, TXT, MX record with the text following -a |
| -f | filename | redirect verbose output to file |
| -v | give verbose output |
If you don't use the script in a docker container, Add the variables DOMAIN and API_KEY at the top of the script
DOMAIN="mon.domain.com:A mon.domain.net:AAAA"
API_KEY=xxxx.yyyyyy
- API_KEY = put the Api code and secret you have retrieve from ionos ex : publicprefix.secret
- DOMAIN = name of the domain/subdomain to update : dns-type. for multiple "domain:type" should be separated by space ex : DOMAIN="my.domain.net:A test.domain.net:AAAA domain.net:SPF"
- CRON_DELAY = Delay to start the DNS update via cron ex : */5 for each 5 minutes
- PARAMS = send the parameters to the script ex : -v -a (optional parameter)
- VERBOSE = indicate that you want to run with verbose mode : ex : y if you want to have more detail on the run
- BOX_IP = local ip of the livebox to be able to catch external ipv4 and ipv6 from your box ex : 192.168.0.1 (optional parameter)
- TZ = Time zone of the container ex : Europe/Paris
Working with IPv4 or IpV6
Make test before using it in real production, I could not be taken responsible for the usage of this piece of code.
Be sure of what you are doing, when updating your DNS records.
License Distributed under the MIT License. See LICENSE for more information.
Content type
Image
Digest
sha256:195d1e9c4…
Size
9.8 MB
Last updated
15 days ago
docker pull goodlinux/ionosdnsupdater