Forget what I said, ddclient is best for your EdgeRouter

In a prior post I wrote that one can use the in-built cron jobs of your edgerouter in order to send curl commands to update DNS records to point at your router. This solution was rock solid for me, but does a lot of things that are actually unnecessary.

What I didn't know at the time is that the EdgeRouter X also supports ddclient and so does Cloudflare. This requires a lot less set up and doesn't require any finangling of the EdgeRouter X config from the terminal / ssh (unless you'd like to). Overall, having to enter the config this way is quite annoying when you don't have access to vim or nano to edit or any standard gnutools for interacting with paths and directories.

Taking a few steps back, ddclient is a dynamic DNS client written in Perl that was formely hosted on the infamous Sourceforge. However, between me setting up it up and this blog post, they've since moved to Github.

https://github.com/ddclient/ddclient

This client is included in EdgeRouter X and it can speak to a whole host of various DNS providers. Rather than maintain my custom curl setup with cron jobs this was clearly the correct choice.

I managed to get everything working via this set up below. From what I could tell, Cloudflare used to have more robust documentation here on how to interact with their API via ddclient but it took some piecing together from blog posts as well as what remains of the official documentation. Here is my configure and then show service dns while ssh'd into the EdgeRouter X.

dns {
     dynamic {
         interface pppoe0 {
             service custom-cloudflare {
                 host-name <subdomain>.dalanmiller.com
                 host-name blog.dalanmiller.com
                 host-name "*.<subdomain>.dalanmiller.com"
                 login <cloudflare_email_address>
                 options "zone=dalanmiller.com use=web ssl=yes ttl=1"
                 password <cloudflare_api_key_here>
                 protocol cloudflare
                 server api.cloudflare.com/client/v4
             }
         }
     }
 }

I took nearly this same config and installed ddclient on a Raspberry Pi to achieve the same effect for another network I wanted to be able to route DNS entries towards.

Overall, been running this setup for over a year now without any issues.