RFC 2136 Dynamic DNS Update Script for FreeBSD

This script uses the NSLOOKUP utility on FreeBSD to do dynamic DNS updates using the public IP address. This script uses the RFC 2136 Dynamic DNS updates standard. On FreeBSD 10+ you need to install NSUPDATE using ports.

Requirements

  • FreeBSD 8,9,10
  • BIND Utilities
  • Functional RFC 2136 DNS server

The script is very self explanatory, at minimum change the first three lines to your required values, then setup a cronjob to run the script every few minutes.

# Basic Settings
set HOSTNAME="foo.bar.domain.tld"
set TTL=30
set SECRET="<enter base64 encoded hmac-md5 secret here>"

The latest version of the script may be downloaded from the GitHub repository: update.sh. For example, from the console:

mkdir -p /usr/local/libexec/dynamicdns
cd
fetch --no-verify-peer -o /usr/local/libexec/dynamicdns/update.sh https://raw.githubusercontent.com/tuaris/DynamicDNS/master/update.sh
chmod +x /usr/local/libexec/dynamicdns/update.sh