I have the following setup:

  1. A domain registered with GoDaddy
  2. A plug computer running ArchLinuxArm with a dynamic public IP
  3. Updated Domain in GoDaddy DNS Manager to point to public IP of plug computer

So far so good. However, I need to automatically update the IP (DynDns style) in GoDaddy DNS Manager if my ISP decides to change it.

Any idea how to go about it?


Currently, GoDaddy does not provide dynamic DNS, and have no API to programmaticaly update DNS

According to GoDaddy support:

... DNS modifications through scripts would not be possible with our DNS services. These changes can only be done from within the DNS Manager interface that is provided as part of your customer account.

Thus you need 3-rd party provider for dynamic DNS, and you have the following options:

  1. Move your domain to DNS hosting service which does support dynamic DNS (like no-ip.com, my own net-me.net, and many others). GoDaddy may remain your domain registrar, but you use 3-rd party DNS hosting.

  2. (Simpler) Setup any dynamic DNS account, can be 3rd-level domain like yourusername.some-dynamic-dns-provider.net, and setup a CNAME DNS record with GoDaddy which will point to your dynamic domain name. For example if you have www.yourdomain.com CNAME yourusername.some-dynamic-dns-provider.net, all requests for www.yourdomain.com will be redirected by DNS to your dynamic IP address. Though CNAME record can not be created for naked domain (yourdomain.com, without www.).

  3. You can also move you domain altogether to another domain registrar, which does support dynamic DNS. (I think namecheap.com does.)

| improve this answer | |

Assuming you have a server running Linux, and you are looking to update a DNS A record with the IP of your home server, you could do the following on the home server. Note that it my violate your EULA. Be sure that you follow the rules!

  1. Install Python2.7 (it is likely already installed).

  2. Place the following file at /config/scripts/godaddy_ddns.py. It is the part that does the actual work of updating godaddy using the pygodaddy library. It will update all domains associated with your godaddy account. It will set an A record for the '@' subdomain wildcard. You can edit this, if you want to specify alternate subdomains. You must also replace '@USERNAME@' with your godaddy username and '@PASSWORD@' with your godaddy password.

    #!/usr/bin/env python
    import logging
    import pif
    import pygodaddy
    # Original Source:
    # https://saschpe.wordpress.com/2013/11/12/godaddy-dyndns-for-the-poor/
    # https://github.com/observerss/pygodaddy
    # Modified by Jeremy Sears (https://stackoverflow.com/users/1240482/jsears)
    logging.basicConfig(filename='godaddy.log', format='%(asctime)s %(message)s', level=logging.INFO)
    # the "requests" library logs noisily, so turn that off                                                       
    logging.debug("DEBUG:   Running godaddy_ddns.py");
    client = pygodaddy.GoDaddyClient()                       
    success = client.login(U,P)                              
    if success:                                                                                      
            logging.debug("DEBUG:   Successfully logged in.")                                        
            logging.error("ERROR:   Failed to log in to godaddy.com with username: '{0}'.".format(U))
    for domain in client.find_domains():                                            
            logging.debug("DEBUG:   Looking up DNS Records for {0}.".format(domain))           
            dns_records = client.find_dns_records(domain)                                      
            public_ip = pif.get_public_ip()                                                    
            logging.debug("DEBUG:   Domain '{0}' DNS records: {1}".format(domain, dns_records))
            logging.debug("DEBUG:   Current Public IP '{0}'.".format(public_ip))
            if len(dns_records) == 0:                                                                  
                    logging.debug("DEBUG:   No existing DNS records found.")                           
                    logging.debug("DEBUG:   Existing IP in DNS is '{0}'.".format(dns_records[0].value))
            if len(dns_records) == 0 or public_ip != dns_records[0].value:                      
                    logging.debug("DEBUG:   Updating A record for domain '{0}'.".format(domain))                                  
                    success = client.update_dns_record("@."+domain, public_ip)                                                    
                    if success:                                                                                                   
                            logging.info("INFO:     Domain '{0}': Successfully set public IP to '{1}'.".format(domain, public_ip))
                            logging.error("ERROR:   Domain '{0}': Unable to update public IP to '{1}'.".format(domain, public_ip))                         
                    logging.info("INFO:     Public IP A record DNS record for domain '{0}' is up to date, and does not need to be updated.".format(domain))
  3. Run sudo chown root /config/scripts/godaddy_ddns.py

  4. Run sudo chmod u+x /config/scripts/godaddy_ddns.py
  5. Place the following file at /config/scripts/godaddy_ddns.sh. This is a wrapper script that sets up a virtualenv to isolate the libraries used by the python script. It then invokes the above python script.

    # Original Source:
    # https://saschpe.wordpress.com/2013/11/12/godaddy-dyndns-for-the-poor/
    # https://github.com/observerss/pygodaddy
    # Modified by Jeremy Sears (https://stackoverflow.com/users/1240482/jsears)
    ROOT_DIR=$(dirname $0)
    if [ -n "$1" ] ; then
    mkdir -p $WORKING_DIR
    if [ ! -d .venv27 ] ; then
        curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.tar.gz
        tar xvfz virtualenv-1.9.tar.gz
        python virtualenv-1.9/virtualenv.py .venv27
    source .venv27/bin/activate
    pip install -q --upgrade pif pygodaddy
    cd $OLD_PWD
  6. Run sudo chown root /config/scripts/godaddy_ddns.sh

  7. Run sudo chmod u+x /config/scripts/godaddy_ddns.sh
  8. Place the following file at /etc/cron.hourly/run_godaddy_ddns (no file extension). This will call the godaddy_ddns.sh script each hour.

    exec /config/scripts/godaddy_ddns.sh $WORKING_DIR     
    exit 0                                                
  9. Run sudo chown root /etc/cron.hourly/run_godaddy_ddns

  10. Run sudo chmod u+x /etc/cron.hourly/run_godaddy_ddns
  11. Logs will be written to godaddy.log in the /var/local/godaddy_ddns directory. This directory can be changed by editing the run_godaddy_ddns script.
  12. Place the following file at /etc/logrotate.d/godaddy_ddns (no file extension). This will ensure that your log file doesn't fill up your disk, by rotating the log file. If you changed the logging location, you will need to edit the log file location.

    /var/local/godaddy_ddns/godaddy.log {
        rotate 12
        maxage 365                                                       

Security Note: You probably should edit the run_godaddy_ddns script and su to a user other than root, so that the script is run with more limited permissions.

| improve this answer | |

Checkout ddclient or INADYN if they can't do it, you maybe best with a self written solution based in the API from GoDaddy and here is a link to a script I am using to update my DNS: http://paste.org/49922


hosts=( 'your.host.tld' )
pass_enc='password using base64'
pass=`echo $pass_enc | base64 -d`
myip=`dig a myip.opendns.com @resolver1.opendns.com +short`
lastip=`cat $lastipfile`

if [ "$myip" != "$lastip" ]; then
  for host in ${hosts[@]};
      wget -O /dev/null --quiet --no-check-certificate $URL
      echo $myip > $lastipfile
      touch $lastipfile
  echo "IP did not change!" > /dev/null
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.