Eugene Smiley on 23 Apr 2014 10:48:22 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Fwd: Your Dyn account status will change in 14 days

I use Namecheap for my domain services and they provide dynamic DNS via ddclient if you use their DNS servers,

You can also update via cron using their "browser" update feature,

On Wed, Apr 23, 2014 at 9:39 AM, brent timothy saner <> wrote:
If you have a linode[0] (or, rather, are using their nameservers), you
can use their API.

I have a cronjob that updates various records that looks a little
something like this (partdon the linebreaks):


curl --globoff -s -o /dev/null

You can generate your API key by logging in and going to

Once that's done (let's say your API key is ABC123, though the real
value should be much more complex), to get a list of domains you can do:

 curl --globoff -s
'' | sed
-e 's/[{}]/''/g' | awk -v k="text" '{n=split($0,a,","); for (i=1;
i<=n; i++) print a[i]}' | sed -e 's/^\("DOMAINID.*\)/\n\1/g'

Now, let's say the domain you want to update has a UUID of 000000.

You can then get a list of *RECORDS* for that domain this way:

curl --globoff -s
| sed -e 's/[{}]/''/g' | awk -v k="text" '{n=split($0,a,","); for
(i=1; i<=n; i++) print a[i]}' | sed -e 's/^\("DOMAINID.*\)/\n\1/g'

Let's say that the A record for sub.domain.tld has a UUID of 111111.
The final kit and kaboodle to update your A record would be:

curl --globoff -s -o /dev/null

I recommend setting the TTL to 5 mins and running the cron every 10 mins.

You can do a lot of other neat stuff[1] with their API as well.

NOTE: This passes the API key and other sensitive information via a
URL, so this should only be done with a trusted upstream.

If you want to implement a bit more security, you could run a PHP
script on somewhere static and trusted (liiiike, a Linode! or
whatever.) that will take the visitor IP and use that as a variable to
make the same API call (you'd replace [remote_addr] with the variable
or a hardcoded value, so something like ....Target=
That would let you lock down the PHP script with HTDIGEST and HTTPS or
the like.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --