This tutorial will walk you through the process of setting up Dynamic DNS with CloudFlare on the Ubiquiti EdgeRouter (or really any form of Linux). Please see [[ddns-using-libcloud-edgerouter|here]] if you need to accomplish this using [[https://libcloud.apache.org/|LibCloud]], or [[dynamic-dns-with-ubiquiti-edgerouter|here]] if you are using a supported provider.
=== The Steps ===
# First, we will need to install Python
{{{ lang=bash
# Debian/Ubuntu/Vyatta/EdgeOS
sudo apt-get install python
# RedHat/CentOS/Fedora
sudo yum install python
}}}
# Download [[https://gist.github.com/lasley/dc19fc32f3377fe672bc5688d4a80382|this script]] to `/config/scripts/cloudflare.py`
# Create a new file `/config/scripts/ddns.py`, and paste [[https://gist.github.com/lasley/3857dfd338cda4860cb2|this script]]. Add your own information directly below the `# Edit here`:
# 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. //Note that no execution bit is required on the `cloudflare.py` file.//
{{{ lang=bash
chmod +x /config/scripts/ddns.py &&
ln -s /config/scripts/ddns.py /etc/dhcp3/dhclient-exit-hooks.d/ddns.py
}}}
# Run the script in order to update DNS and verify that everything will work correctly
{{{ lang=bash
/etc/dhcp3/dhclient-exit-hooks.d/ddns.py
}}}
===Links===
* [[https://gist.github.com/lasley/dc19fc32f3377fe672bc5688d4a80382|cloudflare.py]]
* [[https://gist.github.com/lasley/3857dfd338cda4860cb2|ddns.py]]
Leave a Reply to Dave Lasley Cancel reply