Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.26 KB

README.md

File metadata and controls

33 lines (18 loc) · 1.26 KB

cron-nsupdate-ddns


Simple shell script and Dockerfile to update an RFC 2136 zone/server with your current internet address

Builds into a very slim (23.4 MB) and lightweight container


Required parameters -

  • SERVER
  • ZONE
  • HOST
  • KEY

The first three are the standard fields from an nsupdate request.

The last is a bind key(file) to provide access to update the zone.

Other authentication methods are not supported, and key is mandatory. None of this should be difficult to udpate if you have other requirements though.

I contemplated utilizing a local key/val store to track whether the address has changed or not, but opted instead to simply query the record we're attempting to update. This means the server you are trying to send the update to must also allow querying of this record for this to work and not hammer it with updates.

The key can be mounted from a Kubernetes secret as in the sample cron manifest, or you can mount it to your pod another way.

As a very basic means of error checking the script validates that the result of the api call and dns lookup are IP addresses - that being the case, the record must already exist or the script will fail.

Big thanks to ipify.org for the awesome service that powers all this.