May 15 2013
Dyn SLA Update – or, How To Lose Friends and Alienate Customers
I today received an email from Dyn (previously DynDNS), stating:
Starting now, if you would like to maintain your free Dyn account, you must log into your account once a month. Failure to do so will result in expiration and loss of your hostname. Note that using an update client will no longer suffice for this monthly login.
(emphasis theirs)
Now, if this were a service which requires interaction then this would be an unfriendly but potentially fair way to weed-out inactive accounts. This isn’t one of those cases, though – I can happily go for months or even years where my only interaction with Dyn(DNS) is via auto-update clients. And this is the heart of the problem – many routers and embedded devices have built-in DynDNS clients, frequently with no option to switch to an alternative service. Possibly this is worth $25/year, possibly it isn’t. Personally, I’m not paying a penny to a company trying to hold its users to ransom like this. For my usage, there are a handful for hostnames in a Dyn(DNS) domain – and therefore these cannot to transferred to a different provider. I keep them going purely so that historic links will still work.
And, to resolve the immediate problem, I wrote this script which can be scheduled to run every 15 days in order to keep my account active – enjoy!
#!/bin/bash LOGIN="****" PASSWORD="****" COOKIES="/tmp/.dynsdns.cookies.txt" AL="en-gb" #UA="Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/0.0.0 (KHTML, like Gecko) Version/0.0.0 Safari/0.0.0" LOGINURL="https://account.dyn.com/entrance/" POSTURL="$LOGINURL" CHKURL="https://account.dyn.com/" (( DEBUG )) && DST="-" || DST="/dev/null" [[ -w "$( dirname "$COOKIES" )" ]] || { echo >&2 "FATAL: Cannot write to directory '$( dirname "$COOKIES" )'" ; exit 1; } # Ensure no broken session caching... if [[ -s "$COOKIES" ]]; then [[ -w "$COOKIES" ]] || { echo >&2 "FATAL: Cannot write to file '$COOKIES'" ; exit 1 ; } rm -f "$COOKIES" >/dev/null 2>&1 fi (( DEBUG )) && echo >&2 "DEBUG: Fetching initial headers to pre-load cookies..." curl -b $COOKIES -c $COOKIES -Ikso "$DST" -A "$UA" --url "$LOGINURL" (( DEBUG )) && echo >&2 "DEBUG: Fetching UID..." VALUE="$( curl -b $COOKIES -c $COOKIES -kso - -A "$UA" --url "$LOGINURL" | \ grep -m 1 "multiform" | \ cut -d"'" -f 6 )" (( DEBUG )) && echo >&2 "DEBUG: Read UID as '$VALUE' - posting data..." curl -b $COOKIES -c $COOKIES -d "username=$LOGIN" -d "password=$PASSWORD" -d "iov_id" -d "multiform=$VALUE" -e "$LOGINURL" -kso "$DST" -A "$UA" --url "$POSTURL" (( DEBUG )) && echo >&2 "DEBUG: Response received - verifying result..." curl -b $COOKIES -c $COOKIES -e "$POSTURL" -kso - -A "$UA" -H "Accept-Language: $AL" --url "$CHKURL" | \ grep -qE "<span>(Welcome|Hi) <b>$LOGIN</b></span>" \ && echo "Login successful" \ || { echo >&2 "Login failed" ; exit 1 ; } exit 0
Download this script from http://files.stuart.shelton.me/unix/dyndns-login.sh.
Gerry
20th June 2013 @ 10:38 pm
Sorry,
there is an error in line 48 near EMAIL.
To late to keep a clear mind 😉
|| { echo >&2 "Login failed" ; mail send -s "Dyndns web login failed !" -f "fritz.box@home.de" -t "\"$EMAIL\" ; exit 1 ; }
should be:
|| { echo >&2 "Login failed" ; mail send -s "Dyndns web login failed !" -f "fritz.box@home.de" -t \"$EMAIL\" ; exit 1 ; }
Greeting from Germany.
Titus
16th July 2013 @ 6:13 pm
Stuart, I appreciate the time and effort you put into this. I’m not very adept with code, can you tell me how I’d get this to run on my Mac? Do I just save it in a text file with a certain extension?
Stuart
16th July 2013 @ 10:32 pm
@Titus: No problem – if you follow the instructions at parezcoydigo.wordpress.com then you should be able to copy-and-paste the above shell-script into the Apple ‘Automator’ utility supplied with OS X, and it will create an application for you. Running this application just like any other will then execute the script.
Please note that I’ve not actually tried this, so please let us know how you get on 😉
2D
22nd July 2013 @ 4:03 pm
The login check is case-sensitive, but the actual login to dyndns is not. You could use grep -iqE in stead of grep -qE .
Sjef
18th September 2013 @ 7:00 am
Does this work for no-ip ???
noam
7th April 2014 @ 4:39 pm
Dyndns is stopping free account.
First there was no limit, then 5 domains, then 2, and now you have to pay ….
I’m now using ovh (6€/year) for my domains. They have a ddns option include …
Stuart
27th April 2014 @ 6:17 pm
Well, that’s that then. Would the last person to leave dyn.com please turn off the lights 🙁
I’m certainly not planning on paying dyn a penny, as this would only reward and encourage this kind of bait-and-switch behaviour. On the other hand, the domains I have (had?) with dyn were ones such as ‘.homeunix.net’ which aren’t portable to elsewhere… so I guess those sites are going dark. Congratulations, dyn, you’re killing off a small part of the internet.