Scripting DynDNS
I recently needed to bulk load some entries to the DynDNS custom DNS service, I ended up using wget and a couple of bash for loops. This was the crux of it:
To login:
wget --keep-session-cookies \
--save-cookies cookies.txt \
--post-data="__login=1&username=${USERNAME}&password=${PASSWORD}" \
https://www.dyndns.com/account/
To check you are logged in:
wget --keep-session-cookies \
--load-cookies cookies.txt \
https://www.dyndns.com/account/services/zones/dns/
grep the page for ‘Logged’ you should see it say something like ‘Logged in user: blah’.
Also look towards the bottom of the page for the ‘multiform’ hidden form element, you need the value which is a string, something like ‘jaoEEPpxzAhfadQZ/dpO/A341374’
To add an entry:
NAME=test
IP=1.2.3.4
MULTIFORM="jaoEEPpxzAhfadQZ/dpO/A341374"
wget --keep-session-cookies \
--load-cookies cookies.txt \
--post-data="name_new=${NAME}&ttl_new=600&type_new=A&data_new=${IP}&submit=submit&multiform=${MULTIFORM}" \
https://www.dyndns.com/account/services/zones/dns/
Subscribe via RSS