Update one or more DreamHost DNS A records when your public IP changes.
The script uses the DreamHost DNS API and icanhazip.com to reconcile the configured hostnames to your current public IPv4 address.
bashwgetawk
Copy the example env file:
cp .env.example .envThen fill in your DreamHost API key and domain list in .env.
You can find your DreamHost API key in the DreamHost panel.
Run the updater:
./update.shRun a dry run without making API changes:
./update.sh -dThe test suite is a single Bash script with mocked wget and date, so it does not hit DreamHost or require extra test dependencies.
Run it with:
./tests/test_update.shThe tests cover:
- exact hostname matching, including nearby subdomains
- adding the current IP when it is missing
- removing multiple stale A records
- removing stale records without re-adding the current IP
- dry-run behavior
- stopping on DreamHost API failures