Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Dynamic DNS for your GoDaddy domains

by stevieb (Canon)
on May 17, 2022 at 18:26 UTC ( #11143954=CUFP: print w/replies, xml ) Need Help??

With its API, GoDaddy makes it easy to do dynamic DNS updates for your domain's hostnames. I made it easy to do with Perl with Net::DynDNS::GoDaddy (which uses my new Addr::MyIP to get your current external IP address). I'll give an example, then an example use of the distribution's packaged binary script.

use Addr::MyIP; use Net::DynDNS::GoDaddy; my $hostname = 'home'; my $domain = ''; my $current_host_ip = host_ip_get($hostname, $domain); my $my_ip = myip(); if ($current_host_ip ne $my_ip) { host_ip_set($host, $domain, $my_ip); }

Simple. The library requires a godaddy_api.json file in your home directory (MacOS, Unix or Windows, the software has 100% test coverage on all systems) that looks like this:

{ "api_key" : "api_key", "api_secret" : "api_secret" }

Using the binary we'll install when you install the library, it will prompt you for this information on its initial run:

> update-ip home Please enter your GoDaddy API key and hit ENTER: ...api_key... Please enter your GoDaddy API secret and hit ENTER: ..api_secret... Updated record for '' from x.x.x.x to x.x.x.x

...after the initial run, it won't prompt anymore:

> update-ip home Not updating the '' record, IPs are the same

You can specify the IP if you don't want to use your current public-facing one we automatically get for you:

> update-ip home

The most useful use for me is to have multiple hostnames ('home', 'office', 'roaming' etc) and just run the program through cron:

# Home storage server */15 * * * * update-ip home >> /tmp/update-home_cron.log 2 +>&1

My laptop:

*/15 * * * * update-ip roaming >> /tmp/update-roaming_cron +.log 2>&1


Usage: update-ip host [ip.addr]

Have fun!


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://11143954]
Approved by kcott
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-03-31 03:47 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (74 votes). Check out past polls.