A simple script and Dockerfile to dynamically update a DNS record on a Dreamhost account.
Get an API key from Dreamhost here with All dns functions
allowed
You can run the script standalone if you have requests
installed:
env API_KEY=<dreamhost_api_key> DOMAIN=<my_domain.com> python update_dns.py
You can run the script in a docker container:
docker run -it --rm \
-e API_KEY=<dreamhost_api_key> \
-e DOMAIN=<my_domain.com>
raydouglass/dreamhost-dynamic-dns:latest
There are two required and on optional environment variables:
API_KEY
- An API key from Dreamhost withAll dns functions
allowedDOMAIN
- A comma separated list of domain names that have DNS enabled on the Dreamhost accountIP_LOOKUP_URL
- Optional: a URL which returns the IP address of the user as plain text- By default this is https://api.ipify.org/?format=text
- Another one could be https://wtfismyip.com/text