DNSyncMyIP synchronises the dynamic IP address of a host with its domain name record.
262
This is a Python 3 script to be run on a host with a dynamic IP address and a domain name that needs to be updated whenever the IP address changes. When run, the script discovers the actual IP address currently assigned, compares it with the IP address associated with the domain name, then updates the domain record if necessary using the DNS API of the nameserver provider. If there is no domain record, a new one will be created with the actual IP address.
Presently, it only supports the DigitalOcean DNS API.
For running the script directly:
git clone https://github.com/amanda-wee/dnsyncmyip.git dnsyncmyip
pip3 install -r requirements.txt
pip3 install python-dotenv
For running the script in a Docker container:
docker pull aranel/dnsyncmyip
For running the script in a Docker container on a Synology NAS:
aranel/dnsyncmyipSet the environment variables by creating a configuration file named .env in the directory where the script will be run, or possibly a parent directory thereof. Sample configuration file where randomtoken is the DigitalOcean API token with write access for test.example.com:
DNSYNCMYIP_DIGITALOCEAN_TOKEN=randomtoken
DNSYNCMYIP_DOMAIN_NAME=example.com
DNSYNCMYIP_HOST_NAME=test
The domain name and host name are optional as they can be supplied as command line arguments.
For running the script in a Docker container on a Synology NAS:
dnsyncmyip subfolder in the user's home folder. The folder permissions should be changed to ensure that no other users have access to it..env file to this dnsyncmyip subfolder.0 * * * * python3 /path/to/dnsyncmyip.py
0 * * * * python3 /path/to/dnsyncmyip.py --domain example.com --host test
0 * * * * docker run --rm --env-file /path/to/.env aranel/dnsyncmyip
username with the username of the user:docker run --rm --env-file /var/services/homes/username/dnsyncmyip/.env aranel/dnsyncmyip
Content type
Image
Digest
Size
29.8 MB
Last updated
almost 8 years ago
docker pull aranel/dnsyncmyip