Code Monkey home page Code Monkey logo

dreamhost-dynamic-dns's Introduction

Dreamhost Dynamic DNS Script

A Dynamic DNS updater for use with the Dreamhost API


This script updates a DNS A record hosted by Dreamhost to your current IP address via the Dreamhost API.

You need to have generated an API key from the web panel with permissions for the following requests:

  • dns-list_records
  • dns-remove_record
  • dns-add_record

WARNING: Do not rely on this script to always work perfectly!! Due to the lack of update_record API request, we are forced to delete and then re-add. If there is a problem with the API, we could end up deleting a record and then fail to re-add it. If you have this in cron, it will likely update the next time the script is run, or you could just be left without a DNS record at all.

This script is dependant on the following executables: bash (this is a bash script after all), wget or curl, uuidgen, grep, awk, sed, and dig.

Usage

The script can be run using either command line options or a configuration file. A sample configuration file is found below.

SYNOPSIS

dynamicdns.bash [-Sd][-k API Key] [-r Record] [-i New IP Address] [-L Logging (true/false)]

DESCRIPTION

The dynamicdns.bash utility reads a configuration file or command-line options to update DNS records for a Dreamhost account. Options provided at the command line override any options specified within the configuration file.

The options are as follows:

-S Save any options provided via the command line to the configuration file.

-d Save any options provided via the command line to the configuration file and do not update DNS.

-v Enable verbose mode.

-k API Key

Dreamhost API Key with dns-list_records, dns-remove_record, and dns-add_record permissions.

-r Record

The DNS Record to be updated.

i IP Address

Specify the IPv4 Address to update the Record to. If no address is specified, the utility will use dig to obtain the current public IPv4 Address of your computer.

L (true/false)

Enables system logging via the logger command. The configuration file sets logging to true by default.

RUNNING WITH CRON

You can easily add this to your crontab with an entry like

@hourly ~/bin/dreamhost-dynamic-dns/dynamicdns.bash

TODO

  • Allow disabling of error logging
  • Add verbose mode

dreamhost-dynamic-dns's People

Contributors

clempaul avatar osmogar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.