Skip to content

sbone/dreamhost_dns_updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dreamhost_dns_updater

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.

Requirements

  • bash
  • wget
  • awk

Setup

Copy the example env file:

cp .env.example .env

Then fill in your DreamHost API key and domain list in .env.

You can find your DreamHost API key in the DreamHost panel.

Usage

Run the updater:

./update.sh

Run a dry run without making API changes:

./update.sh -d

Tests

The 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.sh

The 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

About

Streamline updating of a Dreamhost DNS A record

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages