EdgeRouter - Custom Dynamic DNS


 Overview


This article provides instructions for adding a custom dynamic DNS server to EdgeRouter. Completing this guide will allow a domain name to resolve to an IP address. This guide is useful when a custom dynamic DNS server is used. More commonly, a sever that is already included in the EdgeOS configuration can be used which is covered in the EdgeRouter - Dynamic DNS Commands article.

NOTES & REQUIREMENTS:
This article applies to all EdgeRouter models and is written on 1.10.6 firmware.

Table of Contents

  1. Steps - Configure a Dynamic DNS
  2. Steps - Test the Dynamic DNS Status
  3. Related Articles

Steps - Configure a Dynamic DNS


Back to Top

In this article we will use Cloudflare dynamic DNS service as an example. 

CLI: Access the command line interface (CLI). You can do this using the CLI button in the GUI or by using a program such as PuTTY.

1. Set hostname

set service dns dynamic interface eth0 service custom-cloudflare host-name <subdomain.domain.com>

2. Set login

set service dns dynamic interface eth0 service custom-cloudflare login <user@domain.com>

3. Set password

set service dns dynamic interface eth0 service custom-cloudflare password <CloudFlare API Key>

NOTE: The password will be the API key generated by Cloudflare. To find this key, log into Cloudflare, click on my profile, and view the global API key at the bottom of the page.

4. Set protocol

set service dns dynamic interface eth0 service custom-cloudflare protocol cloudflare

5. Set server

ATTENTION: The following command is only needed when using firmware prior to version 1.10.5. 

set service dns dynamic interface eth0 service custom-cloudflare server www.cloudflare.com

6.  Set options

set service dns dynamic interface eth0 service custom-cloudflare options zone=domain.com


NOTE: When using a subdomain in a Cloudflare zone, you must first create the subdomain in your Cloudflare portal. Optional step 6 above will update said subdomain, but will not create a new one.

Testing & Verification


Back to Top

It may take some time for the servers to update and resolve the hostname to the correct address. Wait before proceeding to test. To verify that the connection to the DDNS service is up use this command:

admin@ubnt:~$ show dns dynamic status 
interface    : eth0
ip address   : <PublicIP>
host-name    : <domain>
last update  : Thu Mar 30 13:29:42 2018
update-status: good

If the dig utility is installed on a client, you may use this utility to verify the resolution.

Computer:~ admin$ dig ubnt.com

; <<>> DiG 9.9.7-P3 <<>> ubnt.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58783
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;ubnt.com.			IN	A

;; ANSWER SECTION:
ubnt.com.		59	IN	A	54.148.154.54
ubnt.com.		59	IN	A	52.41.83.111
ubnt.com.		59	IN	A	54.71.247.231

;; Query time: 70 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Mar 20 14:59:04 EDT 2018
;; MSG SIZE  rcvd: 85

Related Articles


Back to Top

EdgeRouter - Dynamic DNS Commands


We're sorry to hear that!