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 Apache’s documentation, but I have only actually tested with Rackspace.
Steps ∞
- First, we will need to install Python and its package manager
# Debian/Ubuntu/Vyatta/EdgeOS sudo apt-get install python python-setuptools # RedHat/CentOS/Fedora sudo yum install python python-setuptools
- Now we install Apache’s Libcloud so that we may easily manipulate the remote DNS APIs
sudo easy_install apache-libcloud
- Create 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.
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
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.
Good call, thank you – https://gist.github.com/lasley/97f437365914670c33da