davideaves.com

Live in a world of your own, but always welcome visitors.

View on GitHub
26 December 2010

Script to do IPv6 DNS updates via DNSSEC.

by deaves

#!/bin/bash
## Created by: deaves
# IPv6 DNS update via DNSSEC.
#
## Requires: bind9utils, dnsutils

KEYFILE="<dnssec keyfile>"

### Server Vars ###
SERVER="<dns server>"
DOMAIN="<domain to update>"
TTL="3600"
PTRNET="0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa"

### Host Vars ###
HOST="$(hostname -s)"
IPv6="$(/sbin/ifconfig | grep Global$ | sed 's/.*[^: ]*: //;s/\/.*//')"
PTR="$(nslookup ${IPv6} | sed 's/ip6.arpa.*/ip6.arpa/' | awk '{print $NF}' | grep arpa$)"

### Run nsupdate ###
nsupdate -v -k ${KEYFILE} 
tags: dns - ipv6 - linux - script - updates