Skip to content

Instantly share code, notes, and snippets.

@mschmitt
Created March 12, 2014 15:01
Show Gist options
  • Save mschmitt/9508729 to your computer and use it in GitHub Desktop.
Save mschmitt/9508729 to your computer and use it in GitHub Desktop.
dyn-bind-updater.sh
#!/bin/sh
# Aktuelle IP
IP=`lynx --dump --source http://www.ipv4.dyn.f00.net/ip.php`
IP6=2001:db8::1234:5678
KEY='dynupdate-meinkey:UGVuaXMhCg=='
HOST='meinhost.dyn.meinedomain.de'
nsupdate -y $KEY <<Ende
server meinnameserver.meinedomain.de
update delete $HOST
update add $HOST 1 A $IP
update add $HOST 1 AAAA $IP6
send
Ende
@jpmens
Copy link

jpmens commented Mar 12, 2014

I strongly recommend using this:

IP=`curl -qs -4 http://ip4.telize.com`
IP6=`curl -qs -6 http://ip6.telize.com`

It's fast, and good. And http://ip.telize.com gives you response (v4 or v6) depending on how query got there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment