Dynamic DNS Using LibCloud – EdgeRouter

This tutorial is aimed for users with a dynamic IP, and a DNS host that does not support DynDNS. Basically, we will push our new IP every time that it changes. The steps outlined in this tutorial will work with the providers listed in [[https://ci.apache.org/projects/libcloud/docs/dns/supported_providers.html#provider-matrix|Apache’s documentation]], but I have only actually tested with Rackspace.

=== Steps ===

# First, we will need to install Python and its package manager
{{{ lang=bash
# Debian/Ubuntu/Vyatta/EdgeOS
sudo apt-get install python python-setuptools

# RedHat/CentOS/Fedora
sudo yum install python python-setuptools
}}}
# Now we install [[http://libcloud.apache.org|Apache’s Libcloud]] so that we may easily manipulate the remote DNS APIs
{{{ lang=bash
sudo easy_install apache-libcloud
}}}
# Create [[https://gist.github.com/lasley/97f437365914670c33da|this script]] in `/config/scripts/dyndns.py`. Modify the values between `# Edit Here` and `# Stop Editing` sections.
# Add execution bit and create a hard link in dhclient exit hooks directory. These two commands will need to be rerun if you flash the ERL firmware.
{{{ lang=bash
chmod +x /config/scripts/dyndns.py &&
ln -s /config/scripts/dyndns.py /etc/dhcp3/dhclient-exit-hooks.d/dyndns
}}}
# Run the script in order to update DNS and verify that everything will work correctly
{{{ lang=bash
/etc/dhcp3/dhclient-exit-hooks.d/dyndns

=== Links ===
* [[https://gist.github.com/lasley/97f437365914670c33da|libcloud_ddns.py on GitHub]]


Posted

in

, , ,

by

Comments

2 responses to “Dynamic DNS Using LibCloud – EdgeRouter”

  1. Ringo De Smet Avatar

    Dave, can you put the script as a Github Gist and link this article to it? You can make multiple revisions of your script then. I already fixed a small thing in the output: reverse the record name and domain name in the update message.

Leave a Reply

Your email address will not be published. Required fields are marked *