@@ -0,0 +1,1148 @@
+#!/usr/bin/env python%0A%0A#%0A# Use a TSIG-signed DDNS update to update our hostname-to-address%0A# mapping.%0A#%0A# usage: ddns.py %3Cip-address%3E%0A#%0A# On linux systems, you can automatically update your DNS any time an%0A# interface comes up by adding an ifup-local script that invokes this%0A# python code.%0A#%0A# E.g. on my systems I have this%0A#%0A#%09#!/bin/sh%0A#%0A#%09DEVICE=$1%0A#%0A#%09if %5B %22X$%7BDEVICE%7D%22 == %22Xeth0%22 %5D; then%0A#        %09IPADDR=%60LANG= LC_ALL= ifconfig $%7BDEVICE%7D %7C grep 'inet addr' %7C%0A#                %09awk -F: '%7B print $2 %7D ' %7C awk '%7B print $1 %7D'%60%0A#%09%09/usr/local/sbin/ddns.py $IPADDR%0A#%09fi%0A#%0A# in /etc/ifup-local.%0A#%0A%0Aimport sys%0A%0Aimport dns.update%0Aimport dns.query%0Aimport dns.tsigkeyring%0A%0A#%0A# Replace the keyname and secret with appropriate values for your%0A# configuration.%0A#%0Akeyring = dns.tsigkeyring.from_text(%7B%0A    'keyname.' : 'NjHwPsMKjdN++dOfE5iAiQ=='%0A    %7D)%0A%0A#%0A# Replace %22example.%22 with your domain, and %22host%22 with your hostname.%0A#%0Aupdate = dns.update.Update('example.', keyring=keyring)%0Aupdate.replace('host', 300, 'A', sys.argv%5B1%5D)%0A%0A#%0A# Replace %2210.0.0.1%22 with the IP address of your master server.%0A#%0Aresponse = dns.query.tcp(update, '10.0.0.1', timeout=10)%0A

add ddns example