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 here if you need to accomplish this using LibCloud, or here if you are using a supported provider.

The Steps

  1. First, we will need to install Python

    # Debian/Ubuntu/Vyatta/EdgeOS
    sudo apt-get install python
    
    # RedHat/CentOS/Fedora
    sudo yum install python

  2. Download this script to /config/scripts/cloudflare.py

  3. Create a new file /config/scripts/ddns.py, and paste this script. Add your own information directly below the # Edit here:

  4. 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.

    chmod +x /config/scripts/ddns.py &&
    ln -s /config/scripts/ddns.py /etc/dhcp3/dhclient-exit-hooks.d/ddns.py

  5. Run the script in order to update DNS and verify that everything will work correctly

    /etc/dhcp3/dhclient-exit-hooks.d/ddns.py

0