Skip to content

djotaku/dreamhost_dns_go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dreamhost DNS

This is a Go program for updating the IP addresses associated with your Dreamhost domain and subdomain names if you do not have a static IP address. (In other words, this makes Dreamhost a Dyanmic DNS provider)

Run this script on whatever computer is functioning as the server. (ie the one behind the ever-changing IP address)

You will need a Dreamhost API key. (See step 2 on this page)

Create a settings.json file that looks like this:

{
  "api_key": "myapikey",
  "domains": ["sub.domain1.com", "sub.domain2.com", "sub2.domain1.com"]
}

Obviously replace "myapikey" with whatever you generated by following the instructions linked above. The domains are all the domains that will be pointed to this one IP Address.

The settings.json file should be put into the xdg directory for your system. The output of the program will tell you where that is. On Linux/Unix, for example, this is $HOME/.config/dreamhostdns/settings.json

From the releases section of the repository you can grab the latest binary to run. Binaries are generated for Windows on x86-64 and Mac and Linux on x86-64 and ARM.

Run dreamhost_dns_go and it will generate minimal output as well as putting logs in the xdg DataFile location. On Linux that's $HOME/.local/share/dreamhostdns/dnsupdates.log. (Very useful if you are running as a cron job or on a systemd timer)

If you wish to have the log output also on the commandline, then run dreamhost_dns_go -v

Why Go?

Originally I wrote this program in Python, but every time I upgraded to a new version of Python, my virtual environment broke. That was really annoying for a script that I always want to automatically run via a cron job and not have to think about whether it was working correctly. Since Go is a compiled language it doesn't require virtual environments in order to run without polluting the system files.