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.5 firmware.
Table of Contents
Steps - Configure a Dynamic DNS
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 <www.hosname.com>
2. Set login
set service dns dynamic interface eth0 service custom-cloudflare login <cloudflare username>
3. Set password
set service dns dynamic interface eth0 service custom-cloudflare password <password key>
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=<hostname>.com"
NOTE: When using a subdomain in a Cloudflare zone, you must first create the subdomain in your Cloudflare portal. The following steps will update said subdomain, but will not create a new one.
Testing & Verification
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 : <hostname>
last update : Thu Mar 30 13:29:42 2018
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 188.8.131.52 ubnt.com. 59 IN A 184.108.40.206 ubnt.com. 59 IN A 220.127.116.11 ;; Query time: 70 msec ;; SERVER: 18.104.22.168#53(22.214.171.124) ;; WHEN: Tue Mar 20 14:59:04 EDT 2018 ;; MSG SIZE rcvd: 85