Talk:Dynamic DNS

From DreamHost

Jump to: navigation, search

To do: I would like to consolidate the scripts on this page into a single one which works on any platform and in any NAT situation. --Datagrok 09:20, 6 Feb 2007 (PST)

I changed the sed part in "# Get URL with current configured IP", other scripts should be changed too after testing -- Byang 11:53, 22 Mar 2007 (Mountain Time)

Contents

Waa?

Password in plain text ANYWHERE? that just screams so bad for the worst shaft. You never do that, even if you had CIA like system security. --Djihed 16:42, 25 November 2007 (PST)

Spam Filter

There's a superfluous backslash at the end of the sed script in the "For SSH + Dreamhost UNIX Shell" script. It causes the shell to see the rest of the script as part of the sed script. I tried to fix the page, but the spam filter doesn't like the 'style="overflow:auto"', so I made the edit, removing the 'style="overflow:auto"'. So, now the script should work, but the display on the page overflows instead of using a scroll bar like the other listings.-- Jonathanrrogers 11:52, 24 December 2007 (PST)

this will be breaking Real Soon Now

due to some XSRF protection stuffs we've placed into the web panel (which aren't currently enforced, but will be within the next few weeks) these scripts will be breaking.

We are not intentionally breaking this specific functionality. We have no problem with people using this sort of thing to update their dns records. It's a very general change that affects almost every part of the web panel. I've already contacted the handful of people who appear to be using it the most, but I thought I'd mention something here. JeremyKitchen 05:42, 26 June 2008 (UTC)

Who is welling to modify these scripts?

Here is the explanation of what needs to be done so these scripts need to work...

The changes require an additional field to be passed to any request
which modifies information on your account (so-called Do steps).
This additional field is security_key, and is unique per session
per user and is generated based on random information we generate
on our end as well as a couple of things that are unique to your
user and session.
The security_key is provided to you on any form which leads into
a so-called Do step (and in this case, on the EditRecord step in
the Domains -> Manage area of the web panel) so you should be able
to parse it out.  It is always a 32 character hex string."

This is the "security_key" that is generated and you can find in the source code.

<input type="hidden" name="security_key" value="1c1c8512ab3f1d713db1bd95c7ef622a" />

I will try to find a way to get this value and pass it to the form but I am sure that there are good people in this kind of scripts that can fix them much faster than me.

--Flood 10:27, 27 June 2008 (UTC)

Alternative approach

What I do is this: I use an existing dynamic DNS hosting provider (DynDNS) and then have my dreamhost-ed domain point to that. That is:

  • FOO.dyndns.com is assigned to me.
  • My home machine uses ddclient to update FOO.dyndns.com
  • The dreamhost DNS record for FOO.myaccount.com is IN CNAME FOO.dyndns.com

Eanderso 04:26, 6 August 2008 (UTC)

excellent contribution Eanderso.. would you be willing to update the article to suggest this? dyndns provides reliable APIs for such things, where as we do not, and your approach is much easier, much more flexible, and much more reliable! :D

JeremyKitchen 22:40, 12 August 2008 (UTC)

I used this script as an alternative to dyndns, noip, etc. Because in China, such services are forbidden. So I'm still stuck with the problem.

Flood 14:20, 22 August 2008 (UTC)

I've updated the script for the new security_key parameter, but I can't edit the page, because it gets caught by the spam filter. Maybe an admin will come by and put this in the correct place?

#!/bin/sh
 
# Dreamhost Dynamic DNS script
#  by Rodrigo Damazio <rodrigo@damazio.org>
#     John Groszko <grosjoh1@iit.edu>
 
USER=username
PASS=
DOMAIN=yourdomain.com
HOST=yourhost
RECTYPE=A
IFACE="eth0"
 
# Shouldn't have to edit anything beyond this point
RECVAL=`env LANG=C /sbin/ifconfig $IFACE | grep "inet addr" | sed 's/.*inet addr:\([0-9.]*\).*/\1/'`
DELA="--delete-after"
COOKIEFILE=`mktemp`
LOADSAVECOOKIES="--save-cookies $COOKIEFILE --load-cookies $COOKIEFILE"
OUTFILE=`mktemp`
 
# Get login screen
wget --save-cookies $COOKIEFILE $DELA "https://panel.dreamhost.com/"
 
# Login
wget $LOADSAVECOOKIES $DELA --post-data="Nscmd=Nlogin&username=$USER&password=$PASS&" https://panel.dreamhost.com/index.cgi
 
# go to domain listing
wget $LOADSAVECOOKIES -O $OUTFILE "https://panel.dreamhost.com/index.cgi?tree=domain.manage&current_step=Index&next_step=ShowZone&domain=$DOMAIN"

# gra new security key
OLD_VALUE=`grep "editname=$HOST" $OUTFILE -m 1 | sed 's/.*editvalue=\(.*\)&.*/\1/'`

wget $LOADSAVECOOKIES -O $OUTFILE "https://panel.dreamhost.com/index.cgi?tree=domain.manage&current_step=ShowZone&next_step=ShowRecord&editname=$HOST&editzone=$DOMAIN&edittype=$RECTYPE&editvalue=$OLD_VALUE"

SECURITY_KEY=`grep 'name="security_key"' $OUTFILE -m 1 | sed 's/.*value=.\(.*\)\".*/\1/'`

POST_DATA="tree=domain.manage&current_step=ShowRecord&next_step=EditRecord&security_key=$SECURITY_KEY&newname=$HOST&newtype=$RECTYPE&newvalue=$RECVAL&newcomment=autoupdated"

echo $POST_DATA

wget $LOADSAVECOOKIES $DELA "https://panel.dreamhost.com/index.cgi" --post-data $POST_DATA

rm -f $COOKIEFILE
rm -f $OUTFILE

nsupdate?

I'm not sure if its feasible or not, but the most streamlined solution would surely be allowing the creation of key pairs for people to use nsupdate to directly update their DNS records. I know that you can already do this via an intermediate DNS server, as mentioned in the article, but this has limitations.

I'm not sure of the security implications of the above, but if it is a workable solution, implementation could be nice ;)


-- Jscinoz Sun, 04 Jan 2009 10:07:33 +0000

BSD/Mac Script

I updated the BSD/Mac script, but I had to delete all the style="overflow:auto" lines because of the spam filter.

Saul --Saulnewman 01:45, 12 January 2009 (UTC)

Personal tools